Lights Camera Action! Part 3: BDE Events By Deborah Nelson under the direction of Professor Susan Rodger Duke University July 2008.

Slides:



Advertisements
Similar presentations
Getting Started With Alice: The Basics By Jenna Hayes under the direction of Professor Susan Rodger Duke University July
Advertisements

Visual Lists By Chris Brown under Prof. Susan Rodger Duke University July 2012.
Space Man Sam: Grammar Mistakes By Aleis Murphy Duke University, Under the direction of Professor Susan Rodger July 2010.
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010 modified July 2011.
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.
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
Skater World: Part One By Deborah Nelson Duke University Under the direction of Professor Susan Rodger May 29,
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.
Scene changes By Deborah Nelson Duke University Under the direction of Professor Susan Rodger July 2008.
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.
Methods Tutorial: Part One By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 9, 2008.
Alice Learning to program: Part Two by Ruthie Tucker and Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
Princess & Dragon Part 4: Breathing Fire—Adding Effects to Alice By Elizabeth Liang under the direction of Professor Susan Rodger Duke University June.
Lights Camera Action! Part 2: Controlling Light in Alice By Elizabeth Liang under the direction of Professor Susan Rodger Duke University June 2009.
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.
Skater World: Part Two By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June
3–D Helium Molecule Tutorial Alice Project Duke University Professor Susan H. Rodger Gaetjens Lezin June 2008.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
Changing Color, Using Text Objects, and Random Selection in Alice By Jenna Hayes Under the direction of Professor Susan Rodger Duke University, July 2008.
By Deborah Nelson Duke University Professor Susan Rodger July 13, 2008.
Scene changes By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June
Lists Tutorial By Deborah Nelson Duke University Professor Susan Rodger July 13, 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.
Skater World: Part Two By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 1,
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.
The Essentials of Alice (Bunny) By Jenna Hayes under the direction of Professor Susan Rodger Duke University July 2008.
Illuminating Computer Science CCIT 4-6Sep
Making Billboards By Deborah Nelson Duke University, Under the direction of Professor Susan Rodger, July 14, 2008.
Balancing the scales: Inequalities By Melissa Dalis Professor Susan Rodger Duke University June 2011.
The Essentials of Alice Mrs. Jayne Slease SBMS CTE Computer Science and Animation Credit to Duke Students under the direction of Professor Susan Rodger.
Creating a 3D Interactive Story Prof. Susan Rodger Duke University July 19, 2007.
Changing Camera Views! Part 1: Set Point of View to By Bella Onwumbiko under the direction of Professor Susan Rodger Duke University July 2013 Updates.
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.
Skater World: Part Four By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 1, 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.
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010.
Illuminating Computer Science CCIT 4-6Sep
Using Placeholders to Simplify your Methods: Learning Methods, Part 2 By Deborah Nelson Duke University Professor Susan Rodger June 16, 2008.
Headshots in Alice Duke University Professor Susan H. Rodger Gaetjens Lezin July 2008.
Princess & Dragon Part 3: A Knight Comes Riding In—Cameras & Events By Elizabeth Liang under the direction of Professor Susan Rodger Duke University June.
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.
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.
The Essentials of Alice (Bunny)
Getting Started With Alice: The Basics
An Introduction to Alice (Short Version)
Teaching Characters to Walk: Learning Methods, Part 1
Professor Susan Rodger
Changing Camera Views! Part 1: Set Point of View to By Bella Onwumbiko
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops
Making Objects Move in Unison: Using Lists
Skater World: Part Three
Making Objects Move in Unison: Using Lists
Making Objects Move in Unison: Using Lists
An Introduction to Alice
Princess & Dragon Part 3: A Knight Comes Riding In—Cameras & Events
Getting Started With Alice
Professor Susan Rodger
Headshots in Alice Duke University Professor Susan H. Rodger
Professor Susan Rodger
Getting Started With Alice: The Basics
Professor Susan Rodger
Making Objects Move in Unison: Using Lists
Presentation transcript:

Lights Camera Action! Part 3: BDE Events By Deborah Nelson under the direction of Professor Susan Rodger Duke University July 2008

