Chapter 13: Sound Effects, File I/O, and Finishing the Game

We are nearly there. This short chapter will demonstrate how we can easily manipulate files stored on the hard drive using the C++ standard library, and we will also add sound effects. Of course, we know how to add sound effects, but we will discuss exactly where in the code the calls to the play function will go. We will also tie up a few loose ends to make the game complete.

In this chapter, we will cover the following topics:

  • Saving and loading the hi-score using file input and file output
  • Adding sound effects
  • Allowing the player to level up
  • Creating multiple never-ending waves

Saving and loading the high score

File i/o or input/output is a fairly technical subject. Fortunately ...

Get Beginning C++ Game Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.