Game Development Reference
In-Depth Information
The whole thing will work in slow motion, but the game can still be playable.
You can try to scale the value that you pass to OnTimer() , for example,
OnTimer( k * TIME_QUANTUM ) . If k is less than 1.0 , the game
logic will become slow-motion. It can be used to produce effects similar to
bullet time ( http://en.wikipedia.org/wiki/Bullet_time ).
There's moreā€¦
If the application is suspended but you want it to continue running in the background, it is
wise to omit the rendering phase altogether or change the duration of the update quantum.
You can do it by adding the Paused state to your game and check it in the main loop,
for example:
if ( !IsPaused() ) OnDrawFrame();
This will help to save precious CPU cycles while still running the game logic simulation in
the background.
See also
F The Implementing timing in physics recipe in Chapter 2 , Porting Common Libraries
Creating a multiplatform gaming engine
In previous chapters and recipes, we handcrafted many ad hoc solutions to some multiplatform
game development tasks. Now, we are going to combine all the relevant code into a nascent
portable gaming engine and learn how to prepare makeiles for Windows and Android to
build it.
Getting ready
To understand what is going on in this recipe, you are advised to read through the chapters
1 to 7 from the beginning of this topic.
 
Search WWH ::




Custom Search