Objective: | To gain experience with arraries and multiple animated objects | |
Hypothesis: | Give the design of the program | |
Solution: | A complete program with proper format and comments. A statement explaining how your design hypothesis was tested and what you have learned in this process |
For this lab, you will write a program that is a simplified version of the popular Peggle game. The game starts in a starry background with 100 bouncing and flashing pegs randomly placed in the middle half of the window. About 10% of the pegs flash in red, called "explosive pegs". A cannon at the top of the window shoots a bouncy ball into the window each time the mouse is pressed. The bouncy balls bounce off the left/right wall and explode when hit the bottom wall. They can move above the top wall, but they eventually fall back because of the gravity. When the ball hits a regular blue peg, the peg explodes and the ball bounces off. When the ball hits an "explosive peg," the peg explodes and the ball splits into three balls that bounce off at angles 30 degrees apart. The number of shots fired is recorded and displayed on the top right corner of the window.
For 2 bonus points, implement the program such that the game ends when all pegs are gone and the game can be restarted by clicking the mouse.
Value |
Feature |
Style, and Efficiency (4 pts total) | |
2 pts. | appropriate comments |
1 pts. | good variable names |
1 pts. | appropriate formatting |
Correctness of the program (10 pts) | |
6 pts | the game behaves properly and naturally |
4 pts | code is correct and efficient |
Design and testing of the hypothesis (6 pts) | |
3 pts | quality of the design |
3 pts | testing of the hypothesis |
2 bonus pt. | other extra features |