0% found this document useful (0 votes)
61 views80 pages

Getting Started With Alice

- The document provides instructions for creating an Alice world with a fairy and fish objects in a water background. It describes how to add objects, position them, create camera views and call methods to animate the objects. - Methods like "Talk" and "FairyFly" are created to have the fairy say phrases and flap its wings to fly around the fish. - Events are used to call the methods, like calling "FairyFly" when the world starts or "Talk" when the space bar is pressed.

Uploaded by

Muneeb Ahmed
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
61 views80 pages

Getting Started With Alice

- The document provides instructions for creating an Alice world with a fairy and fish objects in a water background. It describes how to add objects, position them, create camera views and call methods to animate the objects. - Methods like "Talk" and "FairyFly" are created to have the fairy say phrases and flap its wings to fly around the fish. - Events are used to call the methods, like calling "FairyFly" when the world starts or "Talk" when the space bar is pressed.

Uploaded by

Muneeb Ahmed
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

Getting Started G tti St t d With Alice Ali

By Ruthie Tucker under the direction of Prof. Susan Rodger Duke University July 2008 University, www.cs.duke.edu/csed/alice/aliceInSchools/

Let s Lets Get Started


The first step in making p an Alice world is to pick a background. When you open Alice, this box to your left will bo o r ill automatically pop up. You may have to click on the Templates tab Today, we are going to select the water world. world Click on water and then click on the open button.

Once you have chosen the water world this is how your screen should l k thi i h h ld look.

Adding objects to your world


Now lets add some objects to our world. To the right of the g water world picture, there is a green button labeled Add Objects. Cli k on i Click it.

Adding objects to your world


Once you have clicked on This is your local gallery add objects add objects a gallery of of objects. f bj t objects will appear, on There are lots of folders, your screen, below your of objects. water world.

Adding objects to your world


Select the animals folder and scroll over until you find the Goldfish.

Click on the Goldfish. And then click on Add instance t world. i t to ld The Goldfish should appear in your world, on the water

Adding objects to your world world.


Your goldfish will be very g y small. Dont worry about this yet. Fi t we need t add First d to dd another object to your world. Click on Local Gallery to go back to the starting p g point of the Local Gallery.

Adding Objects to your world


N Now, scroll over and ll d select the Fantasy folder. Then, select the fairies folder

Adding objects to your world


Add this fairy into your world, by clicking on her and then clicking on Add Instance to World. Your screen should now look like this this.

The Object Tree


When you add objects to y j the world they will appear in a list on the left of your screen. screen This list is called your Object Tree.

Positioning your objects


Now look at the right side of your screen. All of the buttons with the faces are designed to help you position your objects. Click on the white arrow, try clicking on li ki your fairy and moving her around around.

Positioning your Objects


Try moving y y g your fairy so y that she is to the right of your fish. Y Your screen should l k h ld look like this The button with the up and down arrows will move your object up and down. y Click on it and move your fairy so she is hovering over the water

Positioning your objects


This button is used to spin your objects around. i bj t d Try spinning your goldfish around so he is directly parallel to the screen. Your screen should look like this. N t : If you click on th Note: u n the

water by mistake and move it, click the UNDO button to fix the water back.

The Undo Button is your Friend!


Anytime you do something wrong in your Alice world you can click the undo button and Alice will undo th l t d the last command. Use it as much as you need!

Positioning your objects


The next button will turn your character either backwards or forwards. Use it to make your fairy tilt slightly forward. This is how your screen should look.

Positioning your objects


This next button is a toggle button. It will move your object all over the place. Use it to move your fairy so that she is facing the fish fi h Your screen should look like this. Note: If you dont like her position, click on undo and t to move her d try t h again.

Positioning your objects


This next button will make your objects bigger. Click on it and use it to make your goldfish bigger than the fairy. Your screen should like this.

Positioning your objects


Now lets move our fish down so that he Is slightly sticking out of the water. Y may have t push You h to h the fish back further and resize him to get this picture.

Positioning your objects


There is one more button that we will NOT use. This button will copy your object, however it causes bj t h problems later SO DONT USE IT! Its better to add another object from the gallery if you want two of the same thing.

