Frequently asked questions
Here are some problems that might be on your mind:
Q1) Despite using classes, I am finding that the code is getting very long and unmanageable again.
A) One of the biggest issues is the structure of our code. As we learn more C++, we will also learn ways to make the code more manageable and generally less lengthy. We will do so in the next and final project too. By the end of this book, you will know about a number of strategies that you can use to manage your code.
Q2). The sound effects seem a bit flat and unrealistic. How can they be improved?
A) One way to significantly improve the feeling the player gets from sound is to make the sound directional. You can also change the volume based on the distance from the sound source to the player character. We will use SFML’s advanced sound features in the next project. Another common trick is to vary the pitch of the gunshot each time as this makes the sound more realistic and less monotonous...