Timer Events and Animation

An app is a set of event handlers. When something occurs, perform some instructions (blocks).

Event Types

UI events

External Events

Now we'll consider timer events, i.e., when you want something to happen as time passes. A Clock component is used.

Clock properties

Image sprites

Within a canvas, you can place an ImageSprite or Ball. They only "live" within a Canvas. Ball and ImageSprite have the same behavior. ImageSprite is different in that you can specify an image file for it.

Instructor demo: A sprite that moves back and forth across the screen

  1. Move sprite one second after a button is clicked
  2. Move sprite back and forth continuously after button is clicked (alternatively when app begins)