Summary
We have learned how to deal with input from users in several ways and how to make it transparent for the GameEngine.
To get a proper visual feedback from the controller, we created a Player game object that updates its position based on the values from the InputController. We also learned how to add and remove game objects to and from the GameEngine while playing.
We created a very basic keypad that later evolved into a virtual joystick. We also learned how to handle external controllers.
At this point, our game has a spaceship that moves along the screen and fires bullets. It can be controlled using a virtual joystick or a gamepad, independently.
The current implementation does lag occasionally and we have barely started drawing objects on ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access