25
25
maxVelocity = {x=velLimit,y=velLimit},
26
26
minVelocity = {x=-velLimit, y=-velLimit},
28
27
onStartFrame = function(self)
29
28
--local dx = love.mouse.getX() - self.x
30
29
--local dy = love.mouse.getY() - self.y
35
34
self.acceleration.x = dx * 2
36
35
self.acceleration.y = dy * 2
38
37
--TODO: acceleration limit. It should at least be proportional (not 16:9)
56
39
onUpdate = function(self)
57
40
self.rotation = math.atan2(self.velocity.y, self.velocity.x)