In this section, we will examine the gg_whac project, which is an implementation in the ggez framework of the famous Whack-A-Mole arcade game. First of all, let's try to play it.
After running cargo run --release in the gg_whac folder, the following window will appear, which shows a lawn:
For those of you who aren't familiar with this game, here are the rules. When you click on the Start button, the following things happen:
- The Start button disappears.
- The countdown begins at the top left from 40 seconds to 0.
- A nice mole pops up in a random position of the lawn.
- The mouse cursor becomes a barred circle.
- If you move your mouse cursor over the mole, it becomes a cross and a big mallet appears; this mallet can be dragged by the mouse as long as you remain over the mole.
Your window should look similar to the following:
If you click the main mouse button when the mouse cursor hovers over the mole, the mole disappears and another one appears...