CS 100: Final - Fall 2011

For this final, you are to create an Alice world with 3 object in it. The first object is to sit in the center of the world, while the other two objects move around the first object. The camera is to give a bird's eye view of the world centered over the first object.

Below is a picture of an example world, in which the first object is a frog and the other two objects are ladybugs.

The other two objects are to move continously around the center object. The code describing the movement for these two objects must be written in a method. The movement can be anything you want as long as they don't "run into" the first object while it is sitting in the center of the world.

You are to create a world where the first object tries to "catch" the other two objects as they move around.

You are to add the following events to your Alice world to have the first object try to catch the other two objects.

  1. Right arrow key - turn the first object a quarter revolution to the right.

  2. Left arrow key - turn the first object a quarter revolution to the left.

  3. Up arrow key - have the first object move forward to the edge of your Alice world and then move back to its starting point in the center of the world. This is when the first object attempts to catch one of the other two objects. You will most likely need to create a method that does this movement and then call this method from the event.
Please Note: Do NOT use the event to have the arrow keys move an object. This is not how we want the first object to be moved. You are to use three different events where each event reacts to a single key. The down array key is not to be used!

To determine if an object has been caught, create an event that will detect when the first object is within 1 meter of one of the other two objects. When this happens have the "caught" object move down below the ground so it "disappears". Also when the first object is back in the center, have it say: "I caught X", where X is the total number of objects caught. Note that you will most likely need to create two events to do this. One event for each object to be caught.

The last event will be have the center object say something like "I caught them all" when all of the objects have been caught. The use of a variable is most likely needed to do this. You can use the math function of the world object to check if

world.count == 2
is true. Where world.count is a variable you created as part of the world object.

Submission of your Lab Project

Note: Students can email their world to Prof. Troy in addition to the following steps if they feel that Blackboard is not "behaving nicely".

The final must be submitted electronically to the Assignment Link for Final inside of Blackboard.

CS 100 - Discovering Computer Science
Department of Computer Science
University of Illinois at Chicago