/traderous

To get this branch, use:
bzr branch http://9ix.org/bzr/traderous

« back to all changes in this revision

Viewing changes to rock.lua

  • Committer: Josh C
  • Date: 2013-05-14 17:13:43 UTC
  • Revision ID: josh@9ix.org-20130514171343-s251e971hc92mzb0
shoot things!

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
                 rock = self
14
14
              }
15
15
 
 
16
              the.app.view:add(self.collider)
16
17
              the.rockColliders:add(self.collider)
17
18
           end,
18
19
   onUpdate = function(self, dt)
48
49
              end,
49
50
   onCollide = function(self, other)
50
51
                  if other:instanceOf(Bullet) then
51
 
                     local b = Boom:new {
52
 
                        x = self.x,
53
 
                        y = self.y,
54
 
                        velocity = {
55
 
                           rotation = util.signOf(self.rock.rotation) * 5
56
 
                        }
57
 
                     }
58
 
                     the.app.view:add(b)
59
 
 
60
 
                     the.rocks:remove(self.rock)
 
52
                     the.app.view:remove(self.rock)
 
53
                     the.app.view:remove(self)
61
54
                     the.rockColliders:remove(self)
62
55
                     self.rock = nil -- break circular reference
63
56
 
 
57
                     the.app.view:remove(other)
64
58
                     the.bullets:remove(other)
65
59
                  end
66
60
               end