Lerp rotation problem

For questions about using Classic.

Post » Tue Feb 01, 2011 12:09 am

Basically what I'm trying to do is get a sprite to tilt left or right, depending on which key is pressed, but i would like this to happen in a smooth motion, so i figured lerp would work, which it does, but only for one direction.

In the cap below, you can see that when the right key is pressed it rotates clockwise to a 45 degree angle, however when the left key is pressed it still rotates clockwise to get to 315 degrees.
http://dl.dropbox.com/u/6660860/lerp.cap
B
7
S
2
G
4
Posts: 164
Reputation: 2,418

Post » Tue Feb 01, 2011 12:40 am

Why not simply tell Construct in which direction to rotate? Like so:

[url:1lelejd0]http://dl.dropbox.com/u/2306601/lerp_bb.cap[/url:1lelejd0]
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests