Advertisement
Guest User

problem

a guest
Apr 25th, 2015
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. void SonicSprite::CalculateMovementSpeed(double deltaTime)
  2. {
  3.     if (GAME_ENGINE->IsKeyboardKeyDown(VK_RIGHT) || GAME_ENGINE->IsKeyboardKeyDown(VK_LEFT))
  4.     {
  5.         m_SonicVelocity += SPEED_UP_AMOUNT;
  6.     }
  7.     if (!GAME_ENGINE->IsKeyboardKeyDown(VK_RIGHT) || !GAME_ENGINE->IsKeyboardKeyDown(VK_LEFT) && m_SonicVelocity > 0)
  8.     {
  9.         m_SonicVelocity -= SPEED_UP_AMOUNT;
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement