Vehicles and Conditionals

Slides:



Advertisements
Similar presentations
Events in Alice By Henry Qin, edited by Jenna Hayes under the direction of Professor Susan Rodger Duke University, August 2008.
Advertisements

Alice Learning to program: Part Four Creating Sounds, Making Billboards, Fun with 3-D Text, New Events, and Rotating Objects by Ruthie Tucker and Jenna.
Getting Started With Alice By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University, July
Coloring Randomly: Random Selection in Alice By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008.
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.
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
Alice Learning to program: Part 1 Scene Setup and Starting Animation by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke.
Calvin and Hobbes Teach Properties and Functions Created by Daniel MacDonald under the direction of Professor Susan Rodger Duke University June 2013.
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.
Checking for Collisions Ellen Yuan Under the direction of Professor Susan Rodger at Duke University June 2014.
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
Skater World: Part Two By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June
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.
Checking for Collisions: Alternative Method Erin Taylor Under the Direction of Susan Rodger July 2015 Duke University.
Changing Color, Using Text Objects, and Random Selection in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
Animating Objects in Groups: Using Arrays and Lists By Ruthie Tucker under the direction of Professor Susan Rodger Summer 2008.
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.
An Introduction to Alice (Short Version) – Extras! Yossra Hamid Under the Supervision of Professor Susan Rodger Duke University, June 2014 This is a continuation.
Piñata Game: Keeping Score in Alice By Maggie Bashford Professor Susan Rodger Duke University July
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,
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,
The Essentials of Alice (Bunny) By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008.
Making Billboards By Deborah Nelson Duke University, Under the direction of Professor Susan Rodger, July 14, 2008.
Simple Collision Detection By David Yan Under the direction of Professor Susan Rodger and Chari Distler Duke University, June 2015.
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.
Illuminating Computer Science CCIT 4-6Sep
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.
Making Billboards By Deborah Nelson Duke University, Under the direction of Professor Susan Rodger, July 14, 2008.
The Essentials of Alice (Bunny)
Getting Started With Alice: The Basics
A Simple Quiz for Alice 3.2:
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.
An Introduction to Alice (Short Version)
Professor Susan Rodger
Changing Color, Using Text Objects, and Random Selection in Alice
Let's Race! Typing on the Home Row
Skater World: Part Three
The Essentials of Alice
Alice Learning to program: Part Three By Ruthie Tucker and Jenna Hayes, Under the direction of Professor Rodger Duke University, 2008.
A Simple Quiz for Alice 3.2:
Objects in Alice: Positioning and Moving Them
Making Objects Move in Unison: Using Lists
Princess & Dragon Part 2: Teaching a Dragon to Fly—Methods & Properties By Elizabeth Liang under the direction of Professor Susan Rodger Duke University.
Checking for Collisions: Using Functions in Alice
Learn a bit about Computer Science Duke Femmes Event with Prof
An Introduction to Alice
Restricting an Event with a Conditional
Princess & Dragon Part 3: A Knight Comes Riding In—Cameras & Events
How Tall Are You? Introducing Functions
Getting Started With Alice
Learning to Program: Part 3 Camera Control, Invisibility and 3-D Text
Tutorial for Arrays and Lists
Professor Susan Rodger
Getting Started With Alice: The Basics
Alice and Daisies: Positioning and Moving Objects in Alice
Professor Susan Rodger
Making Objects Move in Unison: Using Lists
under the direction of Professor Susan Rodger
Restricting Events Creating Conditional Events in Alice By Henry Qin
Presentation transcript:

Vehicles and Conditionals By Henry Qin, edited and revised by Ruthie Tucker, under the direction of Professor Susan Rodger, Duke University 2008

Getting Started To build this world, we will need a vehicle and a person. I am using the Humvee and Euripides. You can use whichever characters you would like.

Getting Started We are going to make several events in this world. The mouse will move both your vehicle and your person separately. When you click on the “T” key the mouse should move both of them together, as if they were glued together. We will then create a second world that uses the “T” key to control the camera.

World.ChangeVehicle First we will need to create a new method, called world.changevehicle.

World.ChangeVehicle Now we need to drag an “if statement” into the newly created method. Now we want to make the world do something if Euripides is set as a vehicle to the Humvee.

World.ChangeVehicle Now if the condition is true we will set Euripides’ vehicle to the entire world.

World.ChangeVehicle Else the vehicle for Euripides will be set to the Humvee.

World.ChangeVehicle Now we need to implement some events The first event we need is “let the mouse move.” We need to create a new variable to place in the space of “Any Object.”

Creating more events Now we need another event to implement our method to make Euripides and the Humvee move together. Create a new event labeled “when a key is typed” and select the letter T.

Creating the Events Now we can implement our “Change Vehicle” method. This will make Euripides and the Humvee move together.

Finishing Up Part One Now try playing your world. First click on Euripides and the Humvee and see if they move separately Now move Euripides on top of the Humvee and hold down the “T” key. Now when you click on the Humvee Euripides should move with it.

Adding Camera Control In order to do the final part we will need to start a new world that has the same objects in it as before. See below.

Adding Camera Control Once you have added your objects, put Euripides on the Humvee and set him as a vehicle to the Humvee. Now create an event using the arrow keys to drive the Humvee.

Adding Camera Control Now we want to create a new world level method labeled just like the old one, “World.ChangeVehicle.” Now lets place an if/else statement inside our new method.

Adding Camera Control Now set the camera's vehicle to the Humvee in the “if statement”.

Adding Camera Control We want the Camera to be set as a vehicle to the world if the statement is true. Else it should be set to the Humvee.

Adding the Final Event Go to the events editor and add a second event that involves pressing the “T” key. In the “Do Nothing” category add “World.ChangeVehicle.”

Testing the World Now try playing your world. The arrow keys should move the Humvee with Euripides attached to it.

Finishing Up That's all folks! Now hit the “T” key and try moving your arrow keys again. This time the camera should follow your Humvee while you move around. That's all folks!