destroyGame(): housekeeping tasks before program exit. stopGame(): Stop timers, update game statistics such as high score. newGame(): Perform per-game initialization tasks, such as reset the score, clear the game board, etc. initGame(): Perform one-time initialization tasks, such as constructing object, opening files, setup timers and key/mouse event handlers. Most of the games follow the above state transition: Before presenting the entire framework, let's look at the individual pieces involved in game programming. A framework not only helps in improving the productivity but also ensures high quality codes. This is because many of the tasks involved in game programming are similar in many types of games.
Instead of writing games in an ad-hoc manner (which I did but found it grossly inefficient), I decided to put up a framework for programming games in Java.