Leveling up
The following code we will add allows the player to level up between waves. It is because of the work we have already done that this is straightforward to achieve.
Add the following highlighted code to the LEVELING_UP
state where we handle player input:
// Handle the LEVELING up state if (state == State::LEVELING_UP) { // Handle the player LEVELING up if (event.key.code == Keyboard::Num1) { // Increase fire rate fireRate++; state = State::PLAYING; } if (event.key.code == Keyboard::Num2) { // Increase clip size clipSize += clipSize; state =...