#### Archived

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

# Sprite rotation

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

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

~queasy.

##### Share on other sites
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

##### Share on other sites
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.

1. 1
2. 2
3. 3
Rutin
17
4. 4
5. 5

• 14
• 9
• 10
• 12
• 17
• ### Forum Statistics

• Total Topics
632906
• Total Posts
3009155
• ### Who's Online (See full list)

There are no registered users currently online

×