Skip to content

A ping pong game that you can play in your computer's terminal with your keyboard! Your enemy will be either AI, your friend or you just need to watch 2 AIs fighting!

Notifications You must be signed in to change notification settings

TomDevX/terminal-pong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

27 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ Terminal Pong Game

A modern, stable Pong game implementation in C++ with dynamic speed system and multiple AI modes. One command, instant play!

Game Demo Language Status Downloads

๐ŸŽฎ Game Modes

1. ๐Ÿง  Human vs Bot

  • Challenge an intelligent AI opponent
  • Smart AI that follows and predicts ball movement
  • Perfect for single-player practice

2. ๐Ÿ‘ฅ Human vs Human

  • Classic two-player mode on same keyboard
  • Player 1: W/S keys, Player 2: I/K keys
  • Great for local multiplayer fun

3. ๐Ÿค– Bot vs Bot (Demo)

  • Watch AI battle: Smart Bot vs Patrol Bot
  • Different AI strategies in action
  • Just sit back and enjoy the show!

๐Ÿš€ One-Click Play (Recommended) - You just need to copy the command, paste in your terminal / command prompts, that's all, no complex download required

๐ŸชŸ Windows (Command Prompt/PowerShell)

๐Ÿš€ ULTRA SMOOTH (Recommended) - High-performance rendering:

powershell -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/TomDevX/terminal-pong/main/pong_windows_smooth.ps1'))"

โšก Standard - Try this if Ultra Smooth doesn't work:

powershell -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/TomDevX/terminal-pong/main/pong_windows_simple_powershell.ps1'))"

๐Ÿง Linux/macOS (Terminal)

# Paste the command in terminal and play instantly:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/TomDevX/terminal-pong/refs/tags/v5/terminal_pong_installer.sh)"

๐Ÿ“ฅ Manual Download (All Platforms)

Platform Download Link Instructions
Windows (Instant) ๐Ÿ“ฅ Download & Run Right-click โ†’ Save As โ†’ Run with PowerShell
Windows (Auto) ๐Ÿ“ฅ Download pong_auto.bat Right-click โ†’ Save As โ†’ Run as Administrator
Windows (Simple) ๐Ÿ“ฅ Download pong.bat Right-click โ†’ Save As โ†’ Double-click to run
Linux/macOS ๐Ÿ“ฅ Download pong.sh chmod +x pong.sh && ./pong.sh

๐ŸŽฏ That's it! The game will auto-compile and start.

๐Ÿ’ก Windows Solutions Explained

Method Requirements Performance Best For
๐Ÿš€ Ultra Smooth PowerShell 3.0+ 60fps, Zero flicker Most users - Smoothest experience
โšก Instant Play PowerShell 3.0+ Standard 30fps For those who wanna try some bugs as features - Good performance

Recommendation: Try Ultra Smooth first for the best gaming experience!

๐Ÿ› ๏ธ For Developers & Customization

Want to modify the game or see the source code?

Download Full Source

# Clone the complete repository:
git clone https://github.com/TomDevX/terminal-pong.git
cd terminal-pong

# Use the development launcher:
./run_game.sh

Or Download Source ZIP

  1. Click [Download Source ZIP] โ†’ https://github.com/TomDevX/terminal-pong/archive/main.zip
  2. Extract and explore the code
  3. Main game file: pong_stable_fixed.cpp
  4. Development launcher: run_game.sh

๐Ÿ•น๏ธ Controls

Mode Player 1 Player 2 Quit
Human vs Human W/S I/K Q
Human vs Bot W/S AI Q
Bot vs Bot AI AI Q

โœจ Key Features

๐Ÿš€ Dynamic Speed System

  • Speed increases every 3 paddle hits
  • Real-time speed display (1x โ†’ 5x)
  • Visual hit counter tracking
  • Speed resets after each score

๐ŸŽฏ Enhanced Gameplay

  • Stable display with no screen flickering
  • Smooth ball physics with proper collision detection
  • Smart AI with ball prediction
  • Patrol AI with movement patterns
  • No freeze issues during gameplay

๐Ÿ”ง Technical Excellence

  • Non-blocking input handling
  • ANSI escape sequences for smooth display
  • Cross-platform compatibility (macOS/Linux)
  • Optimized game loop for stability

โšก What Makes This Special

๐ŸŽฏ Instant Play

  • One file download - no git clone, no setup, and compatible for every OS!
  • Auto-compilation - detects compiler and builds automatically
  • Self-contained - all source code embedded in installer
  • Auto-cleanup - temporary files cleaned after play

๐ŸŽฎ Enhanced Gameplay

  • Dynamic speed system - gets faster every 3 paddle hits
  • Freeze-free - completely stable, no mid-game crashes
  • Smart AI - intelligent bot with ball prediction
  • Multiple modes - single player, multiplayer, AI demo

๐Ÿ“ Game Rules

  1. Objective: Use your paddle to hit the ball and prevent it from passing
  2. Scoring: First player to reach 5 points wins
  3. Speed System: Game gets faster every 3 paddle hits (max 5x speed)
  4. Physics: Ball bounces off top and bottom walls
  5. Reset: Ball and speed reset to center after each score

๐ŸŽ‰ Features Highlights

  • โœ… Freeze-Free Gameplay - Completely stable, no mid-game freezes
  • โœ… Real Speed Changes - Noticeable speed increases you can actually feel
  • โœ… Smart AI - Intelligent bot that predicts ball trajectory
  • โœ… Multiple Modes - Single player, multiplayer, and demo modes
  • โœ… Easy Setup - One-click launcher with menu selection
  • โœ… Clean Display - Smooth terminal graphics with emojis

๐Ÿ› Troubleshooting

Controls not working?

  • Ensure your terminal supports non-blocking input
  • Try running with different terminal applications
  • Check that termios library is available

Display issues?

  • Verify your terminal supports ANSI escape sequences
  • Try resizing the terminal window
  • Ensure minimum terminal size (40x20 characters)

๐Ÿ† Game Stats

  • Ball Speed Levels: 5 (140ms โ†’ 35ms delay)
  • Paddle Size: 4 characters
  • Game Field: 40x18 characters
  • Win Score: 5 points
  • Speed Increase: Every 3 hits

๐ŸŽฅ Demo

๐Ÿง  HUMAN vs BOT (Frame: 45)
Score: P1=2 P2=1 | Speed: 3x | Hits: 7
Controls: W/S (You), Q=quit
==========================================
|                 |                      |
|  #              |                      |
|  #              |                      |
|  #              |                      |
|  #              |                      |
|                 |                      |
|                 |              #       |
|                 |              #       |
|                 |       O      #       |
|                 |              #       |
|                 |                      |
|                 |                      |
|                 |                      |
|                 |                      |
|                 |                      |
|                 |                      |
|                 |                      |
|                 |                      |
==========================================

Video

Complete.all.gamemode.walkthrough.mp4

๐Ÿ“ฑ Quick Links

Action Link
๐ŸŽฎ Play Now with Mac Download Game
๐ŸŽฎ Play Now with Windows Download Game
๐Ÿ”ง Source Code Download ZIP
๐Ÿ“– Full Repo Browse GitHub
๐Ÿ› Report Issues Create Issue

Made with โค๏ธ by TomDevX

Last updated: August 18, 2025 - Stable release with dynamic speed system

About

A ping pong game that you can play in your computer's terminal with your keyboard! Your enemy will be either AI, your friend or you just need to watch 2 AIs fighting!

Resources

Stars

Watchers

Forks

Packages

No packages published