/traderous

To get this branch, use:
bzr branch http://9ix.org/bzr/traderous
11 by Josh C
pew pew!
1
-- TODO: these need to come out of a factory
2
49 by Josh C
make bullets not wrap
3
Bullet = Tile:extend {
11 by Josh C
pew pew!
4
   image = 'data/laser.png',
5
   onNew = function(self)
65 by Josh C
enemy is back
6
              self.velocity = vector.new(1000, 0)
7
              self.velocity:rotate_inplace(self.rotation)
11 by Josh C
pew pew!
8
9
              self.createdAt = love.timer.getTime()
29 by Josh C
shoot things!
10
11
              the.bullets:add(self)
11 by Josh C
pew pew!
12
           end,
13
   onUpdate = function(self, dt)
29 by Josh C
shoot things!
14
                 if love.timer.getTime() - self.createdAt > 0.7 then
11 by Josh C
pew pew!
15
                    -- TODO: reuse these (see factory idea above)
35 by Josh C
fix double-removing sprites (and subsequent zombie mirror bullets).
16
                    the.bullets:remove(self)
11 by Josh C
pew pew!
17
                    self:die()
18
                 end
19
              end
20
}