This topic is now archived and is closed to further replies.

Sprite rotation

This topic is 6668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

well.. i take it your trying to make it realistic (no?). But realistically, wouldn't it automatically turn less as it goes slower? Ex.
car [at (0,0)] is going at a velocity of 1 in y direction. Every iteration, the speed is added. The car can turn 10° in each iteration... so it decides to turn 50 degrees. It completes this turn at (0,5).

Howver, if the car is going at a vel of 5, then it completes the turn at (0,25).

ist iteration: (0,5);
2nd iteration: (0,10);
4th iteration: (0,20);
5th iteration (0,25);

thus, it's like he can't turn as much by default.


Share this post

Link to post
Share on other sites

I have a 32 directional sprite that im rotating as it takes corners and such around
alittle track, i was wondering how i would limit the rotation based on the speed of the sprite, like when a car is going fullspeed
it can't take a real sharp turn...
Im handling the turning like this, for instance if the left arrow key is hit
Sprite1->m_Delay--; if(Sprite1->m_Delay == 0) { Sprite1->m_Delay = 2; if(--Sprite1->m_Frame < 0) { Sprite1->SetFrame(31); }

is there like some math i could use or sumthing to limit how far it can rotate based
on CurrSpeed...
Any help would be greatly apprieciated..

Share this post

Link to post
Share on other sites