/spacey

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

« back to all changes in this revision

Viewing changes to player.lua

  • Committer: Josh C
  • Date: 2013-05-14 17:49:03 UTC
  • Revision ID: josh@9ix.org-20130514174903-790agtxqfvz8lnzv
player death

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
                       the.cursor:inTargetArea() then
52
52
                           --print('pew')
53
53
                           b = Bullet:new{
54
 
                              x = self.x, y = self.y,
 
54
                              x = self.x + self.width / 2,
 
55
                              y = self.y + self.height / 2,
55
56
                           }
56
57
                           the.app.view:add(b)
57
58
                           self.lastFired = love.timer.getTime()
58
59
                     end
59
60
                  end,
60
61
   onUpdate = function(self)
61
 
              end
 
62
              end,
 
63
   onEndFrame = function(self)
 
64
                   self:collide(the.rockColliders)
 
65
                end,
 
66
   onCollide = function(self, other)
 
67
                  if other:instanceOf(RockCollider) then
 
68
                     the.app.view:add( Boom:new {
 
69
                                          x = self.x,
 
70
                                          y = self.y,
 
71
                                          velocity = { rotation = 5 }
 
72
                                       })
 
73
 
 
74
                     self:die()
 
75
 
 
76
                     local over = Text:new{
 
77
                        y = self.y,
 
78
                        x = self.x - the.app.width / 2,
 
79
                        width = the.app.width,
 
80
                        align = 'center',
 
81
                        font = 25,
 
82
                        text = "Game Over" }
 
83
                     the.app.view:add(over)
 
84
                  end
 
85
               end
62
86
}
 
 
b'\\ No newline at end of file'