Skip to content

๐Ÿ“ Modern Tournament Pong game with AI commentary - First to 10 points wins! Built with vanilla HTML5, CSS3, and JavaScript. Features intelligent AI opponent, real-time commentary, 60-second matches, and responsive design.

License

Notifications You must be signed in to change notification settings

gdvtramarao/Tournament-pong-with-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

26 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“ Tournament Pong

A modern, interactive Pong game with AI commentary and tournament-style gameplay. Built with vanilla HTML5, CSS3, and JavaScript.

Live Demo Deployed on Vercel

HTML5 CSS3 JavaScript

๐ŸŒŸ Live Demo

๐ŸŽฎ Play Tournament Pong Now!

Experience the thrill of competitive Pong with intelligent AI commentary. No downloads required - play instantly in your browser!

๐Ÿ’ป Desktop/Laptop Required: This game is optimized for desktop and laptop computers with mouse cursor controls. Mobile devices are not currently supported for the best gameplay experience.

๐ŸŽฎ Game Overview

Tournament Pong elevates the classic Pong experience with modern features, engaging AI commentary, and competitive tournament rules. Challenge yourself against an intelligent AI opponent that adapts and provides real-time feedback throughout the match.

โœจ Features

๐Ÿ† Tournament Mode

  • First to 10 points wins or highest score when time runs out
  • 60-second time limit with live countdown timer
  • Professional scoreboard with clean, modern design

๐Ÿค– AI Competitor

  • Smart AI opponent with realistic paddle physics
  • Dynamic commentary system that responds to game events
  • Contextual messages based on score, rallies, and time remaining
  • Adaptive difficulty - AI becomes less perfect at higher ball speeds

๐ŸŽฏ Enhanced Gameplay

  • Progressive ball acceleration - gets faster with each paddle hit
  • Realistic physics with paddle spin effects
  • Smooth mouse controls - move your cursor up and down to control paddle
  • Pause/Resume functionality (spacebar or button)

๐ŸŽจ Modern UI/UX

  • Clean, professional design with gradient backgrounds
  • Responsive layout that works on desktop and laptop screens
  • Intuitive mouse-based controls with visual feedback
  • Game over screen with detailed match results

๐Ÿ“Š Vercel Analytics Integration

Tournament Pong now comes with built-in analytics to help understand player engagement:

โœ… Automatic Tracking

  • Page views and user sessions
  • Game start and completion events
  • Player vs AI scoring statistics
  • Game duration and engagement metrics

๐Ÿ“ˆ Custom Game Events

  • Game Started: Tracks new game initiations
  • Scoring Events: Monitors player and AI points
  • Game Completion: Records winners, scores, and match duration
  • Performance Insights: Helps optimize gameplay experience

๐Ÿ–ฑ๏ธ System Requirements

๐Ÿ’ป Recommended Setup

  • Desktop or Laptop Computer (required)
  • Mouse or Trackpad for paddle control
  • Modern web browser (Chrome, Firefox, Safari, Edge)
  • Stable internet connection for best experience

๐Ÿšซ Platform Limitations

  • Mobile devices not supported: The game relies on precise mouse cursor movement for paddle control
  • Touch controls unavailable: Currently optimized for mouse-based gameplay only
  • Tablet compatibility limited: Best experience on traditional desktop/laptop setup

โš ๏ธ Important Note

This game is designed specifically for mouse cursor control and provides the best experience on desktop and laptop computers. Mobile and touch device support may be added in future updates.

๐Ÿš€ Quick Start

๐ŸŽฎ Play Online (Recommended)

Just click and play: https://tournamentpong.vercel.app/

Requirements: Desktop/Laptop with mouse cursor - works on all desktop browsers!

๐Ÿ’ป Run Locally

Prerequisites

  • Any modern web browser (Chrome, Firefox, Safari, Edge)
  • No additional dependencies or installations required

Installation Steps

  1. Clone the repository:

    git clone https://github.com/gdvtramarao/Tournament-pong-with-AI.git
  2. Navigate to the project directory:

    cd Tournament-pong-with-AI
  3. Open index.html in your web browser:

    # On macOS
    open index.html
    
    # On Windows
    start index.html
    
    # On Linux
    xdg-open index.html

Or simply double-click on index.html

๐ŸŒ Deployment

