For this assignment, you will make a simple variation of the classic game Breakout.
In breakout, a bat at the bottom of the screen is used to control a ball that bounces around destroying bricks as it hits them. The goal of the game is to destroy all the bricks, while preventing the ball from falling past the bottom edge. At this point we’re only going to worry about making the bat and the ball behave as expected, so that the goal of our game is to survive. You’re welcome to add bricks if you like, but it is not necessary.
There must be a bat at the bottom of the screen, whose movement is determined by the mouse. When the game starts, the ball rests in the center of the bat. When the user wishes to start the game, the ball leaves the bat, going up. If the ball hits one of clearly marked three walls (left, top, bottom) it will bounce in the opposite direction. If the ball falls off the bottom edge, it should reappear in the middle of the bat. However, if the ball hits the bat, it should bounce back. Because we don’t have any bricks in this version, we should make the game a little more interesting. For every 3 times the user has successfully prevented the ball from falling off the speed the ball is moving in should increase.
This assignment is marked out of 20.
1 mark for setting the background to be an original image that you create (e.g. using any simple paint program). Don’t make this file too big, i.e. it should be 25Kb or less.
Use this as a chance to play a little bit with a paint program.
3 marks for colours:
2 marks. The bat should have rounded corners. See the documentation for the rect() function for information on how to accomplish this.
2 marks. A distinction is made between the three “safe” borders (left, top, right) and the bottom border. If the ball hits a safe edge, it should bounce back.
2 marks. The ball starts at the centre of the bat, and an appropriate user action is used to determine when to start the game. What this action is is up to you.
2 marks. If the ball hits the bat, then depending on where on the bat the ball hit, the ball’s trajectory should change accordingly. How much it changes and in what direction is up to you, but you should try to make it somewhat predictable.
2 marks. If the ball falls off the bottom edge, it should reappear in the centre of the bat, and its speed should be reset (see below for speed requirement).
2 marks. For every 3 times the user saves the ball, the speed of the ball increases.
4 marks are for the quality of your source code. Specifically:
Important
Note that if your program does not run correctly, you will get 0 marks for this assignment.
Please name the program you write for this assignment firstname_lastname_studentNum_assn1, where firstname_lastname is your full name separated by an underscore, and studentNum is your student number. What you should submit is the folder called firstname_lastname_studentNum_assn1 that contains the program and the image it needs. Compress this folder as an archive named firstname_lastname_studentNum_assn1.zip (please only use .zip, and not some other archive format).
Please submit this assignment on-line no later than the due date listed on the course marking scheme.
If you submit the assignment after the deadline, you will be deducted %10 of the maximum points available for the assignment, for each day that you are late. For example if the assignment when submitted on time is marked out of 100, then after one day the maximum mark will be 90, after two days it will be 80, and so on.