Hello! Whack a Mole is a fun game to make … I took a look at your project and have a suggestion or two.
The reason your moles aren’t disappearing is because your code only checks to see if you are clicking on the mole one time and for a very split second. You will want to add a green “Draw function” and put that around all of your code from lines 12 to 40. Because everything in the draw function is executed continuously in a loop, it will continuously check to see if the mouse button is pressed down and your code will function as you want.
Then, you will also want to put your “background” block inside of the draw function because the background has to be refreshed and redrawn continuously with the directions. It will need to be inside the draw function, but before the text blocks so the text gets created on top of the background.
Hope this helps!