Discussion Question With Exercise.
- Name the event that is not a user-initiated or external event.
- What function call blocks are used to move an image sprite within the canvas? What are the function's parameters?
- If you didn't have a MoveTo block, what blocks could you use to move the mole?
- What is the unit of measurement for location on the canvas?
- The version of MoleMash shown above defines a procedure. What is the name of the procedure? Could you code MoleMash without defining the procedure? Why do you think the procedure was defined?
- Describe the effect of the blocks within the MoveMole procedure. Why is the subtraction performed?
- The X and Y property of an image sprite specify the sprite location. But a sprite is not a single point, so what specific location does ImageSprite.X and ImageSprite.Y denote?
- Sketch the blocks so that the Mole moves twice as fast each time it is touched.
- When a row of blocks is performed, in what order are the blocks executed?
Customization Exercises
- PERSONALIZE YOUR GAME: Customize the app with a different image (not a mole), a canvas background image, and custom sound effects.
- Add a label to keep track of and display the number of times the mole has appeared (moved).
- Add a second ImageSprite with a picture of something that the user should not hit, such as a flower. If the user touches it, penalize him by reducing his score or ending the game.
- Allow the user select a picture for the 'mole' using the ImagePicker component.
- Allow the user to specify how fast the mole should move either with faster/slower buttons or by entering a number in a textbox. The number should be in "jumps per second" and this should be clear to user. If a textbox is used, constrain the app so that the user can only enter a number that is reasonable for the speed of the mole. If the user enters an invalid number, display an error message using the Notifier component and keep the speed as it was.
- Show the user's score using a colored bar that changes in size instead of a label.
- Add "levels." when the user hits the "mole" x number of times, make the mole go faster automatically and show the user that the level has changed.
- Keep a high-score for the user and display it in the app.