I have now this like code:
function onTimer(event)
body:setAngle(body:getAngle() + 0.06981310179)
end
timer = Timer.new(10, 45)
timer:addEventListener(Event.TIMER, onTimer, timer)
timer:start()
So it runs onTimer 45 times. It turns 180 degrees on every run, but when i run it like 200 times, the body is like 1 degrees in wrong angle, if i do it 1000 times it can be couple of degrees in wrong angle.
So whats perfect "1 degree" number to setAngle()?
Comments
or make a variable body.rotation = 0. then simply do body.rotation = body.rotation + 1 on each timer event, and do body:setAngle(math.rad(body.rotation))
Likes: SinisterSoft
https://play.google.com/store/apps/developer?id=Into-It+Games
http://appstore.com/LidiaMaximova
Thank you!
https://deluxepixel.com