Intro: Android Appinventor Tutorial: Mole Mash App
In this Instructable I will be teaching how to make a basic Mole Mash Game on MIT App Inventor 2. You won't have to download anything to make the app, and the website is free. The app you make will work best on Android Devices. If you don't have a Android Device you can download the Android MIT App Inventor Emulator to test your app.
Step 1: Components
The first step is to design your app. On designer drag the components
in the picture above to your viewer. The names that appear in your components box may differ from mines because I renamed my components based on what they do. There are question marks the component options in the palette. If you hover your mouse over it a description of the component will appear.
1. Create a Canvas and change the width and the height properties to 300 to start. You can change the picture to anything you want (get pics from the web).
2. To add the moving mole create an image sprite. Drag it any where on the canvas. Set the properties as follows:
Picture: You can change the picture to anything you want (get pics from the web)
Interval: 500 (The interval doesn't matter here, because the mole's speed is zero: it's not moving by itself.)
Heading: 0 The heading doesn't matter here either, because the speed is 0.
Width: Automatic -Adjust the pixels as needed
Height: Automatic- Adjust the pixels as needed
3. Create a Text Label. Rename it ScoreLabel. Set the text to "Score:---".
4. Create a button. Rename it ResetButton. Set the text to "Reset".
5. Optional: Create a sound component. Rename it noise. This component will make the players device vibrate every time they score.
6. Create a clock component. Rename it Mole Timer. Set its TimeInterval to 500 milliseconds to make the mole move every half second. Make sure that TimerEnabled is checked.
7. Now change the canvas width and length to fill patent.
Step 2: Programming
The great thing about app inventor is that you don't have to know how to
write programming languages to make an app. You just drag and drop components. Go to blocks and copy the blocks shown in the picture above.
Step 3: Credits & Compare
The pictures I used to make my game are:
The first picture is animated so I think that is pretty cool. The link below is for my completed game it is available for download (free) if you want to, but I'm mainly putting in the link so you can compare final products. If you have any suggestions or improvements, I would be happy to hear them in the comments.