MoleMash: Build, Conceptualize, Customize


Build It

  1. Open a browser and navigate to http://beta.appinventor.mit.edu. Login with your Google account.
  2. Now build the MoleMash app. Follow the instructions in App Inventor chapter 3 using either the paperback version, the pdf version, or the step-by-step video lesson.

Conceptualize It

After completing the MoleMash tutorial, discuss these questions with a partner or small group, jotting down notes while you discuss. Later, create a portfolio page with answers to the questions in your own words. Topics: Canvases and drawing, event parameters

  1. MoleMash has an event that doesn't really fit into the category of user-initiated event or external event. Name it.
  2. What function blocks can you use to move an image sprite within the canvas? What are the function's parameters?
  3. If you didn't have a MoveTo block, what blocks could you use to move the mole?
  4. What is the unit of measurement for location on the canvas?
  5. The version of MoleMash to the right defines a procedure. What is the procedure? Could you write the MoleMash app without defining the procedure? Why do you think the procedure was defined?
  6. Describe the effect of the blocks within the MoveMole procedure. Why is the subtraction performed?
  7. b. The X and Y property of an image sprite specify the location of the sprite. But a sprite is not a single point, so what does X and Y really denote?
  8. Sketch the blocks to increment (add a point to) the score in MoleMash. How would you subtract?
  9. When a row of blocks is performed, in what order are they performed?

Customize It

Note: these variations are slightly modified from the book version.

From the book

  1. Add buttons to let the user make the mole move faster or slower.
  2. Add a label to keep track of and display the number of times the mole has appeared (moved).
  3. 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.
  4. Instead of using a picture of a mole, let the user select a picture with the ContactPicker component.

More Variations

  1. Customize the app with a different image (not a mole), a canvas background image, and custom sound effects.
  2. Allow the user to specify how fast the mole should move by entering a number in a textbox. The number should be in "jumps per second" and this should be clear to user.
  3. 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.
  4. Show the user's score using a colored bar instead of a label.
  5. add "levels": when the user hits the "mole" x number of times, make the mole go faster automatically.
  6. Keep a high-score for the user and display it in the app. Note that even if the app is closed and re-opened, the high score isn't forgotten. You'll need to use the TinyDB component.
Solution for Customization Exercises. Download this zip file, then open App Inventor and choose More Actions | Upload Source.