/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-10-21 18:10:48 UTC
  • Revision ID: josh@9ix.org-20131021181048-03jg7enu0pu4mmco
recharge shields automatically for free, remove bandit bounty

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)
17
16
              the.rockColliders:add(self.collider)
18
17
           end,
19
18
   onUpdate = function(self, dt)
49
48
              end,
50
49
   onCollide = function(self, other)
51
50
                  if other:instanceOf(Bullet) then
52
 
                     the.app.view:remove(self.rock)
53
 
                     the.app.view:remove(self)
 
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)
54
61
                     the.rockColliders:remove(self)
55
62
                     self.rock = nil -- break circular reference
56
63
 
57
 
                     the.app.view:remove(other)
58
64
                     the.bullets:remove(other)
 
65
                     other:die()
59
66
                  end
60
67
               end
61
68
}
 
 
b'\\ No newline at end of file'