Download presentation
Presentation is loading. Please wait.
1
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 Ron McFadyen
2
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 Ron McFadyen
3
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 Ron McFadyen
4
Event-driven programming
With Alice we can define events in the upper right window: Fall 2009 ACS Ron McFadyen
5
Event-driven programming
Next we’ll examine the examples of the text: Air-show flight simulator Saving people Greek tragedy Fall 2009 ACS Ron McFadyen
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.