Sprite rotation

Started by
1 comment, last by Steve 24 years, 7 months ago
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.


~queasy.

Jonathan Makqueasy gamesgate 88[email=jon.mak@utoronto.ca]email[/email]
Advertisement
Hello,

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..
Thanks

I think another way to look at this is that the rotation rate of the car's sprite should be the same, and the velocity of the car will automatically make it a wider turn.
-Kentamanos

This topic is closed to new replies.

Advertisement