Jump to content

  • Log In with Google      Sign In   
  • Create Account


Sprite rotation


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Steve   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 September 1999 - 06:33 PM

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


Sponsor:

#2 Queasy   Members   -  Reputation: 157

Like
Likes
Like

Posted 14 September 1999 - 04:41 PM

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.


#3 Kentamanos   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 September 1999 - 06:33 PM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS