Animation Examples

Before we dive into a full-blown app, let’s explore a few examples of how these animation components can be used. This example does not use the built-in speed and heading of the sprite. You can make a sprite move in many ways, including setting a speed and using a clock.

In Figure 7.5, we have programmed a sprite to move its way vertically across the screen.

Image

Figure 7.5 The ball will automatically move vertically on the screen.

For this example, we have placed a ball on a canvas. We also need the Clock, which is an invisible component from the User Interface section of the palette. After putting all these on the Designer, ...

Get Learning MIT App Inventor: A Hands-On Guide to Building Your Own Android Apps 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.