Download presentation
Presentation is loading. Please wait.
Published byBennett Reeves Modified over 9 years ago
2
This game is loosely based on the Whack-A- Mole arcade game. Each game starts with 45 seconds of play. Moles randomly pop out of holes on the landscape and the player tries to whack them. Use the mouse to move the hammer and the space bar to swing the hammer. If the player scores more than 30 points then the winning message is broadcast. If not, the losing message is broadcast.
3
Paint or import a stage with holes for the sprite to pop out. Create a hammer sprite. Create a mole sprite for each hole and place one over each hole.
4
Create a new variable called “score” Create a new variable called “time” When the green flag is clicked: ◦ Set score to 0 ◦ Set time to 45 Create a loop which decreases time by one. Add a small delay for the countdown. Repeat the loop 45 times. Add sound to indicate that time is up.
5
Add script to the hammer sprite so that it moves with the mouse. Use a loop. Hint: use Add script to the hammer sprite so when the space key is pressed the hammer swings. Hint: Instead of changing costumes use Add script to the hammer sprite so when the space key is pressed and the hammer hits a mole then the score increases. Hint: This needs to done for every mole sprite. Hint: If the hammer is ever covered by a mole then add
6
When the green flag is clicked set a delay to show or hide the mole sprite. Add a loop to delay showing the mole sprite and determine a how long you want to show that sprite. Do this for each mole. Each one should have a different show and hide pattern.
7
When the green flag is clicked set a timer for 1 second more than the value set in the time variable. Check to see if the score is bigger than 30. ◦ If so, display the winning message. ◦ If score is smaller than 30 then display the losing message. Add a delay to allow for all sounds to finish and add code to stop everything.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.