/spacey

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

« back to all changes in this revision

Viewing changes to bullet.lua

  • Committer: Josh C
  • Date: 2013-05-04 20:47:29 UTC
  • Revision ID: josh@9ix.org-20130504204729-0g2wmw6k4nvsh58s
basecode main.lua

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
Bullet = Tile:extend {
3
 
   image = 'data/laser.png',
4
 
   onNew = function(self)
5
 
              self.velocity = vector.new(800, 0) -- veclocity 800
6
 
              self.velocity:rotate_inplace(self.rotation)
7
 
 
8
 
              self.createdAt = love.timer.getTime()
9
 
           end,
10
 
   onUpdate = function(self, dt)
11
 
                 if love.timer.getTime() - self.createdAt > 2 then
12
 
                    -- TODO: reuse these (see factory idea above)
13
 
                    self:die()
14
 
                    the.app.view:remove(self)
15
 
                 end
16
 
              end
17
 
}
 
 
b'\\ No newline at end of file'