Summary

Again, you have traveled far! We implemented a basic input class, then modified our sprite class to handle UI. This unified approach allows one class to handle sprites as game objects as well as sprites as part of the user interface. The same approach to see if a button has been pushed, can also be used for collision detection for a game object too. Then you learned how to create a state machine to handle the various states that the game may be in.

In the next chapter, we will learn to detect when game objects collide.

Get OpenGL Game Development By Example 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.