Assignments‎ > ‎

Post-MoleMash Worksheet

1. MoleMash has an event that doesn't really fit into the category of user-initiated event or external event. What is it?

The 'WhenClock1.Timer' occurs every second.

2. The animation in MoleMash occurs in a Canvas component.

a. What function blocks can you use to move an image sprite within the canvas? What are the function's parameters?

The Mole.Move is an absolute move not a relative move, the parameters are the x & y coordinates.

b. How do you refer to the vertical and horizontal location of an image sprite within the canvas?

The horizontal location of the image sprite within the canvas is referred to as the x coordinate and the vertical location is referred to as the y coordinate.

c. What is the unit of measurement for location on the canvas?

The unit of measurement for location on the canvas is in pixels (the smallest possible dot).

d. How can your app find out the width or length of the device's screen?

By checking the block screen for the size of the device's screen.

e. How is color defined in App Inventor? How is it defined in HTML?

Color in App Inventor are defined by four numbers ranging from 0-255.  The first three numbers indicate how much red, blue and green are in a particular color.  Colors in HTML are defined by using a hexadecimal notation for the combination of red, blue and green color values, these values range from 0-255.

3. The MoleMash tutorial has you define a procedure.

a. Name it.


b. Could you write the MoleMash app without defining the procedures?

Yes, because as the the programmer you can extend your language and have defined functions.

c. Why do you think the procedure was defined?

The procedure was defined so that you can save timer block space

4. Sketch the blocks to increment (add a point to) the score in MoleMash. How would you subtract?

5. When a row of blocks is performed, in what order are they performed?

A row of blocks are performed in order from right to left.

6. a. How could you modify MoleMash to make the mole move faster?

By setting Clock1.TimerInterval under SetHitsLabel.Text to Clock1.TimerInterval 

b. How could you modify MoleMash so that the user can change the speed of the mole?

By putting a button click under the canvas and text box next to the button and then the user could enter in an amount to change the speed of the mole.  Then in the blocks editor you can create a set of blocks so that 'WhenChange.Speed Click and then within that block there would be a block that says SetClock.TimeInterval to SpeedTextBox.Text.