/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-13 21:40:14 UTC
  • Revision ID: josh@9ix.org-20130513214014-cpvr4zqooyl6nxf3
don't fire from top-left corner of the ship.  ...  fire from center of 
ship for now.  :)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
-- TODO: these need to come out of a factory
2
2
 
3
 
Bullet = Tile:extend {
 
3
Bullet = WrapTile:extend {
4
4
   image = 'data/laser.png',
5
5
   onNew = function(self)
6
6
              --self.velocity = vector.new(1000, 0) -- veclocity 800
18
18
              self.createdAt = love.timer.getTime()
19
19
           end,
20
20
   onUpdate = function(self, dt)
21
 
                 if love.timer.getTime() - self.createdAt > 2 then
 
21
                 if love.timer.getTime() - self.createdAt > 1 then
22
22
                    -- TODO: reuse these (see factory idea above)
23
23
                    self:die()
24
24
                    the.app.view:remove(self)