CSE 113 - Fall 2009 - Banner
UB -
University at Buffalo, The State University of New York Computer Science and Engineering
  • CSE 113 - Fall 2009
CSE 113 - Fall 2009 - Navigation
CSE 113 - Fall 2009 - Announcements

Lab 3

CSE 113 - Fall 2009 - Announcements

Simple Scenario/Game

In this assignment, you are given some basic functionality that your finished scenario should do, but you are not given the images or actors for the scenario. The entire look and feel of the scenario is up to you. You need to fulfill the basic functionality requirements, but then you can feel free to add-on as you'd like to make your finished scenario more fun/interesting/enjoyable for you.

 

Set Up

If you are working in the lab, you will need to copy the scenario directory to your home directory. The scenario is located in: /eng/class/notes/cse113/Lab3. If you do not remember how to do this, refer back to Lab 1.

If you are working from home, you can get the lab 3 scenario from here.

Once you have the scenario loaded into Greenfoot, compile all on the scenario to see what you have been given - note that it is not much.

 

Stage 1 - Understand the Requirements

First, you should read and understand the basic requirements for this scenario. Then, you can begin thinking of what type of scenario you would like to do and how to do it.

The basic requirements for your scenario are:

World

Create a world that is a subclass of the World class provided by Greenfoot. In your class, you need to ensure the following pieces of functionality:

* Your world must have an image (feel free to use the pre-loaded images from Greenfoot or add your own).

* Your world's size must be set when created.

* Your world must create the appropriate instances of the actors for your scenario.

 

Actors

You must create three different types of actors for your scenario. All should be subclasses of the Actor class provided by Greenfoot. Each of your actors should have a unique image associated with it.

* Horizontally moving actor #1: This actor moves in a horizontal line on the screen as the scenario is running. It perpetually moves in the same straight horizontal line as long as the scenario runs. There should be several on the screen moving in the same line (think a line of ants marching across the screen). If the vertically moving actor collides with this actor, then something should happen in the scenario (to the vertically moving actor or to the scenario as a whole). What happens exactly is up to you.

* Horizontally moving actor #2: This actor has the same movement behavior as horizontally moving actor #1, but the reaction of the scenario when the vertically moving actor hits a #2 should be distinctly different. This actor should also move at a different rate of speed than #1.

* Vertically moving actor: This actor's movement is controlled by the user. The keyboard will be used to make this actor move forward and backward. Even though this actor is named the "vertically moving actor" - it does have the ability to move left and right as well to avoid colliding with the horizontally moving actors on the screen. The user's job is to guide the actor from the bottom of the screen to the top of the screen without hitting any of the horizontally moving actors that would create negative impacts, or purposefully hitting those that would give positive impacts.

 

Other Functionality

When the vertically moving actor reaches the top of the screen, something good should happen. This could be another level or simply starting the same level again by putting the actor back at the bottom of the screen.

 

Stage 2 – Create your World

Come up with an idea of what your actors and world will look like and begin by creating your world class as a subclass of the World in Greenfoot. Create the class, set the image, set the size and compile and make sure that you get what you expect when you look at the scenario.

Stage 3 – Create one of the Actors

Pick one of the actors to create first. Create the class, set the image, and make it behave as indicated in the requirements. Make sure that the World you created in Stage 2 creates the instances of that actor in the world.

Stage 4 – Create the other Actors

Now you can create the other two actors in the scenario (one at a time) - remember to make sure to create the actors and their actions in small pieces and make sure they are working before moving onto the next steps in their functionality.

Stage 5 – Test and Have Fun!

When you think you are finished, make sure you double-check the functionality of your scenario one more time. Ensure that you have fulfilled all of the requirements and that you are happy with the way it works. If you are done early - feel free to add other things to the scenario that were not specified in the requirements.


Submission

See the following page for instructions for submission.

Remember that you need to first zip up your scenario directory before trying to upload.


Due date

Your lab submission is due no later than 11:59:59 pm on November 13th. Remember, no late labs will be accepted.


Lab authored by Adrienne Decker

CSE 113 - Fall 2009 - Footer

Page maintained by Adrienne Decker

Contact: adrienne@buffalo.edu | 130 Bell Hall | (716)645-3184