Part 1: Setting up the World Create a new world, with a water template. Save it in a directory that you can find again. After you have saved the file go into the "Layout" mode by clicking on the green button Add Objects. Click more controls. Click drop a dummy at the camera. In the object tree, right click on ‘dummy’ in the Dummy Objects folder. Rename the dummy 'originalPosition’.

Part 1: Adding Objects In the gallery below, click on the Animals Folder and add an instance of a Fish and Shark into the world. Use the object placement tools on the right to position your fish and shark as shown. They should be halfway down in the water. Click done to go back to the main window.

Part 2: Writing sharkChase Create a new method called sharkChase. Into sharkChase drag and drop code to have the shark turn and face the fish and then move towards it. Edit the duration and style as shown.

Part 3: Creating a BDE Click on create new event. Select while something is true. This will create a BDE event. A BDE event is a while loop with three parts inside the loop: Begin, During, and End The while portion of the loop contains a conditional. This is how you control when the event will happen. The Begin will happen the first time the conditional is true. The During will happen while the conditional is true. The End will happen when the conditional is no longer true. This tutorial will show you how each of those aspects works using the shark and fish.

Part 3: The Conditional The first step in writing a BDE is the conditional. We want this loop to run while the shark is more than one meter away from the fish. Click on world in the object tree and go to the functions pane. Drag a > b on top of the and select 1 to serve as a placeholder for both.

Part 3: The Conditional Click on shark in the object tree and go to the functions tab. Drag the shark distance to function on top of the first 1 in the conditional, select fish.

Part 4: The Begin The first time this while loop is passed we want the shark to say “where are you?”. This will go into the begin portion of the BDE. Go to the shark’s methods and drag shark say into the nothing besides ‘Begin:’ in the BDE event. Select other… and then type in ‘where are you?’ and select OK.

Part 5: The During Every time the while loop is passed, we want the sharkChase method to be called. Click on world in the object tree and click on the methods tab. Drag world.sharkChase onto the Nothing beside ‘During:’.

Part 6: The End The very last time the while loop is passed, when the shark is just over 1 meter away from the fish, we want the shark to say: “gotcha!” Drag the shark say method on top of the Nothing beside End:. Select other… and type in “gotcha!” Click OK.

Part 7: Resetting the Event Play your world. You can see the events play out from beginning to end but the while loop only happens once. Let’s create a way to reset the conditional so that the whole BDE can be done again. Click on create new event and select Let the mouse move Click on Any Object and select create new list.

Part 7: Resetting the Event Name the list animal and select the type Object. Add a new item, set it to fish and click OK. Now when you play your world, after the shark says Gotcha, click the fish and move it around the screen. When you let go, the BDE loop will happen again. You can do this again and again to trigger the BDE.

Part 8: Writing fishCircle Click on world in the object tree and go to the method pane. Create a new method and name it fishCircle. Drag in a wait for one second. Inside a Do together put in a Do in order and two fish turn calls, the first to turn left ¼ revolution, the second to turn left one full revolution as seen by the shark. At the bottom of the do together, outside the do in order, drag in fish say and type in don’t eat me!

Part 9: When something becomes true Create a new BDE event by going to the event editor and clicking on create new event. Select while something is true. An empty BDE should appear in the events editor. Right click it and select change to, When something becomes true. This event is useful because sometimes, we only want something to happen once instead of called again and again in a loop. This sort of event will do that.

Part 9: When something becomes true Like with the BDE, the when something becomes true event has a conditional. Drag in a > b from the world functions pane, select 1 for both a and b. Drag in the shark distance to function from the shark function pane onto the second 1. From the world methods pane drag in fishCircle over Nothing.

Review of BDE Let’s review. BDE is a type of while loop: The Begin will only occur the first time through the loop The During occurs every time the while loop is being iterated through The End will only occur the last time through the loop In your world, it is useful to have something to reset the conditional of your BDE. Or, you can change your BDE to when something is true where you don’t need a loop, then it only happens once. Congratulations! You have finished this tutorial. Continue experimenting with BDE events to see the many different ways they can be used in Alice! Play your world to see the new event take place. Notice that even though the conditional is still true after the fish swims around the shark, the event kicks in only once.