Lesson Overview
In this unit, students will develop a game app featuring a red ball controlled by a flinging action. The objective is for the red ball to 'eat' food ImageSprites, growing in size as it does. The game includes a green ball which must be avoided; collision with it ends the game. This project provides further practice with procedures, including creating a 'Restart' function to reset ImageSprites. Additionally, students will learn to use conditionals for collision detection between ImageSprites and the red ball, and to respond to user input when the game concludes.
Learning Objectives
After completing this unit, students will be able to:
- Develop a game app featuring animated sprites.
- Use conditionals to accurately compare two values in a program.
- Showcase abstraction through a procedure.
- Properly use variables to store and retrieve data.
- Enhance your computational skills by creating an app to share with friends and family.
Lesson
Learning Prerequisite
Students should already have experience with App Inventor from previous units of this curriculum, and should have used the Drawing and Animation components.
Activity
🔽 INTODUCTION OF THE PROJECT
- We will develop a game where a ball chases food while avoiding another ball. The concepts this game will teach include procedures, if-statements, and sprites.
- The completed version of the Food Chase app features a randomly moving green ball and a red ball controlled by the user. The gameplay mechanics involve eating food to grow larger while avoiding the green ball.If the red ball collides with the green ball, a "Game Over" sign appears. Pressing the "Yes" button resets the game. However, if you press "No", it closes the app completely.
🔽 DESIGNING THE APP
<aside>
<img src="/icons/playback-play-button_orange.svg" alt="/icons/playback-play-button_orange.svg" width="40px" /> DESIGNER
</aside>