Due: March 22
To gain experience writing C programs for the Game Boy Advance, by
implementing the classic Pong arcade game.
Pong is one of the earliest computer games. The first version was
released by Atari in 1972.
The game features two paddles which each try to keep the ball
from going off their end of the screen.
Your program needs to feature the following:
- Two paddles, one for the player and one for the computer. The player should be able to control their paddle with the up
and down keys. The computer's should be controlled by an AI.
- The AI should track the ball to some degree i.e. when the ball is above it, it should
move up, and when the ball is below it, it should move down.
- The ball should bounce off of the paddles and the top and bottom of the screen.
- If the ball touches one end of the screen, it should be replaced in the center of the screen.
This means one player has lost a point.
- The net should be drawn in the middle of the screen.
- The game score should be represented with tick marks of some kind.
You have a lot of flexibility with this assignment in terms of how
exactly the game looks and works!
Extra Credit Features
Below are some optional features which are good for extra credit:
- Include a game title screen before the game begins.
- Have something happen when the player wins or loses.
- Represent the score with a decimal number instead of tick marks.
- Base your program off of the square5.c program
which has several of the elements your game will need.
- Start by creating a struct for a paddle, and writing code to draw and move them
(similar to the "square" struct).
- Implement the AI, and user input to move the paddles.
- Next create a struct for the ball (which can be a square), and write code
to draw it and move it. The ball will need a velocity in addition to a location.
This can be done with two integers "dx" and "dy" which refer to the number of pixels
to be added to the x and y position each frame.
- Next write the code to implement the collisions.
When your program works, email the source code to firstname.lastname@example.org.
Copyright © 2019 Ian Finlayson | Licensed under a Creative Commons Attribution 4.0 International License.