Class 10 - Events Matthew Hashim Click to edit Master subtitle style 11 Goals n n n Create new events in Alice Create handler methods for Alice

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
12/4/09 Click to edit Master subtitle style Events Matthew Hashim 9/24/2009 11
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
MGMT 290D 12/4/09 Goals n Create new events in Alice n Create handler methods for Alice events n Use events to build interactive stories 22
Background image of page 2
MGMT 290D 12/4/09 Events n Interactive program: processes data input by a user n Event: action generated by a user or a program ¨ Ex: When the world starts caused by Play click n Two steps to making a program respond to an event ¨ Choose (or define) a method to handle the event ¨ Tell Alice to invoke the method when the event occurs n Event handler: method called in response to an event n Event-driven program: based on events and handlers 33
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
MGMT 290D 12/4/09 Events (continued) 44
Background image of page 4
MGMT 290D 12/4/09 Handling Mouse Clicks: The Magical Doors n Goal: add events to world built in Section 5.2.3 ¨ Review: castle door tells random knock-knock jokes n Events that will be added to the original program ¨ Right door opens when the user clicks it ¨ Left door tells knock-knock joke when the user clicks it n First step: stop door from automatically telling jokes 55
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
MGMT 290D 12/4/09 Handling Mouse Clicks: The Magical Doors (continued) 66
Background image of page 6
MGMT 290D 12/4/09 The Right Door n How to handle a mouse event ¨ Choose or define a method n Define a method when responsive behavior is complex ¨ Create an event that invokes the handler
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/04/2009 for the course MGMT 290 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 27

Class 10 - Events Matthew Hashim Click to edit Master subtitle style 11 Goals n n n Create new events in Alice Create handler methods for Alice

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online