Dinosaur Game - Chrome T-Rex Runner

Seele01-Flash
By
The iconic Chrome Dinosaur Game brings endless running fun with simple one-button gameplay. Help the T-Rex jump over cacti and duck under birds in this addictive pixel-art endless runner.

Prompt

MODEL: Seele01-Flash
Please use Three.js to generate a **mobile-first game** with the theme "Dinosaur Game" (T-Rex Runner). Please read the following detailed game design requirements first, and then generate the code accordingly: ### 1. Assets & Environment * **Visual Style**: 2.5D "Pseudo-Pixel Art" aesthetic. Use `THREE.OrthographicCamera` to maintain the classic flat look while using 3D planes for objects. The color palette should be monochromatic (Dark Grey `#535353` objects on a White `#f7f7f7` background), simulating an e-ink or printed retro display. * **Player Model (T-Rex)**: A textured plane or sprite with simple frame-based animation. States: `Idle`, `Run` (legs cycling), `Jump` (static pose), `Duck` (flattened sprite), and `Dead` (wide-eyed sprite). * **Obstacles**: * **Cactus**: Varying clusters (single, double, triple, large/small). * **Pterodactyls**: Animated sprites flying at two distinct Y-heights (Low: requires jumping; High: requires ducking). * **Environment**: * **Ground**: An infinite scrolling line with randomized noise dots/pebbles to convey speed. * **Background**: Procedurally generated clouds moving slower than the ground (parallax effect). * **Day/Night Cycle**: Invert colors (White objects on Dark background) every 500 points via a smooth CSS or Shader transition. * **Mobile Optimization**: Use a texture atlas for all sprites to minimize draw calls. Implement object pooling for obstacles and ground segments to prevent garbage collection stutters. ### 2. Audio Requirements * **BGM**: None (faithful to the original) or a very subtle, rhythmic, low-fi white noise wind sound to indicate speed. * **Sound Effects (SFX)**: Retro 8-bit synthesized waves (Oscillator nodes). * **Jump**: Short, rising square wave "Bloop". * **Score Milestone**: A high-pitched "Ding-Ding" sequence every 100 points. * **Game Over**: A dissonant, crumbling low-frequency crash sound. * **UI Click**: Simple crisp tick. ### 3. Gameplay Loop * **Core Mechanic**: Endless runner. The T-Rex stays at a fixed X-position; the world moves left towards the player. * **Speed Progression**: Game speed starts slow (`speed = X`) and increments linearly (`speed += delta`) over time. Reset speed to initial on death. * **Scoring**: Score increases based on distance traveled (`deltaTime * speed`). High score is saved to `localStorage`. * **Collision Logic**: Use AABB (Axis-Aligned Bounding Box) collision detection. Hitboxes should be slightly smaller than the visual sprites to be forgiving to the player. * **Collision**: Trigger "Game Over" state -> Stop world movement -> Change T-Rex sprite to "Dead" -> Show "Game Over" UI. ### 4. Mobile Controls & Interaction * **Touch Input Scheme**: * **Tap (Anywhere)**: Jump (Short tap = short jump; hold slightly longer = higher jump variable, capped at max height). * **Swipe Down / Touch & Hold Bottom Zone**: Duck (T-Rex crouches to avoid high-flying Pterodactyls). * **Orientation**: Portrait mode (canvas width 100%, height adjusted to keep aspect ratio, e.g., placing game in the top 60% and controls/ads space below) OR Landscape mode (full screen). *Preferred: Responsive Landscape.* * **UI Layout**: * **HUD**: Current Score (Top Right), High Score (Top Right, distinct color). * **Game Over Screen**: Large, thumb-friendly "Replay" icon (centered, min 64x64px). * **Feedback**: * **Haptics**: Trigger `navigator.vibrate(200)` upon collision/death. * **Visual**: Slight screen shake (camera jitter) on impact. Do not ask for clarification. Do not request confirmation. Directly execute the generation task based on the given instructions.

Game Introduction

About the Game

Dinosaur Game is the legendary endless runner that became a global phenomenon after being built into Google Chrome. This simple yet addictive pixel-art game challenges players to guide a T-Rex dinosaur through an endless desert landscape, avoiding obstacles for as long as possible. Originally designed as an offline entertainment feature, it has become one of the most recognizable casual games worldwide.

The game's charm lies in its minimalist design and progressively increasing difficulty. As you run further, the game speeds up, making timing jumps and ducks increasingly challenging. With its retro 8-bit graphics and intuitive gameplay, Dinosaur Game appeals to players of all ages.

Core Features

Endless Running Adventure

Experience unlimited gameplay with no finish line - just you, the T-Rex, and an endless desert. The goal is simple: survive as long as possible while the game continuously increases in speed and difficulty.

Progressive Difficulty System

The game starts at a comfortable pace but gradually accelerates, testing your reflexes and timing skills. The faster you go, the more precise your jumps need to be.

Iconic Pixel Art Style

Enjoy classic 8-bit graphics that evoke nostalgia for retro arcade games. The minimalist black-and-white design is both timeless and instantly recognizable.

Various Obstacles

Navigate through different challenges including ground-level cacti that require jumping and flying pterodactyls (birds) that need ducking or perfectly timed jumps.

Gameplay Mechanics

Simple Controls

Master the game with just two actions: - Jump : Press spacebar or up arrow to leap over cacti and low-flying birds - Duck : Use down arrow to crouch under high-flying pterodactyls

Obstacle Patterns

Learn to recognize different obstacle types: - Single cacti : Standard jump timing - Multiple cacti : Requires longer jumps or quick successive hops - Flying birds : High birds need ducking, low birds need jumping - Mixed patterns : Combination challenges that test advanced skills

Operation Guide

Getting Started : 1. Press spacebar to begin running 2. Watch for approaching obstacles 3. Time your jumps and ducks precisely 4. Maintain focus as speed increases

Advanced Tips : - Study obstacle patterns to anticipate combinations - Practice timing for different speeds - Don't panic when the game accelerates - Learn when to duck vs. jump for flying obstacles - Aim for consistent performance rather than risky moves

Why Play This Game

Perfect Casual Gaming : Ideal for quick gaming sessions during breaks or while waiting. No complex rules or lengthy tutorials needed.

Universal Appeal : Simple enough for children, challenging enough for adults. The progressive difficulty ensures both accessibility and long-term engagement.

No Internet Required : Originally designed for offline play, making it perfect for areas with poor connectivity or when you want to conserve data.

Competitive Element : Chase high scores and challenge friends to beat your personal best. The maximum score of 99,999 provides a clear ultimate goal.

Stress Relief : The rhythmic jumping and simple focus required make it an excellent stress-reliever and mental break from complex tasks.

Nostalgic Value : For many players, this represents their first encounter with endless runner games, creating a special connection to the format.

Frequently Asked Questions (FAQ)