Chapter 5. Ladybug Chase

image with no caption

Games are among the most exciting mobile phone 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!) While 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

With the Ladybug Chase app shown in Figure 5-1, the user can:

The Ladybug Chase game in the Designer
Figure 5-1. The Ladybug Chase game in the Designer
  • Control a ladybug by tilting the phone.

  • 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 this chapter, as it assumes you know about procedure creation, random-number generation, the ifelse block, and the ImageSprite, Canvas, Sound, and Clock components.

In addition to reviewing material from MoleMash and other previous chapters, this chapter introduces:

  • Using multiple ImageSprite components and ...

Get App Inventor 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.