Positioning your objects


Click on the done button to leave your objects gallery. N Now your screen should h ld look like this.

The Dummy Camera


The Dummy camera is y designed to save camera positions as you move your camera around. around Click on the add objects button again and look for a gray button under your object positioning buttons

Click on the button labeled more controls.

The Dummy Camera


Once you have clicked on the more controls button you will see a drop down menu. Click on the drop dummy at camera button. button Just click once!

The Dummy Camera


Once you have dropped y pp the dummy camera. A folder will appear on your object tree called Dummy Objects. If you click on the pl s o plus sign beside the Dummy Objects folder your list of dummy camera positions should appear. Right now there should only be one, called Dummy.

The Dummy Camera


You can rename your y dummy camera to something that is easier to remember remember. Lets rename ours Start.

This will freeze your camera position for you to return to whenever you would like.

The Dummy Camera


Now we can move our camera to another position using the purple arrows at the bottom of your screen. Lets move the camera so that we can get a close up of the fairy. fairy

The Dummy Camera


Lets drop another p Dummy camera at our Fairy Position and label it Fairy Fairy.

Now what if we want to go back to our Start Start camera position? Right Click on camera in your object t bj t tree

The Dummy Camera y


Right click on Camera and choose methods, then camera set point of t i t f view to then Dummy Dummy Objects, then Start.

The Dummy Camera


This should set your y camera view back to its starting position.

Now go through these steps again to create a camera position for Fish.

Dummy Camera Conclusion


Finally, Set your camera position back to Start position. Now click on the Done button at the bottom right of your screen to exit out of your add objects add objects section (you may have to scroll down to see the Done button).

Writing Methods
The large tan part in the center of your screen is called your Method Editor.

Methods
The method editor is for making your characters do something. Y Your characters already h t l d know how to do several things. These are all of the things that your fairy knows how to do do.

Methods
You can find these by y clicking on your fairy in your object tree and choosing methods methods. Lets try animating our fairy with some of these methods.

Methods
This time instead of right clicking, drag your camera view change into your method editor. dit Set your camera view to Fairy.

Methods
Click on the method called Wink, drag Wink, it over and drop it in your method editor.

Methods
When you press play the fairy should wink with her right eye. Try dragging in each of the methods to see what she does. N t that the flap wing method asks you Note th t th fl i th d k for a duration and an amount. Type in numbers f b th and see what h b for both d h t happens.

Methods
If you dont want any don t of this code you can right click on the sections that you dont want and choose d l t h delete.

Methods
What if we want to teach our fairy to do something that she doesnt know how to do? If you look below the methods that you just tried there are more simple methods. These are the methods that we will use to teach our fairy to do new things.

Talk
Lets start with something simple Go to the methods for your fairy and select the gray button labeled Create new method. N Name i T lk it Talk. This box should appear

Methods
Now look in the simple methods of your fairy and find the Say method Drag it over and drop it into your method editor.

Methods
Select other This should give you a box for you to type something. T Type Im flying! I fl i !

Methods
Try this again but have her say something else.

Methods
Now your method should look like this. Now how can we play this method?

Events
An event is a way to y call the methods you create when you play your world The e ent editor is in event We want the fairy to say Im the top right hand flying and the other things that corner of your you t typed whenever we press th d h the screen. space bar. To do this, we will add an event and call the Talk method we wrote.

Events
Click on create new event You will see the list of events in the events editor. Select when a key is typed After clicking it you should get this.

Events
Try playing your world Each time you press the y p space bar, your fairy should say Im flying, then This is fun! This fun!

Methods
Now, lets have the fairy , y fly around the fish. Click on your fairy in your object t bj t tree and go t d to methods. Select the gray button thats labeled create new method.

Methods
After clicking on it a g y g gray box will appear that asks you to name your new method. method Lets name ours FairyFly. Now a new method will appear on your method editor. editor

FairyFly
First we will set our camera to Start position.

Methods

Now lets have our fairy flap her wings wings. Click on lichenZenspider in the object tree and then methods tab. Drag in the flapWings method. Have her flap 6 times for 2 seconds. If the number you want is not there there, select other and then type it in.

