Ping Pong - Classic Table Tennis Game

Seele01-Flash
By
Ping Pong is a classic table tennis sports game that brings the excitement of real ping pong to your browser. Challenge smart AI opponents in fast-paced matches where first player to reach 10 points wins!

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Ping Pong Arcade". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style:** A "Flat 3D" or "2.5D" aesthetic that mimics vector art. Use an **Orthographic Camera** positioned directly overhead (top-down view) to replicate the 2D look of the screenshot while leveraging 3D physics. * **Color Palette:** High contrast and vibrant. * **Background:** Mustard Yellow (`#F4D03F`). * **Table:** Salmon/Coral Orange (`#FF7F50`) with thick black borders and a white centerline/net. * **Paddles:** Teal (`#1ABC9C`) for the AI (Top), Magenta/Red (`#E74C3C`) for the Player (Bottom). * **Ball:** Pure White (`#FFFFFF`) with a subtle trail effect. * **Models:** Use simple primitives (`BoxGeometry`, `CylinderGeometry`) with `MeshBasicMaterial` (unlit) or `MeshToonMaterial` to maintain the flat, cartoon look. The paddles should have a small handle visible. * **Effects:** * A white "trail renderer" or ribbon effect following the ball to visualize speed. * Small "spark" or "impact lines" particle burst (simple triangles or lines) appearing at the contact point when the paddle hits the ball. * **Mobile Optimization:** Use a single shared geometry for particles. Keep shadow casting disabled or very low resolution. Limit real-time lights; bake lighting into textures if possible, or use global ambient light. ### 2. Audio Requirements * **BGM:** A lighthearted, rhythmic, and upbeat "casual arcade" loop (Synth-pop or minimal funk) that isn't too distracting. * **SFX:** * **Paddle Hit:** A satisfying "Pock" or "Thwack" sound (pitch-shifted slightly higher for hard hits). * **Table Bounce:** A softer "Tick" sound. * **Score:** A cheerful chime or whistle sound when the player scores. * **Miss/Enemy Score:** A low-pitched "buzzer" or descending tone. * **Win/Loss:** A short fanfare for winning; a "wa-wa-wa" sound for losing. ### 3. Gameplay Loop * **Core Mechanics:** * The ball starts from the center. * **Physics:** The ball must bounce once on the opponent's side to be valid. If it goes off-screen without bouncing, the opponent scores. * **Flick Mechanic:** The ball's return speed and angle should be calculated based on the *velocity* of the paddle at the moment of impact. A static paddle just blocks the ball; a moving paddle adds force (smash). * **AI Behavior:** The AI (top paddle) tracks the ball's X position with a slight delay (LERP) and a "reaction time" variable so it is beatable. As the difficulty increases (or score gets higher), the AI's reaction time improves. * **Winning Condition:** Standard scoring. First player to reach **10 points** wins the match. * **Game Flow:** Start Screen -> Gameplay -> Point Scored (brief pause) -> Gameplay -> Game Over (Win/Loss Modal with "Restart" button). ### 4. Mobile Controls & Interaction * **Screen Orientation:** Forced **Portrait Mode** layout. The table should fill the screen vertically. * **Touch Controls:** * **1-to-1 Drag:** The player's paddle (bottom) follows the user's finger or mouse position horizontally (X-axis). * **Vertical Freedom:** Allow slight movement on the Y-axis (forward/backward) to allow the player to "step into" the shot for a smash, but limit the range to the bottom 20% of the table. * **Touch Area:** The entire bottom half of the screen should be the active touch zone, not just the paddle itself, to prevent the finger from obscuring the view. * **Haptic Feedback:** Trigger `navigator.vibrate(15)` (short light vibration) whenever the ball hits the player's paddle to provide tactile impact. * **UI:** Minimalist HUD. Display scores (Player vs AI) clearly in the corners or center-transparently. Buttons must be large (min 44px hit area) for touch accessibility. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Ping Pong is a thrilling digital recreation of the beloved table tennis sport that has captivated players worldwide. This free online sports game delivers an authentic ping pong experience with intuitive controls and challenging gameplay. Whether you're a casual player or a competitive enthusiast, this game offers hours of entertainment with its simple yet engaging mechanics.

The game features a clean, minimalist design with vibrant colors that make it easy to focus on the action. The orange and pink color scheme creates a modern, eye-catching aesthetic that enhances the overall gaming experience.

Core Features

Authentic Table Tennis Experience

Experience realistic ping pong physics and ball movement that mimics real table tennis. The game captures the essence of the sport with accurate ball trajectories and paddle interactions.

Intelligent AI Opponents

Face off against clever computer opponents that adapt to your playing style. The AI provides a challenging experience that keeps you engaged and helps improve your skills.

Speed Control System

Master the art of shot control by adjusting the intensity of your paddle movements. Light touches create gentle shots, while stronger flicks generate powerful attacks that can catch opponents off guard.

First to 10 Scoring

Classic ping pong rules apply - be the first player to score 10 points to win the match. This familiar scoring system makes the game accessible to players of all skill levels.

Cross-Platform Compatibility

Play seamlessly on both desktop computers and mobile devices. The responsive design ensures optimal gameplay whether you're using a mouse or touchscreen.

Gameplay Mechanics

The objective is straightforward yet challenging: hit the ball to your opponent's side of the table while preventing them from returning it successfully. Strategic shot placement, timing, and speed control are key to victory.

Each rally requires quick reflexes and tactical thinking. You can vary your shots from gentle placements to powerful smashes, keeping your opponent guessing and creating opportunities to score points.

Operation Guide

Desktop Controls

  • Mouse Movement : Drag the left mouse button to move your paddle around the table
  • Click Intensity : Control shot power by varying the strength of your mouse movements

Mobile Controls

  • Touch and Drag : Use your finger to move the paddle across the screen
  • Gesture Speed : Adjust shot velocity by changing the speed of your finger movements

Pro Tips

  • Watch the ball's trajectory carefully to position your paddle optimally
  • Experiment with different shot speeds to confuse AI opponents
  • Use quick, short movements for defensive plays and longer strokes for attacking shots
  • Practice timing to master the rhythm of rallies

Why Play This Game

Perfect for All Skill Levels

Whether you're new to ping pong or an experienced player, the game offers an appropriate challenge level that grows with your skills.

Quick Gaming Sessions

Matches are fast-paced and typically last just a few minutes, making it perfect for quick breaks or casual gaming sessions.

No Download Required

Instant access through any web browser means you can start playing immediately without installations or lengthy downloads.

Stress Relief

The focused gameplay and rhythmic ball exchanges provide an excellent way to unwind and relieve stress.

Skill Development

Improve your hand-eye coordination, reaction time, and strategic thinking while having fun.

Platform Support

This versatile ping pong game works flawlessly across multiple platforms: - Desktop Browsers : Chrome, Firefox, Safari, Edge - Mobile Devices : iOS and Android smartphones and tablets - Operating Systems : Windows, macOS, Linux

No special software or plugins required - just open your browser and start playing!

Frequently Asked Questions (FAQ)