| |||||||||||
|
Main Menu Other |
Tutorials -- Updating Games Based on Time | ||||||||||
|
Using the GetTimePassed() FunctionThis function will return the time passed in milliseconds since the last update. It returns a decimal number, like 0.030 for 30 milliseconds. We need a decimal number so we can multiply other numbers with it. To call the function, enter a line similar to this before you update objects in the game. In the Basic OGL tutorial, put it at the beginning of Idle(). float t = GetTimePassed(); Then you will have the time passed stored in the variable And so this tutorial comes to a close. I hope it's helped you out a little. If you have any questions, feel free to ask me or post it on the Message Boards.
|
|||||||||||