A small two-player Pong game built with Java Swing. The game opens a desktop window, draws two paddles and a ball, tracks each player's score, and lets both players control their paddle from the keyboard.
- Two-player local Pong gameplay
- Java Swing window and custom drawing
- Keyboard controls for both paddles
- Simple score tracking
- Optional sound effects on paddle hits
- Java JDK 8 or newer
The source file is currently stored as Main. Because it contains a public Java
class named Main, copy or rename it before compiling:
cp Main Main.java
javac Main.java
java MainOn Windows PowerShell:
Copy-Item Main Main.java
javac Main.java
java Main- Left paddle:
WandS - Right paddle: Up Arrow and Down Arrow
The game references a local WAV file for sound effects. If that file is not
available on your computer, update the path in Main or remove the sound effect
block before running.