This project is deployed and hosted on Vercel for optimal performance and reliability:

  • Live URL: https://tournamentpong.vercel.app/
  • Automatic deployments from the main branch
  • Global CDN for fast loading worldwide
  • Zero configuration deployment
  • Mobile optimized for all devices

๐Ÿ”— Links & Resources

  • ๐ŸŽฎ Live Game: https://tournamentpong.vercel.app/
  • ๐Ÿ“ฑ Mobile Friendly: Responsive design works on all devices
  • ๐ŸŒ Global Access: Fast loading worldwide via Vercel CDN
  • ๐Ÿ“– Documentation: Complete setup and gameplay guide below

๐ŸŽฎ How to Play

Controls

  • Mouse Movement: Move your mouse cursor up and down to control your paddle
  • Spacebar: Pause/Resume the game
  • Pause Button: Pause the game
  • New Game Button: Start a fresh match

๐Ÿ’ก Pro Tip: Use smooth mouse movements for better control. The paddle follows your cursor with slight smoothing for realistic feel.

Game Rules

  1. Winning Conditions: First player to reach 10 points OR highest score when the 60-second timer expires
  2. Ball Physics: Ball speed increases slightly with each paddle hit
  3. Paddle Effects: Hit the ball with different parts of your paddle to add spin
  4. AI Opponent: The AI adapts its difficulty based on ball speed and provides commentary

AI Commentary System

The AI opponent provides dynamic commentary including:

  • Motivational start messages
  • Reactions to scoring
  • Excitement during long rallies
  • Tension acknowledgment in close games
  • Time pressure warnings
  • Respectful end-game messages

๐Ÿ“ Project Structure

tournament-pong/
โ”‚
โ”œโ”€โ”€ index.html          # Main HTML structure
โ”œโ”€โ”€ style.css           # CSS styling and responsive design
โ”œโ”€โ”€ game.js            # JavaScript game logic and AI system
โ””โ”€โ”€ README.md          # Project documentation

๐Ÿ› ๏ธ Technical Details

Built With

  • HTML5 Canvas for game rendering
  • Vanilla JavaScript for game logic and AI
  • CSS3 with modern features (flexbox, gradients, animations)
  • Responsive Design principles

Key Features Implementation

  • Game Loop: Uses requestAnimationFrame for smooth 60fps gameplay
  • Collision Detection: Precise ball-paddle and boundary collision system
  • AI Logic: Smart paddle movement with imperfection algorithms
  • Commentary System: Context-aware message selection based on game state
  • Timer System: Real-time countdown with game end conditions

๐ŸŽจ Design Philosophy

  • Clean & Modern: Professional UI that doesn't distract from gameplay
  • Accessible: High contrast colors and readable fonts
  • Responsive: Seamless experience across desktop and mobile devices
  • Intuitive: Clear visual feedback and easy-to-understand controls

๐Ÿ”ง Customization

Modify Game Parameters

Edit game.js to customize:

const GAME_TIME = 60;        // Game duration in seconds
const WIN_SCORE = 10;        // Points needed to win
const BALL_SPEED = 7;        // Initial ball speed
const PADDLE_SPEED = 6;      // AI paddle speed

Customize AI Messages

Add new commentary in the aiMessages object in game.js:

const aiMessages = {
    start: ["Your custom start message! ๐ŸŽฎ"],
    playerScore: ["Custom player score reaction! ๐Ÿ‘"],
    // ... more categories
};

๐Ÿค Contributing

We welcome contributions from developers of all skill levels! ๐Ÿš€

Tournament Pong is an open-source project and we'd love your help to make it even better. Whether you're a beginner or an expert, there are many ways to contribute:

๐ŸŽฏ Easy Ways to Contribute:

  • ๐Ÿ› Report bugs you find while playing
  • ๐Ÿ’ก Suggest new features or improvements
  • ๐Ÿ“ Improve documentation or fix typos
  • ๐ŸŽจ Enhance UI/UX design elements
  • ๐Ÿค– Add new AI commentary messages
  • ๐ŸŒ Translate the game to other languages

๐Ÿ’ป For Developers:

  • ๐Ÿ”ง Fix existing bugs from our Issues
  • โšก Add new game features (sound effects, new game modes, etc.)
  • ๐Ÿ“ฑ Improve mobile experience and touch controls
  • ๐ŸŽฎ Add keyboard controls (WASD, arrow keys)
  • ๐Ÿ† Create tournament modes and scoring systems
  • โœจ Optimize performance and add animations

