Possible modifications

When testing our game, it might be the case that there is not much space for further modifications. However, I came up with an important one: adding soundFx to the game. To provide an active experience to the user while they're communicating with the virtual world, sound effects play an important role. With this consideration, Python's Pygame module provides an interface so that we can add a soundtrack to the game.

First of all, to add sound effects to the game, we need to load music into the game. Check out this book's resource folder on GitHub: https://github.com/PacktPublishing/Learning-Python-by-building-games/tree/master/Chapter15/res. Then, check out the sounds folder, which will contain music files that can be ...

Get Learning Python by Building Games now with O’Reilly online learning.

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