A Fast-Paced 3D WebGL Pastel Court Game Featuring Intelligent AI, Aerodynamic Physics, Cheering Crowds, and In-Browser Gameplay

By (@shaurya) · · Games

Robo Tennis is an arcade-style, browser-native 3D sports simulation built using Three.js and vanilla JavaScript without external engine bloat. Set against a minimalist pastel colosseum, players pilot a futuristic robotic athlete competing in high-intensity singles matches against an adaptive AI opponent. The game implements a custom physics engine modeling gravity, court friction, air resistance, and Magnus-effect topspin and backspin trajectory mechanics. Players can execute precision flat drives, cross-court placements, defensive lobs, and overhead smash volleys. A dynamic landing indicator provides real-time bounce predictions, while visual audio-synchronized effects—such as dust rings, ball motion trails, and subtle screen shakes—deliver impactful hit feedback. The surrounding arena features multi-tiered bleachers populated by over five hundred procedurally animated spectators who cheer, jump, and celebrate during crucial rallies. The robot avatars showcase metallic materials, chrome joints, luminous visor optics, and pulsating arc reactor cores. Complete with a realistic tennis scoring engine (tracking deuce, advantages, games, and sets) and a canvas-level video recorder capturing 60 FPS gameplay directly in-browser, Robo Tennis delivers a complete, console-quality sports experience through a single lightweight HTML file. Zero installation is required; simply open and play.

Tech stack

  • GitHub Copilot

Prompt steps

  1. Step 1

    Create a complete, single-file 3D tennis game in HTML5, CSS, and Three.js (via ES module importmap) called "Robo Tennis: Pastel Open". The entire application must run self-contained in a modern browser with zero build steps.
    
    Visual Style & Arena:
    Design a stylized, vibrant pastel-toned stadium. Include a standard regulation court with singles/doubles boundary lines, service boxes, and a realistic sagging net with posts.
    Construct multi-tier spectator bleachers along the sidelines and baselines. Use THREE.InstancedMesh to render 500+ two-part humanoid spectators (caps and torsos) in randomized pastel palettes with subtle breathing idles and celebratory jumping animations triggered on winner points.
    Surround the arena with low-poly backdrop trees, floating billboard clouds, soft ambient hemisphere lighting, and warm directional sunlight casting soft PCF shadows.
    Robot Character Design:
    Build two articulated robot models (Player and CPU) composed of geometric primitives.
    Use metallic StandardMaterials (roughness: 0.32, metalness: 0.45) with contrasting color accents (Cyan/Coral for Player, Gold/Lavender for CPU).
    Detail the robots with illuminated horizontal cyber-visor eyes, chrome shoulder and elbow joints, torso vent grills, twin backpack thrusters, and a pulsating emissive arc reactor core in the chest.
    Equip each with a cybernetic racket featuring a glowing rim.
  2. Step 2

    Tennis Physics & Animation:
    Implement fixed sub-step physics (120 Hz) simulating gravity, aerodynamic drag, bounce restitution, and Magnus force for topspin and backspin.
    Display a dynamic court-surface landing ring showing projected ball bounce positions (tinted yellow for in-bounds, red for out-of-bounds).
    Program procedural swing keyframing: overhead serves (with dedicated ball toss reaching peak contact height), forehand drives, backhand slices, and high lobs.
    Player controls: WASD for court movement, Shift for sprint, Space/Click to initiate swings, and directional keys held during contact to direct shot placement and trajectory.
    Build an adaptive CPU opponent with court positioning, shot recovery, and calibrated timing errors.
    Game Engine & Audio:
    Full standard tennis scoring: Love, 15, 30, 40, Deuce, Advantage, Game, Set (Best of 3), and Match Over, rendered via a floating pastel HUD scoreboard.
    Integrate Web Audio API procedural sound synthesizers for racket strikes, ball bounces, net clips, and crowd cheers without external audio files.
    Add an in-game "Record 15s" button using canvas.captureStream(60) and MediaRecorder to export 60 FPS WebM/MP4 video clips directly for presentations and submissions.

Comments (2)

  1. Jack Herzlich ·

    The site wasn't loading for me but this looks really cool from the video. Would love to check it out with another link

    1. Shuarya ·

      You can try it now

      https://robotennis.netlify.app

5 likes · 3 comments · 4 views

Explore more on Prompted

Loading