Chapter 5 Interaction: Events and Event Handling.

Slides:



Advertisements
Similar presentations
Sprite-visual object (actor on the stage) Scripts- Tells actors (sprites) what to do.
Advertisements

Instruction: Use mouses left button. Use mouses left button. If mouse buttons dont work, use arrow keys of keyboard for slide show. If mouse buttons dont.
Instruction: Use mouses left button. Use mouses left button. If mouse buttons dont work, use arrow keys of keyboard for slide show. If mouse buttons dont.
Christmas Mouse Skills Use your mouse to change the Christmas Pictures.
Events in Alice By Henry Qin, edited by Jenna Hayes under the direction of Professor Susan Rodger Duke University, August 2008.
Princess & Dragon – Version 2 By Michael Hoyle under the direction of Professor Susan Rodger Duke University July 2012 Part 2: Using Methods.
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
PIIT Computer Science Summer Camp - Alice July 11, 2012 Brenda Parker Computer Science Department MTSU.
Alice Inheritance and Event Handling. Inheritance Concept Consider this hierarchy; parents describe properties of children Animals Vertebrates MammalsFish.
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.
Lets Play Catch! Keeping Score in Alice By Francine Wolfe Duke University Professor Susan Rodger May 2010.
Microsoft® Small Basic
Lights Camera Action! Part 3: BDE Events By Deborah Nelson under the direction of Professor Susan Rodger Duke University July 2008.
Fall 2007ACS-1805 Ron McFadyen1 Chapter 5 Interactive Programs.
1 Exploring Stagecast Creator Stagecast Creator Tutorial: Kids Smoking on the Playground By: Community Simulations Team Center for Human-Computer Interaction.
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)
Interaction: Events and Event Handling
Creating a 3D Interactive Story Prof. Susan Rodger Duke University Feb. 24, 2007.
SE320: Introduction to Computer Games Week 8: Game Programming Gazihan Alankus.
Which animal is it?.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
Do not begin Slide Show. Stay in normal view for now.
Chapter 6: (Expressions,) Functions, and If/Else First we had animations – They “ran”/played the same way every time. – Neat, but a bit boring Then we.
Making a Timer in Alice.
Lecture 5: Finishing 4.3 and onto 5.1 Preparing for the Midterm: Written Explanations Technology and Society Assignment (5% - 3 in term) – How does the.
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
Game Maker Day 2 Making a Maze Game.
CompSci 4 Chap 5 Sec 1 Oct 13, 2005 Prof. Susan Rodger Note: thanks to Wanda Dann and Steve Cooper for slide ideas.
Interaction: Events and Event Handling
Alice Learning to program: Part Three Camera Control, Invisibility, and 3-D Text By Ruthie Tucker and Jenna Hayes, Under the direction of Professor Rodger.
Review For Test Chapter 4 & 5 Test is Wednesday, January 27th.
Today’s Agenda 1.Collect Pre-Lab 5 2.Collect Alice project storyboards 3.Events 4.Dummy Objects 5.Assign pair programming teams and meet upstairs for Lab.
Chapter 1 - Getting to know Greenfoot
Chapter 4: Classes, Objects, and Parameters 4.1 World-Level methods.
Lab 6: event & input intro User Interface Lab: GUI Lab Oct. 2 nd, 2013.
Interactive Programming Sec 49 Web Design. Objectives The student will: Understand the difference between movie mode and an interactive program Understand.
Methods Tutorial: Part Two By Deborah Nelson Duke University Professor Susan Rodger June 16, 2008.
An Introduction to Alice (Short Version) – Extras! Yossra Hamid Under the Supervision of Professor Susan Rodger Duke University, June 2014 This is a continuation.
What are Buttons? Buttons can be clipart, pictures or animated gifs When you click on buttons they can send you to another slide Buttons can be used to.
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.
Buttons and Birds: Introduction to Interactive Events in Alice By Henry Qin, edited by Jenna Hayes under the direction of Professor Susan Rodger Duke University,
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops Susan Rodger Duke University July 2011.
Instruction Booklet.  Use the arrow keys to move your plane.  Don’t get hit by the rockets or you will die.  The level will last for 45 seconds.
Use Flowchart modeling to design and create an interactive quiz to be run on Powerpoint. Start Question Click to start the quiz Correct Incorrect, try.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 4: Events Programming with Alice and Java First Edition by John Lewis.
Creating a 3D Interactive Story Prof. Susan Rodger Duke University July 19, 2007.
SCRIPT PROGRAMMING WITH FLASH Introductory Level 1.
Skater World: Part Three By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 2009.
Today we are learning to: Understand how actions and events control our game. Completing the catch the clown game – making a room – adding music Gather.
Interactive Programming Alice. Control of flow Control of flow -- how the sequence of actions in a program is controlled. What action happens first, what.
An Introduction to Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University, June 2009 Updated June 2014 by Ellen Yuan.
Event Handling (the right way). A Simple Web Page Events - Summary The web page looks like this:
5 Event Handling Interactive Programming Suggested Reading Interaction: Events and Event Handling, Supplemental Text for CPSC 203 Distributed this term.
Interactive Programming MMP 220 Multimedia Programming This adapted material was prepared for students in MMP220 as as part of a curriculum redesign project.
Stage 17 Play Lab: Create a Story
Pac Man Game To make the pac man game. I created sprites for the pac man character so he could move in all directions. I also created sprites for the wall.
I have used Scratch, to program a guide to internet safety. This is done by using QR codes to make it more interactive and interesting for people playing.
Computer Science Up Down Controls, Decisions and Random Numbers.
Getting Started With Alice: The Basics. Step 1: Background Open up Alice, and choose a background for your Alice world. Your world is something you can.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
THE MOUSE Left Click THE MOUSE Right Click.
Introduction to Events
Learning Java with Alice 3.0 Game Design Kathy Bierscheid
Methods Tutorial: Part Two
Visual programming Chapter 2: Events and Event Handling
Interactive Programming
Interactive Programming
Presentation transcript:

Chapter 5 Interaction: Events and Event Handling

The area indicated below contains what? A.My First Method because that’s what is always done first B.An event -- a mouse click or key press C.An event handler method D.A parameter

How can parameters affect an event handler? A.They can allow it to vary the action based on the parameter value B.They can let you do more than one thing in the action C.They can let you click on an object to control the action

Building my OWN flight simulator: What will the plane do when the right arrow button is pushed? A.Turn left B.Turn right C.Alice will complain that there is a logic error D.I don’t know

Chapter 5: Interactive Worlds with Event Handling Instead of having “animation” controlled by a specific method (every time) – like my first method – Control can vary based on a set of possible “events” – Create an event link to a method – Multiple methods can link to same event – but perhaps with different parameters What code runs when you hit play? – Essentially a method “listening” for you to click or push a button – it listens over and over again

Identify the parameters in the following event link 1 IceSkater 2 kick3 iceSkater. rightLeg 4 iceSkater.rightLeg. lowerLeg.foot AXXXX BXXX CX DXX

Whoever is clicked on should “go” Suppose we have a world where the same thing should happen to whatever object – when we click on it. Suppose we have a game where whatever object is clicked on should – Turn to face an object (say a flower) – Then jump over it We’ll discuss two ways to do it – The second one is better.

Either the monkey or the hare jumps over the flower

Let’s see what that looks like

One way to set up the events is… But is there a better way?

Is there a better way? A.No, this is as good as it gets, because you need to be able to have a different parameter to the jump method, depending on who you click on B.Yes, I can tell you one…