Chapter 5. Ladybug Chase
Games are among the most exciting mobile device apps, both to play and to create. The recent smash hit Angry Birds was downloaded 50 million times in its first year and is played more than a million hours every day, according to Rovio, its developer. (There is even talk of making it into a feature film!) Although we can’t guarantee that kind of success, we can help you create your own games with App Inventor, including this one involving a ladybug eating aphids while avoiding a frog.
What You’ll Build
In this “first-person chewer” game, the user will be represented by a ladybug, whose movement will be controlled by the device’s tilt. This brings the user into the game in a different way from MoleMash (Chapter 3), in which the user was outside the device, reaching in.
The Ladybug Chase app is shown in Figure 5-1. The user can:
- Control a ladybug by tilting the device.
- View an energy-level bar on the screen, which decreases over time, leading to the ladybug’s starvation.
- Make the ladybug chase and eat aphids to gain energy and prevent starvation.
- Help the ladybug avoid a frog that wants to eat it.
What You’ll Learn
You should work through the MoleMash app in Chapter 3 before delving into ...
Get App Inventor 2, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.