Abstract

This chapter describes how to build a simple world of a ball bouncing around a room. The chapter briefly examines how events work in a sprite track. Sprite track is an event-based system. When notable things happen, an event gets triggered. Examples of notable things are “the mouse was clicked,” “the mouse moved,” and “a key was pressed.” The sprite track allows attachment of instructions to an event in the form of a script. The script is executed whenever that event occurs. To simulate a ball moving across a screen, an idle event is utilized. The idle event is traditionally an event that gets sent when a computer does not have anything else to do, but in the sprite track, the maximum rate for sending the events can be specified. The rate of idle events can be set by specifying the period of time to wait in between ticks (a tick is a 60th of a second), called the idle delay. The chapter also describes how variables are declared and used in a script.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call