Editing sound effects
With the sound effects added, we can now alter them to create variety. SFML offers a number of ways in which we can manipulate sounds, which includes the following:
Pitch
Volume
Position
We'll start with the simplest: the pitch. Then, we'll cover both the volume and position by creating spatialized sounds. These values will be set randomly each time we play a sound effect. Before we get into it, let's create a function to encapsulate the modification and playing of sounds. This will save us from having repeated code throughout the class.