All projects

Personal project

Java Pong

My very first project: I created Pong using Java. I used Java's AWT and Swing libraries for the graphics.

Java
§ 01 - OVERVIEW

About

My very first project: I created Pong using Java. I used Java's AWT and Swing libraries for the graphics.

§ 02 - THE GAME

About Pong

Pong is the video game equivalent to ping pong. Two players or one player and the computer, play against each other. To score a point you must get the ball past your opponent's paddle. The ball is able to bounce off the top and bottom of the screen.

A gif of a pong game
An ongoing pong game
§ 03 - IMPLEMENTATION

My Version

My version of the game was created with the AWT and Swing libraries. The Ball class contains the game logic including the collisions with the paddles. The Paddle class contains the logic for incrementing the score.

Issues

There are a few known issues:

  1. The ball position and speed do not scale properly with the resizing of the window and therefore can get lost off screen or change relative speed.
  2. The game does not appear to start unless the window is resized.
§ 04 - SOURCE

Want to try it yourself?

The full source is on GitHub, or browse the rest of what I've built.