Resulting code is:

Methods
Now before we play this we need to change our events editor. The events editor is at the top right of your screen. We need to change the when the world when starts event to our FairyFly method. S th t th d So that we can test it out.

Methods
Now try playing your method Your camera method. should move back to the starting position and your fairy should flap her wings wings.

Now we need to have our fairy fly around the fish instead of flying in place. Go back to your simple methods for your fairy and select T l t Turn and drag it into y your code. Have your fairy turn left 1 revolution.

Methods

Methods
Your code should now look like this.

Methods
Now try playing this this. Your Fairy should flap her wings and then spin in place place. Now we know that we need to fix two things. thi
We need her to flap while she turns And we need her to turn around the fish instead of turning in place.

Methods
First lets have her flap and turn at the same time. Look at the bottom of your screen for a purple button labeled Do Together. Drag this up and drop it under your code. Then place your flap wings code and your turn code inside it turn it. Try playing it

Methods
In order to make the fairy After clicking on the fly around the fish we arrow a pop up menu need to select the more will appear. button beside the Turn Select As seen by, As by code.

goldfish, the entire g goldfish.

Methods
This should make your fairy turn around in a circle from the point of view of the fish. This means it will rotate around the fish fish. Press play to try it.

Methods
Lets write one more method Lets make the fairy ride the fish after she has flown around him him.

RideFish
First you will want to create a new method labeled RideFish. Click on lichenZenspider/ methodstab/then create p new method/ and name it RideFish. Inside your method editor drag the move to command and select goldfish/ the entire goldfish goldfish. Your code should look like this.

Glue Fairy to Fish


Now we need a way to y glue the fairy to the goldfish so that when the goldfish moves the fairy moves, will move with it. This is called the vehicle property. Y can fi d it under th You find d the properties tab of your y fairy.

Methods
Drag the vehicle property over to your method editor and select goldfish/entire g goldfish. This should set your goldfish as a vehicle to your fairy. When the fish moves the fairy should move with it. it

Events
Lets make an event for this method. Go to your events editor and select l t th arrow d l t let the keys move subject. Right now it is set as a default to the camera. Lets change this so it is set to the goldfish/the entire goldfish.

Events
Now we can put it all together. If you noticed at the beginning of your method editor there was a method that said W ld th th d th t id World.myfirstmethod. fi t th d This method is for telling our story. You may have more code in there than I do, that is fine. do fine

Events
First click on the tab that says World.MyFirstMethod It is the tab that we put all of our original code in.

Events
First we need to set our camera position in world myfirstmethod to Start right after world.myfirstmethod Start the code you have. Drag in camera set point of view to and camera to set to Dummy objects, then Start

Events and Methods


If you look under the methods of your fairy you will now see the methods that you wrote. We can put these together in world.myfirstmethod world myfirstmethod to tell a story.

Events and Methods


Lets have the fairy fly y y around the fish and then get on the fish and ride Wh can d thi b When do this by dragging FairyFly and Ridefish into World.myfirstmethod. Now we can use the event When the world starts to call it.

Events and Methods


If you look at your y events you will see that when you play your world the fairy will fly around the fish and then get on its back. You can have her talk by pressing the space bar And move the fish with the arrow keys. Try it!

Events and Methods


Wait! Our fish swam away! Hmmm how can we fix it so that we can follow the fish? Lets set the camera as a vehicle to the fish!

Events and Methods

Click on Camera, Properties Drag the vehicle property inbetween FairyFly and FairyFly RideFish and set it to goldfish, the entire goldfish. goldfish

Events and Methods


Once you have done this try playing your world again. ld i

Notes on Vehicle Property Vehicle Property


If you later want to unglue the fairy from the fish or the unglue the camera, see these instructions instructions. To unglue the fairy from the fish, set the vehicle property for the fairy back to world. T unglue the C To l th Camera f from th fi h also the fish, l set its vehicle property back to world.

Now try to do these!


Drop an island from the environments folder. Steer the fish around the island island. Unglue the fairy (by setting her vehicle back to b k t world) and h ld) d have h move over t her to the island. Try gluing the camera to the fairy instead of the fish.

You might also like