Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.

Slides:



Advertisements
Similar presentations
Introduction to Macromedia Director 8.5 – Lingo
Advertisements

Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming First Edition.
PIIT Computer Science Summer Camp - Alice July 11, 2012 Brenda Parker Computer Science Department MTSU.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Events Chapter 7. Interactivity The real world is interactive User determines order of actions instead of programmer.
Events Chapter 7. Interactive Real world is interactive User determines order of actions instead of programmer.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
PowerPoint Chapter 2 Review
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 9- 1.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 18 Indexing Structures for Files.
Fall 2007ACS-1805 Ron McFadyen1 Chapter 5 Interactive Programs.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Copyright 2007, Paradigm Publishing Inc. POWERPOINT 2007 CHAPTER 1 BACKNEXTEND 1-1 LINKS TO OBJECTIVES Create Presentation Open, Save, Run, Print, Close,Delete.
Exploring Events. Try this Start Alice and create a blank world using the grass template. Add an instance of a BlueBallerina. Add an instance of a PinkBallerina.
CS320n –Visual Programming Interactive Programs Mike Scott (Slides 5-1)
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 5 Part 1 Conditionals and Loops.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Variables and Functions Chapter Variables Named storage location in computer’s memory Programs may need to store data when running o Stored in.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley This week: Whew!!! The last homework was tough! The homework for this week.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming First Edition.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Study Guide For Test Chapter 5, 6,& 7 Test is Friday, May 15th.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
Interaction: Events and Event Handling
Review For Test Chapter 4 & 5 Test is Wednesday, January 27th.
Events Chapter 7 Part 2. While a Key is Pressed Event Specialized event An event occurs when you press a key and continues until you take your finger.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 27 - Phone Book Application Introducing Multimedia.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley STARTING OUT WITH Python Python First Edition by Tony Gaddis Chapter 3 Simple.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming First Edition.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Interactive Programming Sec 49 Web Design. Objectives The student will: Understand the difference between movie mode and an interactive program Understand.
Adobe Flash CS3 Revealed Chapter 3 - WORKING WITH SYMBOLS AND INTERACTIVITY.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Functions.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Interactive Programming Alice. Control of flow Control of flow -- how the sequence of actions in a program is controlled. What action happens first, what.
Events (Alice In Action, Ch 6) Slides Credit: Joel Adams, Alice in Action CS 120 Lecture September 2012.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2: Methods and Data Programming with Alice and Java First Edition.
Variables and Functions Chapter Variables Named storage location in computer’s memory Programs may need to store data when running Types of data.
Macromedia Flash 8 Revealed WORKING WITH SYMBOLS AND INTERACTIVITY.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
SCRIPT PROGRAMMING WITH FLASH Introductory Level 1.
Interactive Programming Alice. Control of flow Control of flow -- how the sequence of actions in a program is controlled. What action happens first, what.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
5 Event Handling Interactive Programming Suggested Reading Interaction: Events and Event Handling, Supplemental Text for CPSC 203 Distributed this term.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 4-1 Lecture Objectives To understand: –what values can be stored in a Boolean.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
Introducing Scratch Learning resources for the implementation of the scenario
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
Chapter 1: An Introduction to Visual Basic 2015
Starting Out with Alice: A Visual Introduction to Programming
Chapter 3: Variables, Functions, Math, and Strings
Chapter 3: Variables, Functions, Math, and Strings
The Alice Interface.
Exploring Microsoft Office 2013 PowerPoint Comprehensive
Introduction to Events
Chapter 2: Programming in Alice
Presentation transcript:

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Alice: A Visual Introduction to Programming Third Edition by Tony Gaddis Chapter 7: Events

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Responding to Events Event Action that take place while a world is playing Alice worlds detect events and respond to them For example: when a user clicks an object with a mouse…it’s an EVENT! when a user types a key on the keyboard…it’s an EVENT!

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Alice Events Process of responding to an event is called handling the event Tile for an event MUST appear in the Events Editor When world is first created, the event when the world starts appears in the Events Editor

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Alice Events Most event tiles require that additional arguments be specified The method that is executed in response to the event is called the event handler

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Alice Events When the world starts While the world is running When a key is typed While a key is pressed When the mouse is clicked on something While the mouse is pressed on something While something is true When something becomes true When a variable changes Let the mouse move Let the arrow keys move let the mouse move the camera Let the mouse orient the camera

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Specialized Events Some events from the previous list do not appear in the Events Editor General event must first be created Right-click and select change to Changes an event to a specialized event

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Handling Key Press and Mouse Events Alice can detect when a key on the keyboard has been pressed Key Press Events (such as when a key is typed) The event is triggered when the user types a key Key that will trigger the event must be specified any key is the placeholder until the “real” key is selected

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Handling the While a key is pressed Event The event occurs as long as the user holds down a key This tile has four different placeholder slots: any key Begin During End Known as BDE event

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley BDE Event Begin Specifies an action to take place at the beginning During Specifies an action to take place during the event End Specifies an action to take place at the end (when the event stops occurring)

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Task #1 Complete tutorial 7-1 on page 276 called Handling key press events along with Tutorial 7-2 on page 280 called Handling the while a key is pressed event. 6-10

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Mouse Events / While the mouse is clicked… When the mouse is clicked on something Event is triggered when the mouse is clicked on an object in the world While the mouse is clicked on something Event occurs as long as the user holds down the mouse button while the pointer is positioned over an object

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Task #2 Students will explore mouse click events on pages by completing Tutorial 7-3 called Handling a mouse click event. Design a simple world that utilizes two of the following 1)Handling a key press 2)Handling the while a key is pressed(BDE) 3) Handling a mouse click. You decide the characters or objects just ensure that two of the three items are used from above. 6-12

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Using Events in Simulations and Games Programs can have numerous events They respond to various user interactions and internal events Note the various events that appear in Island Rescue

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Task #3 Open Up Globe in the books example programs and see the While the mouse is pressed on something event. 6-14

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Tips for Games and Simulations Random Numbers Function that returns a fractional number between 0 and 1 Function can be added by altering the more editing tag minimum: specifies a minimum value for the random number maximum: specifies a minimum value for the random number integerOnly: if the value is true, the function returns only whole numbers

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Tips for Games and Simulations Random Numbers Function that returns a fractional number between 0 and 1 Function can be added by altering the more editing tag minimum: specifies a minimum value for the random number maximum: specifies a minimum value for the random number integerOnly: if the value is true, the function returns only whole numbers

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Tips for Games and Simulations Playing Audio Several classes include sounds Sounds appear in the class’s thumbnail in the gallery An object’s properties’ tab also allows for sound to be imported and played

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Task #4 Students will open the IslandRescue World from the books example worlds and see how the various events are used to design the game that is showcased.. Students also need to open the RandomBee world and note how random numbers are used within the world. -Students should write a one paragraph summary over each of the two worlds 1) IslandRescue and 2)RandomBee that showcases how events(IslandRescue) or the random number(RandomBee) feature impacted the simulation and how it functioned. 6-18

Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Task #5 Design the following skills programs) from pages valued at 50 points each. Students will select 2 of the following programs: 1,2,3,4 The students will then complete following challenge programs that will be worth 100 points each. Students should select two of the following programs. 6,7,8,9 Total points for the skills programs will equal