Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Pong

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.

Features

  • 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

Requirements

  • Java JDK 8 or newer

Running

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 Main

On Windows PowerShell:

Copy-Item Main Main.java
javac Main.java
java Main

Controls

  • Left paddle: W and S
  • Right paddle: Up Arrow and Down Arrow

Notes

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.

About

Credit for ball physics https://www.youtube.com/watch?v=L6LFmtJynIs

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors