The apps are getting easier to build, so I have been adding more functionality to them. MoleMash is based on the popular Whack-A-Mole arcade game. It employs mage sprites and a lot of math. The math is needed to calculate the random placement of the mole around the screen without going off the screen. There is also a clock that is needed to set the speed of the mole’s movement. All in all, it is a pretty basic game – just like the arcade version – so it is fun to build and play.
I changed the theme for my MoleMash game to a soccer game. It is still played the same way, but there are a few additions to the game. Thanks to my classmates who tested the app, there are a few enhancements and bug fixes added, too. Here is a run-down of the changes I made to come up with Wac A Goal.
Added a game timer – This took a second clock component that was set to fire every second (1000ms). It also takes code to change the game clock label when the clock fires. Finally, when the game clock label reaches 0, the game is stopped automatically.
Added a help screen – How to play the game wasn’t obvious in my first version. The button names were obscure and I had set it so that the game didn’t start automatically (by disabling the clocks at initialization). So I changed the buttons to standard images and added a help screen.
Changed the speed selection to a slider – This provides the player an opportunity to pick from multiple speeds, rather than simply faster or slower.
Added an exit button.
Added a notifier – With the addition of the game clock, the original MoleMash code had a bug. The game clock would stop the game, but the player could keep adding to the World score by tapping the screen. I needed a nested If/Then block and a notifier. If the clock is disabled (game over), then touching any sprite will present the player with a notification instructing them to press the play button to start the game. This will also help if a player starts tapping right when the app is opened. Sort of a help splash screen. It only appears if the player has not pressed the play button, though.
Added a stop button – The games are 60 seconds long. Still, if someone wants to interrupt a game, it is doable. After the game starts, the Play button is changed to a Stop button. At the end of the game, it goes back to a Play button.