Chapter 5. Collisions, Sound, and End Conditions – Making the Game Playable

This is the final phase of the first project. By the end of this chapter you will have your first completed game. Once you have Timber!!! up-and-running, be sure to read the last section of this chapter as it will suggest ways to make the game better. We will be looking at the following topics:

  • Adding the rest of the sprites
  • Handling the player input
  • Animating the flying log
  • Handling death
  • Adding sound effects
  • Adding features and improving Timber!!!

Preparing the player (and other sprites)

Let's add the code for the player's sprite, as well as a few more sprites and textures at the same time. This next, quite large, block of code also adds a gravestone sprite for when the player ...

Get Beginning C++ Game Programming 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.