Jump to content
  • Advertisement
Sign in to follow this  
VoidChoice

rotation speeds different...

This topic is 5128 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

Hi, I have a game using the cdx lib... my "players" are derived from a cdx sprite. all is well, except when i press left cursor to rotate left i have a noticably different rotate speed to when i rotate right with right cursor... The code is very simple an there is no differences which i can see at all... here is the core bit... if(rotFoot == FOOT_LEFT) if(eFixedFoot == FOOT_LEFT) m_Angle += m_AngleAccel; else if(eFixedFoot == FOOT_RIGHT) m_Angle -= m_AngleAccel; rotFoot is an enum passed into the function from the input device... if <|- is pressed the Rotate(FOOT_LEFT) an vica versa...m_AngleAccel is 0.05 until the key is lifted then it is reduced gradualy. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by VoidChoice
rotFoot is an enum passed into the function from the input device... if <|- is pressed the Rotate(FOOT_LEFT) an vica versa...m_AngleAccel is 0.05 until the key is lifted then it is reduced gradualy.

Any ideas?


Could you perhaps clarify what is happening and what you expect to happen (or provide more code)? From the code sample you provided, I strongly recommend inserting braces for EVERY if and else statement so you're sure that the correct branch is executed -- in fact, this may be your problem if you nested too many of these prior to the provided sample.

[Edited by - mnansgar on November 28, 2004 1:37:46 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!