Lab 8: MoleMash


This is the eighth lab of emt 1111, and what this lab will be about is actually introducing animation to app inventor well in this lab MoleMash we will be designing a game basically playing with a mole except we are using app inventor to do this lab. Unlike python were we would use commands to produce a solution here we have to use blocks or event handlers to figure out the lab well. In this case we use canvas, sound tool, button tool, labels tool because its more than 1 and also a clock to put how long we want to vibrate the mole when we touch it and we also have to label these things that we insert to the screen editor so we wont get confused. And also another concept that differs this lab to the previous two is that we are relying on canvas to place the imagesprite in a certain position of the screen by using the canvas coordinating system and if we dont use it during this lab it can be a key loss in the lab. Below ill show you my interpretation of the code that i made to solve this lab and towards the bottom i will show you both the blocks editor screenshot and the screen editor.


Here ill explain the code first of all i followed step by step guidlines from the chapter that corresponded the lab, first i went to build in-definitions and found movemole block and added that first and after that i add the block move to from mole inside the move mole block next i added two blocks of random integer from math panel, after you remove number 100 from both blocks and instead add a subtracting block to it and place linewidth blocks from canvas to it followed by the mole’s width and height. Then i added the canvas touched block , i added the if else inside the touched block with set hits and misses labels to it, then i added two adding blocks from math to the touched block adding it to number 1. Almost there, next you add the mole.touched from the mole panel then you must add the sound block “vibrate” to it so when you touch the mole when you play with it it will vibrate but you must set it to milliseconds in which i set it to 100 =1000. To replay the mole game you must add the reset block by adding the hits and misses labels inside the reset button block so it will work. After that you add the clock block, you put the movemole variable inside it so the clock will time how long the vibration when you tap the mole. Finally you add the screen 1 initialize block and again you add the movemole variable to it and now im finished explaining the program or code of molemash lab. This makes sense only if you look at the “SCREENSHOTS” below if you see the screenshot then you will comprehend what i explained as mentioned above.





Here are the two screenshots that i created for this lab the following is the screen editor screenshot and the blocks editor screenshot that i did. The one in the left is the screen editor and the screenshot in the right is the blocks editor screenshot, By showing these two screenshots that i made i figured out how to create the animation game molemash by using knowledge of app inventor, and by showing the two screenshots ive completed the lab molemash lab.

lab 8 2 lab 8

Leave a Reply

Your email address will not be published. Required fields are marked *