Homework 7
Catch the Balls Reworked, 3/5/21
Code pen doesn’t work with the images:( Above is the p5 link! Thanks Peter
The classes:
Bucket
- Has x, y, bucketwidth, and size.
- Has back(), front(), top(), frontlip(), and move(). All the functions draw the bucket, while move allows the bucket to scroll with the arrow keys.
Ball
- Has size, speed, ballx, bally, and height.
- Imported a flower to be the ball.
- Includes the dist() so the flower restarts once it goes in and score goes up and goes faster, or score goes to 0 and game over happens.
Score
- Has size, placementx, and placementy.
- Displays the score in the top with the number.
Gamover
- Has placementx, placementy, placementX, and placementY.
- Placementx & y are for the text game over, while placementX & Y are for click to restart.
- Reset() so the all the classes are restarted, the score, speed, and location of the ball.
References: