Be creative! In this lesson you will complete several small programming projects that add enhancements to the Paint Pot app. Hints and suggestions are provided.
- Program additional events into an existing mobile app
- Learn to solve simple programming problems
- Work in a Paired Programming Mode
Creative Mini Projects: Enhancing Paint Pot
- Add a button to support a 4th color option for the app.
- Add a custom image to the app instead of using the cat image that is provided. You can upload images to your project from either the Designer View or Blocks Editor view. Use the image as the Canvas background image. Make sure the image doesn’t have any copyright restrictions.
- Instead of using an existing image, take a photo with the camera and use that as the Canvas background image! (Hint: For this you’ll need to use a new Button, the Camera component, and the Camera’s AfterPicture event.) See the Paint Pic tutorial for assistance.
- The app currently has a ButtonPlus and ButtonMinus. But, we only completed the code for ButtonPlus. Now that you understand how to increment variables by 1, implement an algorithm for ButtonMinus that will subtract 1 from dotsize.
- Optional: Currently, if a user wants to use a larger dot and then use a smaller dot (or vice versa), they have to continually press the ButtonMinus (or ButtonPlus). If the current value of dotsize is 25, getting to to a size of 4 would be pain. For easier use, add a button that resets the size of the dot (circle) back to its original value. (HINT: You’ll need a second variable here to remember the original value of the dotsize.)
- If/Else Exercise: In computer programming, a bug is an error or defect, that prevents the app from working the way it is supposed to. In this app, if the user continues to press ButtonMinus, the value of dotsize will eventually become negative. If dotsize is negative, what will be drawn when the user touches the screen? Try fixing this bug by adding an if/then algorithm to the ButtonMinus block. (Hint: The If/Then block is found under Control in the Toolbox. If you’ve done the I Have A Dream Part 2 lesson, you’ve already seen how to use an if/else block.)
- Create one or more of your own enhancements for your app. Remember to write your ideas down in pseudocode before you begin programming. To get started, open App Inventor with the Paint Pot Projects template (coming soon) or your completed Paint Pot app in a separate tab. Then try to complete the programming projects outlined above.