Download presentation
Presentation is loading. Please wait.
Published byAdrian Pearson Modified over 8 years ago
1
Fall 2008ACS-1805 Ron McFadyen1 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)
2
Fall 2008ACS-1805 Ron McFadyen2 Event-driven programming Event trigger: spacebar pressed Response: Roll biplane Documenting events in storyboards e.g. Flight simulator program in Chapter 5 Event trigger: up arrow pressed Response: Move biplane forward Alice programming: a method is executed when event occurs
3
Fall 2008ACS-1805 Ron McFadyen3 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.
4
Fall 2008ACS-1805 Ron McFadyen4 Event-driven programming With Alice we can define events in the upper right window:
5
Fall 2008ACS-1805 Ron McFadyen5 Event-driven programming Next we’ll examine the examples of the text: Air-show flight simulator Saving people Greek tragedy
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.