Under the direction of Susan Rodger

Slides:



Advertisements
Similar presentations
Space Man Sam: Grammar Mistakes By Aleis Murphy Duke University, Under the direction of Professor Susan Rodger July 2010.
Advertisements

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
Lets Play Catch! Keeping Score in Alice By Francine Wolfe Duke University Professor Susan Rodger May 2010.
Building The Solar System Michael Marion Under Prof. Susan Rodger Duke University July2012.
Lights Camera Action! Part 3: BDE Events By Deborah Nelson under the direction of Professor Susan Rodger Duke University July 2008.
Creating a 3D Interactive Story Prof. Susan Rodger Duke University Feb. 24, 2007.
Methods Tutorial: Part One By Deborah Nelson Duke University Under the direction of Professor Susan Rodger June 9, 2008.
Lights Camera Action! Part 2: Controlling Light in Alice By Elizabeth Liang under the direction of Professor Susan Rodger Duke University June 2009.
Working with Numbers in Alice - Converting to integers and to strings - Rounding numbers. - Truncating Numbers Samantha Huerta under the direction of Professor.
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.
Changing Camera Views! Part 2: Simple Scene Change & Lighting Fixes By Bella Onwumbiko under the direction of Professor Susan Rodger Duke University July.
3–D Helium Molecule Tutorial Alice Project Duke University Professor Susan H. Rodger Gaetjens Lezin June 2008.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
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.
Teaching a character to walk in more than one world: Parameters and Inheritance. By Lana Dyck under the direction of Professor Susan Rodger Duke University.
An Introduction to Alice (Short Version) – Extras! Yossra Hamid Under the Supervision of Professor Susan Rodger Duke University, June 2014 This is a continuation.
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
Simple Collision Detection By David Yan Under the direction of Professor Susan Rodger and Chari Distler Duke University, June 2015.
Creating a 3D Interactive Story Prof. Susan Rodger Duke University July 19, 2007.
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.
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010.
Headshots in Alice Duke University Professor Susan H. Rodger Gaetjens Lezin July 2008.
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.
Jonathon Kuo Under the Direction of Dr. Susan Rodger
Creating a UFO Rescue Game in Alice
By Melissa Dalis Professor Susan Rodger Duke University June 2011
The Essentials of Alice (Bunny)
Getting Started With Alice: The Basics
A Simple Quiz for Alice 3.2:
An Introduction to Alice (Short Version)
Teaching Characters to Walk: Learning Methods, Part 1
Comparing objects and changing color
Changing Camera Views! Part 1: Set Point of View to By Bella Onwumbiko
Making a Timer This is an modification of the July 2008 timer tutorial by Jenna Hayes By Natalie Huffman Under the direction of Susan Rodger Duke University.
Bunny Eat Broccoli Repetition – Simple loops and Conditional loops
Under the direction of Susan Rodger
Changing Color, Using Text Objects, and Random Selection in Alice
Making Objects Move in Unison: Using Lists
Let's Race! Typing on the Home Row
Creating a UFO Rescue Game in Alice
Learning Java with Alice 3.0 Game Design Kathy Bierscheid
Skater World: Part Three
Adding and Manipulating Objects
Making Objects Move in Unison: Using Lists
Memory Matching Challenge
A Simple Quiz for Alice 3.2:
Under the direction of Susan Rodger
Objects in Alice: Positioning and Moving Them
Princess & Dragon Part 2: Teaching a Dragon to Fly—Methods & Properties By Elizabeth Liang under the direction of Professor Susan Rodger Duke University.
Learn a bit about Computer Science Duke Femmes Event with Prof
An Introduction to Alice
How Tall Are You? Introducing Functions
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
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:

Under the direction of Susan Rodger Solar System Model This is an modification of the July 2012 solar system tutorial by Michael Marion By Natalie Huffman Under the direction of Susan Rodger Duke University June 2017

Pictures to download This tutorial comes with three images that will allow you to make blank spheres look like planets They are called “Sun”, “Earth”, and “Jupiter” Download them now and store them in an accessible location on your computer

Create a new Alice world Select “moon” as your environment Go to setup scene Click on the “shapes/text” tab at the bottom

