Flappy Dunk - Basketball Game

Seele01-Flash
By
Flappy Dunk is an addictive casual basketball game that combines simple one-touch controls with challenging hoop-shooting gameplay. Tap to propel your basketball through hoops, earn points, and unlock new balls in this easy-to-learn but hard-to-master experience.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Flappy Dunk". Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style**: High-contrast "2.5D" aesthetic using `OrthographicCamera` to simulate a flat vector art style while maintaining 3D depth for the hoops. Use bright, saturated colors (Orange ball, Red hoops) against a muted background. * **The Player (Ball)**: Create a basketball using a `SphereGeometry` with an orange texture and black lines. Attach two small white "Wing" meshes (using flattened `SphereGeometry` or `PlaneGeometry`) to the sides of the ball. * *Animation*: The wings must play a "flap" animation (rotate up and down) trigger by input. The ball should rotate on its X-axis continuously to simulate forward rolling. * **The Hoops**: Use `TorusGeometry` (Red color) to create hoops. They must be positioned at varying heights. * **The Environment**: A scrolling background texture resembling a light beige brick wall. * **VFX**: * **Swish Effect**: When a point is scored without touching the rim, spawn an explosion of yellow star particles and a floating "SWISH!" text. * **Trail**: A subtle white trail following the ball to indicate velocity. * **Mobile Optimization**: Use `InstancedMesh` for the hoops if possible to reduce draw calls. Texture resolution should be optimized (max 512x512). Use simple `MeshToonMaterial` for a cel-shaded look. ### 2. Audio Requirements * **BGM**: A loopable, upbeat, funky hip-hop beat (bass and snare heavy) that matches the rhythm of basketball. * **Sound Effects (SFX)**: * **Tap/Jump**: A cartoonish "Woosh" or wing-flap sound. * **Rim Hit**: A metallic/plastic "Clank" sound if the ball hits the torus ring. * **Score (Normal)**: A standard arcade "Ding". * **Score (Swish)**: A satisfying "Net swish" sound accompanied by a crowd cheer or energetic chord. * **Game Over**: A buzzer sound followed by a falling whistle. ### 3. Gameplay Loop * **Core Mechanics**: A hybrid of Flappy Bird and Basketball. * **Gravity**: Consistently pulls the ball down (Y-axis). * **Thrust**: Tapping applies an instantaneous upward and slightly forward velocity. * **Scrolling**: The camera and ball stay relatively centered on X, while hoops spawn on the right and move left (or the camera moves right). * **Collision Physics**: * The ball has a physical collider (Sphere). * The Hoops have complex collision: The ball must pass *through* the center hole. Hitting the red torus ring causes the ball to bounce off (elastic collision). * **Scoring System**: * Pass through hoop: +1 Score. * "Swish" (Pass through without touching the ring): +2 Score and trigger "Swish" VFX. * **Win/Loss Condition**: * **Game Over**: If the ball touches the ground (bottom of screen), touches the ceiling (top of screen), or misses a hoop (hoop passes off-screen left without being scored on). * **Progress**: Game is endless. Hoops spawn at increasingly difficult height variations and intervals. ### 4. Mobile Controls & Interaction * **Touch Input**: * **Action**: Full-screen tap handler (`touchstart`). One tap = One "Flap" (Jump). * **Responsiveness**: Input must be zero-latency. Add a small screen shake intensity (0.1) on impact with the rim or ground to provide haptic-like visual feedback. * **Orientation**: **Portrait Mode** (Vertical) only. The camera zoom must adapt to `window.innerWidth` to ensure the ball and hoops are visible on various aspect ratios (from 4:3 to 19.5:9). * **UI Layout**: * Score: Large, semi-transparent font centered in the upper half of the screen (behind the gameplay layer). * Start/Restart: A clear overlay with a "Tap to Start" prompt. * Prevent default browser behaviors (scrolling, zooming) using `event.preventDefault()` on the canvas. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Flappy Dunk is a captivating casual basketball game that perfectly blends simplicity with challenge. This addictive arcade-style game puts you in control of a basketball with adorable wings, challenging you to navigate through basketball hoops while earning points and unlocking exciting new content. The game's minimalist design and intuitive controls make it accessible to players of all ages and skill levels.

The core gameplay revolves around precise timing and physics-based movements. Each successful dunk rewards you with points and brings you closer to unlocking new basketball designs, keeping the gameplay fresh and engaging throughout your gaming sessions.

Core Features

Simple One-Touch Controls

Flappy Dunk's greatest strength lies in its accessible control scheme. With just a single tap or click, you can control your basketball's flight path, making it perfect for quick gaming sessions on any device.

Physics-Based Gameplay

The game incorporates realistic physics mechanics that affect how your basketball moves through the air. Master the momentum and trajectory to achieve perfect dunks through increasingly challenging hoop arrangements.

Progressive Difficulty

As you advance through the game, the hoop placements become more complex and challenging. This progressive difficulty curve ensures that both beginners and experienced players find appropriate challenges.

Unlockable Content

Earn points to unlock a variety of unique basketballs, each with its own visual appeal. This progression system adds a rewarding element that encourages continued play.

Cross-Platform Compatibility

Enjoy seamless gameplay across all devices - whether you're playing on a desktop computer, smartphone, or tablet through your web browser.

Game Mechanics

Scoring System

Points are awarded for each successful basket you make. The more consecutive hoops you score, the higher your point multiplier becomes, encouraging skillful and consistent play.

Collision Detection

The game features precise collision detection that requires accuracy and timing. Missing a hoop or hitting obstacles will end your current run, adding tension and excitement to each attempt.

Operation Guide

Basic Controls

  • Mouse : Click the left mouse button to make the basketball flap and gain altitude
  • Mobile Touch : Tap anywhere on the screen to control the ball's flight
  • Timing : Release control to let gravity pull the ball down naturally

Gameplay Strategy

  • Rhythm : Develop a consistent tapping rhythm to maintain steady flight
  • Anticipation : Look ahead to plan your trajectory through upcoming hoops
  • Practice : Start with short sessions to build muscle memory for the controls
  • Patience : Don't rush - smooth, controlled movements often work better than frantic tapping

Mastering the Physics

Understanding the game's physics is key to success. The basketball responds to gravity when you're not actively controlling it, and each tap provides upward momentum. Learning to balance these forces allows for precise navigation through tight hoop arrangements.

Why Play Flappy Dunk

Perfect for Quick Sessions : The game's design makes it ideal for short gaming breaks. Whether you have 2 minutes or 20 minutes, you can enjoy meaningful gameplay sessions.

Stress Relief : The simple, repetitive nature of the gameplay can be surprisingly meditative and stress-relieving, making it a great way to unwind.

Skill Development : Despite its simplicity, Flappy Dunk helps develop hand-eye coordination, timing, and spatial awareness skills.

Universal Appeal : Basketball fans will love the theme, while casual gamers will appreciate the accessible gameplay that doesn't require sports knowledge.

No Commitment Required : Being completely free and browser-based means you can start playing immediately without downloads, installations, or registration.

Competitive Elements : Challenge yourself to beat your high scores or compete with friends and family for the best performance.

Flappy Dunk represents the perfect balance of simplicity and challenge that makes casual games so appealing. Its combination of familiar basketball themes with innovative flying mechanics creates a unique gaming experience that's both nostalgic and fresh.

Frequently Asked Questions (FAQ)