A Pong game has a paddle that moves with the mouse or arrows, and a ball that bounces randomly. If the ball hits an edge that does not have the paddle, it will bounce. If it hits the paddle, it will bounce and add to the score. If it misses the paddle and hits the wall, you lose.
Download the instructions and the ball program above.
- Start with the ball that bounces. You will need to resize the ball and the window when you write the game.
- Add a paddle and collision() function that checks if the ball hits the paddle. If it hits, it should bounce in the opposite direction.
- Your pong game needs a score. The score will increase each time it hits the paddle. You may copy the score from pacman.
- If the ball misses the paddle, the game can end with noLoop() or start again.
- Anything else you add will be considered extra.
The notes and beginning Pacman program are attached above.
1. Add if statements to check for the x & y coordinates for the pacman to match each dot and that the dot is white.
2. Add the keyPressed code.
3. Add more dots in lines and columns to the game.
For extra points, add ghosts, levels or anything else to make your game special.
Create a program that has a theme and uses functions to draw an animation with the following:
• variables to control motion
• shapes and colors
• if statements
Your animation can tell a story or be part of a game.
Processing is a combination of Java and Art. Processing is designed to make it easy to make animated, interactive, and artistic programs.
You will find everything you need at processing.org.
Create a picture or design that includes the following:
- random numbers
- if statements
- mouseX, mouseY
USE THE FOLLOWING DESIGN FOR YOUR CODE!
size(500,400); // you choose the size of the canvas
background(255); // you choose the background color
//Enter all the code for your picture inside the draw() function.
Your goal is to draw one of the following things/scenes.
• a house on a street
• a car or truck on a road
• an animal
• a robot
• an alien
• any other scene that you can think of
Your drawing must include:
• A sized canvas
• A background color
• At least 10 shapes, including all of the following:
• some shapes must be filled, using different colors
• multiple stroke thicknesses. Example: strokeWeight(5);
If you need help, go to processing.org and click on Reference.