Alice+Projects

**__Alice Project: Simple Driving Game__**
Alice has a pre-made Event for using the arrow keys to "drive" an object through the world. The object can be an animal, person, thing, or vehicle.

In addition, the camera can have its "vehicle" set to the driving/moving object. Allowing the view/player of your program to have a 1st Person view. This short project will demonstrate:

2. Setting the Camera Vehicle to the driving object so the camera follows in a square. 3. Setting the Camera to stay at a fixed point and point at a moving object 4. Using Arrows and Events so the User can drive the object about the world. ||
 * 1. Creating a method to have an object drive in a square path in the world.

**__Project 1: Drive in a Square__**
1. Open Alice 2. Start a new world. 3. Click "Add Objects." Select the "Vehicles" and then "convertibleCorvette" and add it to the world by clicking the object.



4. Use the Positioning Icons to turn and place the car facing away from the camera.





5. Click "Done"



6. Click on the "convertibleCorvette" in the object tree. 7. Click on the "methods" tab and click "create new method." 8. Name the method "square."



9. Drag a Loop block into the "square" method. Select 4 times



10. Drag a block into the Loop and select "50 meters."



11. Drag a into the Loop and select "left -> 0.25 revolutions."



12. Click on "world.my first method" tab.



13. Drag the "square" method from the convertibleCorvette into "world.my first method." It should look like this

14. Click "Play." Your car should drive in a square. 15. Save your work. ** Show to Mrs. Grams. **

__Project 2: Camera Follows Car in Square__
1. Click on "world.my first method." 2. Click on "camera" in the object tree. 3. Click on the "properties" tab. 4. Drag the "vehicle" block into the "world.my first method" above the square block



5. Select "convertibleCorvette" for the vehicle. 6. "world.my first method" should look like this:



7. Click "Play" and see if the camera stays with the car. (You might want to add some other objects (buildings, people, other vehicles) to give the space a sense of direction. Do not add more than two other objects.

8. Save your work. **Show to Mrs. Grams.**

__Project 3: Setting the Camera to stay in one spot and point at moving object__
1. Start with the "Lastname Driving" program you created in previous projects. 2. Click on the "world.my first method" tab. 3. Delete the "Camera Set Vehicle to 'convertibleCorvette'" block. (Drag Block to Trash Can) 4. Add a Loop block above the convertibleCorvette.square block. Select Infinite Loop.



5. Click on Camera in the Object Tree 6. Click on the methods tab. 7. Drag "Camera point at" into the Loop Block. Select "convertibleCorvette."



8. Drag a "Do Together" block below the "convertibleCorvette.square" block.



9. Set Duration to 0 Seconds in "camera point at" block 10. Put the "convertibleCorvette.square" and the Loop inside the "Do Together."



11. Click Play and see if the camera points at the moving car. 12. Save your work. ** Show to Mrs. Grams **

Pr**__oject 4: Using Alice preset Arrow Events to "Drive" object through world.__**
1. Start with "Lastname Driving" program you created in previous projects. 2. Click on "create new event" in the Events Pane



3. Select "Let the arrow keys move " 4. Select "convertibleCorvette" in the event icon.



5. Your script should look like this:



6. Click "Play" - Your car should drive in a square. Then you can type the arrow keys and move the car around the world. 7. Save your work. ** Show to Mrs. Grams **

Continue - Dance Routine