2
Bullet = WrapTile:extend {
3
image = 'data/laser.png',
5
--self.velocity = vector.new(1000, 0) -- veclocity 800
6
--self.velocity:rotate_inplace(self.rotation)
8
self.velocity = vector.new(
9
love.mouse.getX() - the.app.width / 2,
10
love.mouse.getY() - the.app.height / 2
12
self.velocity:normalize_inplace()
13
self.velocity = self.velocity * 1000
15
self.rotation = math.atan2(self.velocity.y, self.velocity.x)
17
self.createdAt = love.timer.getTime()
19
onUpdate = function(self, dt)
20
if love.timer.getTime() - self.createdAt > 1 then
21
-- TODO: reuse these (see factory idea above)
23
the.app.view:remove(self)
b'\\ No newline at end of file'