/traderous

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

« back to all changes in this revision

Viewing changes to bullet.lua

  • Committer: Josh C
  • Date: 2013-05-05 17:28:21 UTC
  • Revision ID: josh@9ix.org-20130505172821-t5ba218dz1pkjois
ignore deploy dir

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(1000, 0)
6
 
              self.velocity:rotate_inplace(self.rotation)
7
 
 
8
 
              self.createdAt = love.timer.getTime()
9
 
 
10
 
              the.bullets:add(self)
11
 
           end,
12
 
   onUpdate = function(self, dt)
13
 
                 if love.timer.getTime() - self.createdAt > 0.7 then
14
 
                    -- TODO: reuse these (see factory idea above)
15
 
                    the.bullets:remove(self)
16
 
                    self:die()
17
 
                 end
18
 
              end
19
 
}
 
 
b'\\ No newline at end of file'