Nice menu we have, but so far it is a bit static. Let's start giving it a proper use!
First step would be to be able to quit the game from the menu, i.e ., clicking the red "Quit" button closes the window.
This can be achieved using the sf::Mouse class. Read the tutorial here, maybe the doc of the class too, and check out how events are processed in the game.
This may be a difficult issue, good luck! Unfortunately, there is no way to test Events AFAICS, so you'll have to rely on trying manually whether the game works as intended or not :)
To be clear, the game should exit when:
The mouse position is within the area of the Quit button, and
Depends on
Nice menu we have, but so far it is a bit static. Let's start giving it a proper use! First step would be to be able to quit the game from the menu, i.e ., clicking the red "Quit" button closes the window. This can be achieved using the
sf::Mouse
class. Read the tutorial here, maybe the doc of the class too, and check out how events are processed in the game.This may be a difficult issue, good luck! Unfortunately, there is no way to test Events AFAICS, so you'll have to rely on trying manually whether the game works as intended or not :)
To be clear, the game should exit when: