Chapter 4. Control Freak

Most games are designed to be interactive. This means that the player must have some way to control what happens during the game. In the last chapter, you wrote code that displayed the robot and moved him across the screen. Now, you will control the robot!

This chapter will explain how to implement an input system to control the game's character, and interact with the game. Topics will include:

  • Types of input: There are many ways to interact with your game. Typically, games written for the PC depended on the mouse and keyboard. Direct touch input has now become the standard for mobile and tablet devices, and soon every PC will also have a touch-enabled display. We will cover the most common methods to receive input in your ...

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.