Putting it all together

We will now begin to fill in the stub methods with some life. The game loop is a good starting point; it is our driving engine that keeps the game world updated and rendered in a continuous way. After this, we will add some sprites and verify that the updating and rendering mechanism is working fine. In order to manipulate the world and game objects, controls are added to receive and react on user input. Finally, the CameraHelper class will be implemented to allow us to move around freely in the game world and to select a game object of our choice that the camera is supposed to follow.

Note

The additions and modifications in code listings will be highlighted.

Building the game loop

The game loop will reside in the CanyonBunnyMain ...

Get Learning LibGDX Game Development - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.