16

Sound, Game Logic, Inter-Object Communication, and the Player

In this chapter, we will quickly implement our game’s sound. We have done this before, so it won’t be hard. In fact, in just half a dozen lines of code, we will also add music playing to our sound features. Later in the project (but not in this chapter), we will add directional (spatialized) sound. This time, however, we will wrap all our sound-related code into a single class called SoundEngine. Once we have some noise, we will then move on to get started on the player. We will achieve the entire player character functionality just by adding two classes: one that extends Update and one that extends Graphics. This creation of new game objects by extending these two classes will ...

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