Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualTispe

Posted 01 November 2013 - 12:38 AM

You should decouple FPS from game logic so that the game behave the same way regardless of FPS. For each frame you find the fElapsedTime and pass it down to all your logic. Every parameter you want to move/rotate/scale/advance you multiply with fElapsedTime.

void Logic(float fElapsedTime){
.
.
.
.
.
PlayerPosition += PlayerVelocity*fElapsedTime;
.
.
.
.
.
}

#2Tispe

Posted 01 November 2013 - 12:38 AM

You should decouple FPS from game logic so that the game behave the same way regardless of FPS. For each frame you find the fElapsedTime and pass it down to all your logic. Every parameter you want to move/rotate/scale/advance you multiply with fElapsedTime.

void Logic(float fElapsedTime){
.
.
.
.
.
PlayerPosition = PlayerVelocity*fElapsedTime;
.
.
.
.
.
}

#1Tispe

Posted 01 November 2013 - 12:33 AM

You should decouple FPS from game logic so that the game behave the same way regardless of FPS. For each frame you find the fElapsedTime and pass it down to all your logic. Every parameter you want to move/rotate/scale/advance you multiply with fElapsedTime.


PARTNERS