bzr branch
http://9ix.org/bzr/traderous
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
-- TODO: these need to come out of a factory Bullet = Tile:extend { image = 'data/laser.png', onNew = function(self) -- set velocity.x,y from vector velocity -- rotation should be passed in at creation self.createdAt = love.timer.getTime() end, onUpdate = function(self, dt) if love.timer.getTime() - self.createdAt > 2 then -- TODO: reuse these (see factory idea above) self:die() the.app.view:remove(self) end end } |