Chapter 26
Adding Player Interaction
In this chapter, you will add more interaction between the player and the objects in the level. Currently, the player can walk around, and a basic physics system allows the player to jump, collide with wall tiles, or fall out of the screen. First, you will look at a very simple kind of interaction: collecting water drops. Then you will see how to create the behavior that allows the player to slide over ice. You will also focus on the part of the program that deals with the various player-enemy interactions in the game. Finally, you will add vertical and horizontal scrolling to the game.
Collecting Water Drops
The first thing to add is the possibility for the player to collect water drops. A player collects ...
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