/spacey

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

« back to all changes in this revision

Viewing changes to rock.lua

  • Committer: Josh C
  • Date: 2013-06-08 00:02:37 UTC
  • Revision ID: josh@9ix.org-20130608000237-v50hyqvrinp5g4rs
try to make setting screen resolution more reliable

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'