Summary

In this chapter, we have covered the basic topics for dealing with audio in 2D games. We saw how the concepts are implemented using SFML classes and functions. In particular, we played different music themes depending on the application state. We also created sound effects for various in-game events, and positioned them in the world in order to enable a spatial audition.

With this knowledge, you are now able to incorporate audio into your game; a crucial component for creating an immersive gaming experience. As you have seen during this chapter, SFML makes the implementation very simple. The actual challenge is the fine-tuning and the combination of suitable sound effects and music themes in order to create a unique atmosphere.

The audio ...

Get SFML Game Development 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.