Add objects Click on new Sphere() Set the name as “sun” Do not drag into the scene! Set the name as “sun”

Get rid of the ground There’s no ground in space! Select this.ground from the menu on the far left Set the “opacity” property to 0.0

Your scene should look like this Add a camera marker from the Camera Marker tab on the bottom right Name the camera “sunCam”

Camera Markers in Alice 3 Camera markers let you save a viewpoint Above the scene buttons are two positioning buttons The black camera represents your current point of view The first button moves your point of view to the red camera (scene1) In order to move to scene2, you would click on the scene2 button and then on the left top button Note: this picture is from a different tutorial

Camera markers, cont. The second button, if clicked, would reset the scene1 view to the current view Do not click this button! Once we set a camera view, we will likely not want to change it Change scene1 camera Change current view

This doesn’t look much like a sun We can change the “paint” property to make it look more like a sun Click the “Import Image” button and select the sun picture you downloaded at the beginning of this tutorial

Now it looks more like a sun Repeat this process twice more Note that there is no need to add additional camera markers Call the spheres “earth” and “jupiter” respectively Use the “Earth” and “Jupiter” pictures to make the spheres look more like those planets

Our planets are all on top of each other Alice creates objects in the same place, so all of our planets are on top of each other You can fix this by moving them Right click on this.earth in the left-hand menuproceduresthis.earth moveLEFTCustom DecimalNumber Enter “4” for the custom number

Repeat this for Jupiter, but move it 10 spaces instead of 4

Your planets probably look a little weird Almost like there’s a line down the front of them This is because you’re seeing the line where Alice joins together the top and bottom of the picture We don’t want to see that seam, so we’ll turn our planets so it’s facing away from the camera

Right click on the sunproceduresthis.sun turnBACKWARDS.25 Repeat this for the Earth and for Jupiter The planets and the sun should look more normal now

Size We want our spheres to be different sizes, to reflect the way the sun, the Earth, and Jupiter are all different sizes Click on the sun in the left menu and change the radius to 2.0 We want the Earth’s radius to stay the same (0.5) Change Jupiter’s radius to 0.8

Reposition your window using the arrows until you can see all three spheres Try to get the sun in the middle of the screen, since the two planets will eventually orbit it You can add a camera marker here as well so you don’t lose your place

Time for the code! Click on the “edit code” button Create a new Scene procedure by clicking on the dropdown menuSceneAdd Scene Procedure Name it “rotate”

Add a parameter A parameter is an input to our procedure For example, when we use the “move” procedure, we have to provide a parameter—how far we want to move The parameter value is set in the method that uses the procedure, so it can be changed easily

Parameters Set the value type to DecimalNumber Set the name to “year” This parameter will control how long our planet’s orbits are

Drag a while loop into the method and select “true” Drag a do together block into the while loop

Now select this.earth from the lower left-hand menu Drag in a turn statement, and select LEFT and 1.0 This statement will make the earth turn in a circle, but we want it to turn around the sun Click on the dropdown arrow and select asSeenBythis.sun

Click on the dropdown arrow again and select durationyear (the parameter we created) This will make one full turn last for a year Finally, click on the dropdown arrow and select animationStyleBegin_And_End_Abruptly This will stop there from being a pause between one orbit and the next

Jupiter Right click on the turn statement and select “copy to clipboard” Click and drag from the clipboard into the do together block Click on this.earth and change it to this.jupiter Click on 1.0 and change it to 0.25 This means that jupiter’s orbit will complete .25 of an orbit in one year

Go back to myFirstMethod Drag in rotate and select 1.0 This means that a year (one rotation of Earth) lasts one second Feel free to play with this value to make the planets spin slower and faster

Run your code! If all three planets are not in your view, you can go back to scene setup and edit the camera view However, there is an easier way What if we let the arrow keys control the camera?

Click on the initializeEventListener tab Click on Add Event ListenerKeyboard addArrowKeyPressListener Click on this.camera in the lower left menu and drag in a move statement Select any direction and amount

Click on getMoveDirection (in the header) and drag it onto LEFT Select FORWARD_BACKWARD_LEFT_RIGHT Change the number to 2.0

Run your code! You should now be able to use the arrow keys to move the camera for a better view