AppInventor programs use event handler blocks to specify how the program should respond to certain events. After, before, or when the event happens can all call different event handlers. There are two types of events: user-initiated and automatic.
Most event handlers are green in color and are stored at the top part of each drawer. Here are some examples of event handlers.
Make sure you know the difference between events and procedures. Button1.Click is an event. Sound1.Play is a procedure.For some more practice using event handlers for gaming, use the Tilt-A-Color tutorial found below.
Ad-App-tation: Tilt-A-Color
Make the background canvas change color based on orientation sensor reading with the TiltAColor app.
<< Return to the main page for Lesson 2.1 to check out additional game design resources.