/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-06-11 00:15:54 UTC
  • Revision ID: josh@9ix.org-20130611001554-tkzp73ke16buhnuy
bring indicators a little closer from edge

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'