5.1. Timers
Learning Objectives
When you have finished section 5.1, you should be able to:
- Explain what timers are.
- Use timers in your game.
Required Tasks
- Study the Timers section of Chapter 11, Programming the Perfect Game Loop, in the eTextbook.
- Carefully study all the routines for the use of timers.
- Type the source code of the TimerTest program into your Dev-C++, and study carefully.
Optional Tasks
- Load the TimerTest example program from the Files link below, and play with the code.
- Build and run the program.
Files (TimerTest)
Review Questions
- Why do you need to slow a game down to a fixed rate?
- What routine does Allegro provide to time a game?
- What routine do you use to install a timer?
- What routine do you use to remove a timer?
- How do you calculate the frame rate of a game program using a timer?
Updated May 24 2016 by FST Course Production