Game life cycle

The Android game life cycle is almost similar to any other application's life cycle, other than the game loop mechanism. Mostly, the application state changes with external interference. States can be manipulated otherwise, where games have algorithms or artificial intelligence that is capable of interfering with the main game cycle.

An Android game is initialized with an activity. The onCreate() method is used for initialization. Then, the game thread starts and enters the game loop. The game loop can then be interrupted by an external interrupt.

In the case of game development, it is always a good practice to save the current game state and pause the loop and threads properly. On resuming the game, it should be easy to return to the last state.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.159.223