Alice Project 1 - 20 points (counts as a projecT).
In class and out. This is a project because it is much larger than
a hw. Due Friday Sept 30, beginning of class
1. Bug
2.Bunny
The bunny is to hop in a square with 3 hops on each side
of the square. Create a world with a bunny. Create a method hop
that will make the bunny hop one bounce. Use the loop to make the
bunny hop three times, when the loop ends have the bunny turn left
one quarter revolution. Then add another loop to repeat that cycle
as shown below:
Loop 4 times (for four sides of square)
Loop 3 times (for 3 hops each)
bunny.hop
Turn left 1/4 revolution
3. Frog
Create a world with a frog (Animals) and a ladybug (Animals). Write an
interactive program to allow the user to drag the ladybug around
the scene. (Use a let the mouse move objects event.) As the
ladybug is dragged around, make the frog chase after it by moving
one hop at a time without colliding with the ladybug. If the user
moves the ladybug within 2 meters of the frog, have the frog look
at the camera and say "ribbit"-then end the animation.
You will need to have a while loop that constantly has the frog
moving and checking its distance to the ladybug.
4. Bumper Cars
Create a simulation of the bumper car ride (Amusement Park), where the
cars move continuously around within the bumper arena. Add two bumper
cars inside the arena. In this animation, each car should be moving
forward a small amount until it gets too close to another car or
to the wall, then turn the car a quarter of a revolution clockwise
(to get a different direction) and continue moving forward. Use
a switch (Controls) to stop and start the ride. As long as the switch
is on, the ride should continue.
Hint: To avoid a car driving
through a wall of the arena, a simple form of collision detection
is needed. One way to check for a possible collision is to use the
distance to function to compute the distance of the car to
the arena. Remember that distance to is measured "center-to-center."
In this world, a measurement from the center of the car to the center
of the arena is exactly what you need. (When a car gets too far
from the center of the arena, it will collide with a wall.) It is
also possible to write a function that returns whether two cars
are about to collide with one another.
Hint
- To do the switch part easier , take a look at this.
5. Fan
Place a fan (Objects) in a new world. The fan has four buttons-high, medium,
low, and off. Create a method that controls the speed at which the
fan blades rotate, depending on which button is clicked. (You may
want to use several methods instead of just one.) The blades should
continue turning until the animation stops running or the user clicks
the off button.
Hints:
- Create a variable of fan called speed (a number). The speed will be 0,1,2,3. You will in your myfirstmethod method have a infinite loop checking the variable speed. Take a look at this example.
- This whole program can be written with 4 lines of code (3 in myfirstmethod, 1 in a method changeSpeed taking in parameter newSpeed
When you are done; . Each project must be named: 1Bug 2Bunny 3Frog 4Bumper and 5Fan. Zip all 6 projects together (heres info on zipping). Submit online here
RUBRIC:
There are 5 assignments, each will be worth 4 points.
Each project will be scored as such:
Points awarded |
1. Not much of an effort. Doesnt do much of the requirements. |
2. Almost works; the right idea. |
3.Works exactly as described. Either variables,methods not named well or you didnt use functions |
4. Works exactly as described. With correct methods, functions, all named appropriately |
1. Bug |
|
|
|
|
2. Bunny |
|
|
|
|
3. Frog |
|
|
|
|
4. Bumper Cars |
|
|
|
|
5. Fan |
|
|
|
|
In addition, there will be extra credit points awarded to projects that go beyond the call of duty. Projects that really excel.
|