Go to /eng/class/notes/cse113/scenarios/ and copy the Lab3 directory/scenario to your account and open Greenfoot and the copied scenario
If you are working from home, you can get the Lab 3 scenario from here.
You are going to be completing the game of Breakout as described here. Note that some of the code for the scenario has already been written for you. Please make sure to look at all the code that has been written for you before you begin working on the assignment.
Note about the assignment description. The tasks described here represent small pieces of the finished program. You should ensure that the task works before going on to the next task. That means, you should be compiling and running the scenario often to help you determine its current level of functionality.
The ball should move while playing the game. Work with the move() method of SmoothMover and the Vector to get the ball moving.
Fill in the appropriate method that checks for the edges of the world and allows the ball to bounce off of each of them. Bouncing simply means reversing the direction the ball was traveling in when it hit the wall (only the x or y direction).
You will need to create a method named checkForPaddle and call this method to help the ball check for collisions with the paddle. When the ball hits the paddle, it needs to bounce off of it (meaning reversing both directions).
The paddle should follow the movements of the user with the mouse. When the user moves the mouse left, the paddle should move left.
When the ball collides with a brick, the brick should be removed from the screen. Also, collisions with the bricks should cause the ball to bounce off of it (meaning reversing both directions).
The scenario should stop if the ball goes off the bottom end of the screen or there are no more blocks on the screen.
Note, that if you complete all tasks above this line, you can earn a maximum grade of 75. If you want to be able to earn a 100, you need to implement the following:
When a brick is hit, there is a possibility of a random event occuring in the game. These events are to be as described here. There are five different types of random events. They should each occur with equal probabilities, but should not occur every time a brick is hit. A random event should only occur about 30% of the time when a brick is hit.
Make each brick move one "row" further down towards the paddle (the bottom of the screen).
The speed of the ball should speed up.
The speed of the ball should slow down.
All of the bricks on the screen change to be the same color. You can pick whichever color you like.
All of the bricks on the screen change to be a random color.
If you would like to continue this work outside of Bell 340, there are a few options available to you. You can work in Bell 101, which is an engineering public computing site. Information about the differences you may encounter when in Bell 101 are located here.
If you want to work on your own machine, totally independent of the lab environment, you will need several things. This page will explain where to look for information about downloading the files and programs you need to work on your home machine.
It is most advisable for you to create a folder (directory) on your machine where you can put the files needed for your assignments. This way, all work for this course will be in the same place when you go to look for it.
Zip up the Lab3 scenario to create a file named Lab3.zip
Follow the instructions here and submit your file to the Lab 3 assignment. Note that you can submit your files from any computer that has the zip file and a web-browser. If you are experienced problems with submitting in the past, you need to make sure that you get them resolved before the due date for this lab. NO submissions will be accepted via email under any circumstances.
There is no in-recitation assessment for this assignment. Grading will be based on the files you submit to Web-CAT.
Submissions for this assignment will close at 11:45pm on Wednesday, March 31st.
Lab authored by Adrienne Decker
Page maintained by Adrienne Decker
Contact: adrienne@buffalo.edu | 130 Bell Hall | (716)645-3184