Tutorial on Kangaroo visiting his animal friends - parameters, events.

Slides:



Advertisements
Similar presentations
Visual Lists By Chris Brown under Prof. Susan Rodger Duke University July 2012.
Advertisements

Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010 modified July 2011.
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
How Tall Are You? Introducing Functions By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008 Updates made June 2014 by.
Using Functions in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University July 2008.
Scene changes By Deborah Nelson Duke University Under the direction of Professor Susan Rodger July 2008.
Using Functions in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University July 2008.
Lights Camera Action! Part 3: BDE Events By Deborah Nelson under the direction of Professor Susan Rodger Duke University July 2008.
Class-Level Variables in Alice By Jenna Hayes Under the direction of Professor Rodger Duke University, July 2008.
Wizard Game: Class-Level Variables in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July
Creating a 3D Interactive Story Prof. Susan Rodger Duke University Feb. 24, 2007.
Calvin and Hobbes Teach Properties and Functions Created by Daniel MacDonald under the direction of Professor Susan Rodger Duke University June 2013.
METHODS!.  A method is a sequence of instructions or behaviors that will be carried out when requested.  You can use them to create new methods so that.
Alice Learning to program: Part Two by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
Shorter of two objects and changing color Functions, events and setting the color Susan Rodger, Duke University June 2008.
01-Intro-Object-Oriented-Prog-Alice1 Barb Ericson Georgia Institute of Technology Aug 2009 Introduction to Object-Oriented Programming in Alice.
Checking for Collisions Ellen Yuan Under the direction of Professor Susan Rodger at Duke University June 2014.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
Line up By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
Tutorial for Arrays and Lists By Ruthie Tucker. Description This presentation will cover the basics of using Arrays and Lists in an Alice world This presentation.
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
Making a Boat Racing Game in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2010.
Shorter of two objects and changing color V2 Functions, events and setting the color in sequence and randomly This is a modification of the Changing Color.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Checking for Collisions: Alternative Method Erin Taylor Under the Direction of Susan Rodger July 2015 Duke University.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
Methods Tutorial: Part Two By Deborah Nelson Duke University Professor Susan Rodger June 16, 2008.
Now that the kangaroo and the turtle have raced, let's make a method for the kangaroo to hop back to the turtle and challenge him to a race again. Click.
Scene changes By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June
A Simple Quiz: Ask User Functions. By Lana Dyck under the direction of Professor Susan Rodger Duke University June 2009, added Part 2 July 2011.
Piñata Game: Keeping Score in Alice By Maggie Bashford Professor Susan Rodger Duke University July
Mathematical Expressions, Conditional Statements, Control Structures
Alice Learning to program: Part Two Writing Your Own Methods by Ruthie Tucker and 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.
Balancing the scales: Inequalities By Melissa Dalis Professor Susan Rodger Duke University June 2011.
Are you happyAre you happy? Or Are you sad? Are you sad Do you want to play with fancy buttons Notes explaining how to do these things are at the end.
The Essentials of Alice Mrs. Jayne Slease SBMS CTE Computer Science and Animation Credit to Duke Students under the direction of Professor Susan Rodger.
Adding a wave file to a slide Adding a wave file to a slide (1 of 7) 1. Click on Insert. 2. Click Movies and Sounds. 3. Click Sound from file
Tutorial for Arrays and Lists. Description This presentation will cover the basics of using Arrays and Lists in an Alice world It uses a set of chickens.
Creating a 3D Interactive Story Prof. Susan Rodger Duke University July 19, 2007.
Tutorial on Kangaroo visiting his animal friends - parameters, events Susan Rodger Duke University June 2009.
Learning to Program: Part 1 Scene Setup and Starting Animation by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University,
Skater World: Part Three By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 2009.
An Introduction to Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University, June 2009 Updated June 2014 by Ellen Yuan.
BDE tutorial By Deborah Nelson Duke University Under the direction of Professor Susan Rodger July 13, 2008.
CompSci 4 Chap 6 Sec 2 Sep 30, 2010 Prof. Susan Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were not a Flutterbudget.
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010.
Creating a Fancier Chicken to use in several worlds - Inheritance Susan Rodger Duke University June 2009.
Using Placeholders to Simplify your Methods: Learning Methods, Part 2 By Deborah Nelson Duke University Professor Susan Rodger June 16, 2008.
Lesson 8C Animation and Events. Step 3: Animation Drag it into the method and have him say “let her go!” Click on the knight in the object tree and scroll.
Princess & Dragon Part 3: A Knight Comes Riding In—Cameras & Events By Elizabeth Liang under the direction of Professor Susan Rodger Duke University June.
How Tall Are You? Introducing Functions for Alice 3 By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008 Updates made.
The Essentials of Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University May 2009.
An Introduction to Programming Using Alice 2.2, Second Edition Chapter 7 Recursive Algorithms.
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.
Tutorial on Bunny visiting his animal friends - parameters, events for Alice 3 Susan Rodger Duke University June 2009 Updated by Yossra Hamid on October.
An Introduction to Alice (Short Version)
Comparing objects and changing color
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops
Simple Control Structures
Tutorial on Kangaroo visiting his animal friends - parameters, events
Methods Tutorial: Part Two
Checking for Collisions: Using Functions in Alice
Using Functions in Alice
How Tall Are You? Introducing Functions
Tutorial for Arrays and Lists
Using Alice This is an introduction to Alice..
Using Placeholders to Simplify your Methods: Learning Methods, Part 2
Presentation transcript:

Tutorial on Kangaroo visiting his animal friends - parameters, events

Start with new world Add a Kangaroo and several animals of different heights, spread around the world I picked bunny, cow, horse1, ladybug, tortoise, turtle – any animals will do

Problem The kangaroo wants to visit each animal where “visit” means: the kangaroo and the animal face each other, the kangaroo moves close in front of it, the kangaroo says “hi” and then the Kangaroo jumps over it. However, the kangaroo can only jump 1 meter high.

Parts of the Tutorial Part 1: Kangaroo visit each friend Part 2: Kangaroo either go around or jump over Part 3: Create an event to click on animal to visit

Part 1: Kangaroo visit Cow Create a “Kangaroo” method called visit

See the new Kangaroo visit method

Enter the following code For the third line drop the move forward first under “kangaroo”, “functions”, drag in “distance to” and drop over the number Then click on the last white arrow on the line to select “Math” and then the minus and 2 The kangaroo will stop two meters in front of the center of the cow…

Add the remaining code Change “when the world starts” to Kangaroo.visit and “Play”

How to visit any friend – Add a parameter named friendToVisit - type should be Object – click ok

Now click and drag friendToVisit on top of the four occurances of Cow Click and drag from here

Change “when the world starts” back to myFirstMethod Drag in visit for each friend and “Play”

Part 2: Going around or over friend Kangaroo can only jump 1 meter high If friend is shorter than 1 meter, it is ok to jump over If friend is 1 meter or taller, then go around them

First drag in an If/Else from the bottom of the window, placing after the “say”

Select “world”, “functions” and scroll to find math functions, then click and drag “a<b” selecting 1’s

Drag in “cow’s height” from the cow functions, then drop “friendToVisit” over cow

Move the kangaroo jump over code and put after the if. Then add code after the else to “go around”. Then Play

Part 3 – create an event to visit friend clicked on First, disable code in myFirstMethod

Create a new event When the mouse is clicked on something

Drag over the visit code and select “expressions”, “object under mouse cursor”

Here is the event. Now click “play” and click on different animals, but not the kangaroo…