๐Ÿš€ How to Start Contributing:

  1. โญ Star this repository to show your support
  2. ๐Ÿด Fork the project to your GitHub account
  3. ๐Ÿ“‹ Check our Issues for beginner-friendly tasks
  4. ๐Ÿ”ง Create a feature branch: git checkout -b feature/AmazingFeature
  5. ๐Ÿ’พ Commit your changes: git commit -m 'Add some AmazingFeature'
  6. ๐Ÿ“ค Push to the branch: git push origin feature/AmazingFeature
  7. ๐Ÿ”„ Open a Pull Request with a clear description

๐Ÿ‘ฅ First-time Contributors Welcome!

New to open source? No problem! We have good first issue labels to help you get started:

  • ๐Ÿท๏ธ Look for issues labeled good first issue
  • ๐Ÿ“š Check our CONTRIBUTING.md for detailed guidelines
  • ๐Ÿ’ฌ Feel free to ask questions in the issues or discussions
  • ๐Ÿค We're here to help and guide you through your first contribution!

๐ŸŽ What You'll Gain:

  • ๐ŸŒŸ GitHub contribution history for your profile
  • ๐Ÿ“– Learn modern web development with vanilla JavaScript
  • ๐ŸŽฎ Game development experience with HTML5 Canvas
  • ๐Ÿค– AI logic programming skills
  • ๐Ÿ‘ฅ Open source collaboration experience
  • ๐Ÿ† Recognition as a project contributor

๐Ÿ’ก Ideas We'd Love to See:

  • ๐Ÿ”Š Sound effects and background music
  • โŒจ๏ธ Keyboard controls for accessibility
  • ๐ŸŽจ Custom themes and color schemes
  • ๐Ÿ‘ฅ Multiplayer mode (two human players)
  • ๐Ÿ“Š Statistics tracking and leaderboards
  • ๐Ÿ“ฑ Better touch controls for mobile
  • ๐ŸŒ Internationalization (multiple languages)
  • ๐Ÿ… Achievement system and badges

๐Ÿ“ž Get in Touch:

Ready to contribute? Your next PR could make the game better for thousands of players! ๐Ÿš€


๐Ÿ“ฑ Platform Support

โœ… Desktop Browsers: Chrome, Firefox, Safari, Edge (Windows, macOS, Linux)
โœ… Laptop Computers: Perfect mouse/trackpad control experience
โŒ Mobile Devices: Not supported (requires mouse cursor)
โŒ Tablets: Limited support (touch controls not available)
โŒ Smart TVs: Not optimized for TV browsers

๐Ÿš€ Performance

  • Lightning Fast: Hosted on Vercel's global CDN
  • 60 FPS Gameplay: Smooth animations and responsive mouse controls
  • Instant Loading: No downloads or installations required
  • Desktop Optimized: Perfect performance on laptop and desktop computers

๐Ÿ› Known Issues

  • On some mobile devices, mouse movement might not be as responsive
  • Timer precision may vary slightly between browsers
  • Canvas scaling on very small screens (< 320px) needs improvement

๐Ÿ”ฎ Future Enhancements

  • Keyboard controls (WASD or Arrow keys)
  • Multiple difficulty levels
  • Sound effects and background music
  • Multiplayer mode (two human players)
  • Mobile touch controls for phone and tablet support
  • Tournament bracket system
  • Score history and statistics
  • Custom themes and color schemes

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ‘ค Author

gdvtramarao

  • Crafted with passion and innovation

๐Ÿ™ Acknowledgments

  • Inspired by the classic Atari Pong (1972)
  • Modern web technologies and responsive design principles
  • Community feedback and suggestions

๐ŸŒŸ Show Your Support

Give a โญ๏ธ if you enjoyed playing Tournament Pong!

Share the game:

  • ๐ŸŽฎ Play Live
  • ๐Ÿฆ Tweet about it
  • ๐Ÿ’ฌ Tell your friends
  • ๐Ÿ”— Share on social media

๐ŸŽฏ Ready to Challenge the AI?

๐Ÿš€ PLAY TOURNAMENT PONG NOW

Test your reflexes against an AI that talks back - show the AI what you're made of! ๐Ÿ“

About

๐Ÿ“ Modern Tournament Pong game with AI commentary - First to 10 points wins! Built with vanilla HTML5, CSS3, and JavaScript. Features intelligent AI opponent, real-time commentary, 60-second matches, and responsive design.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published