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