Event-driven programming Chapter 5 covers event-driven programming. Events are user or condition driven and so each event defines a triggering event and an event-handler (a method) Fall 2009 ACS-1805 Ron McFadyen
Event-driven programming Documenting events in storyboards e.g. Flight simulator program in Chapter 5 Event trigger: spacebar pressed Event trigger: up arrow pressed Response: Roll biplane Response: Move biplane forward Alice programming: a method is executed when event occurs Fall 2009 ACS-1805 Ron McFadyen
Event-driven programming Think of the Alice system having a loop where it continually checks for the occurrence of an event. When an event occurs the Alice system invokes the event-handler defined for the event. Fall 2009 ACS-1805 Ron McFadyen
Event-driven programming With Alice we can define events in the upper right window: Fall 2009 ACS-1805 Ron McFadyen
Event-driven programming Next we’ll examine the examples of the text: Air-show flight simulator Saving people Greek tragedy Fall 2009 ACS-1805 Ron McFadyen