A 3D endless runner game built with Flutter and the Flame engine.
The player runs forward automatically on a procedurally generated road. Navigate three lanes to collect coins and avoid obstacles. Game speed increases over time, scaling difficulty naturally.
- Move between 3 lanes (left, center, right)
- Jump over obstacles
- Slide under barriers
- Collect coins for points
- Score based on distance and coins collected
| Action | Desktop | Mobile |
|---|---|---|
| Left | Left Arrow / A | Swipe Left |
| Right | Right Arrow / D | Swipe Right |
| Jump | Up Arrow / W | Swipe Up / Tap |
| Slide | Down Arrow / S | Swipe Down |
lib/
main.dart
game/
endless_runner_game.dart -- Main game loop and rendering
components/
player/ -- Player state and penguin rendering
obstacles/ -- Obstacle types with object pooling
coins/ -- Coin patterns with object pooling
world/ -- Road, environment, sky, mountains
particles/ -- Visual particle effects
systems/
input_system.dart -- Keyboard and swipe input
scoring_system.dart -- Score tracking
difficulty_system.dart -- Speed and gap scaling
collision_system.dart -- 3D collision detection
ui/
hud_overlay.dart -- Score and coin HUD
menu_screen.dart -- Home screen
pause_menu.dart -- Pause overlay
game_over_screen.dart -- Score summary
settings_screen.dart -- Audio toggles
audio/
audio_manager.dart -- BGM and SFX
utils/
constants.dart -- Game configuration
math_utils.dart -- Vector math
game_camera.dart -- Perspective camera
flame^1.29.0 -- Game engineflame_audio^2.1.0 -- Audio playback
Obstacles and coins use object pooling. Objects are spawned ahead of the player and recycled when behind. Obstacle gaps decrease as speed increases. Coins use three spawn patterns: single, line, and arc. Environment objects (trees, rocks) are placed on both sides of the road with randomized spacing.
Third-person perspective camera follows the player with smooth interpolation. The camera tracks lane position, creating a subtle dolly effect. Lane width is 2.0 world units.
- Object pooling for obstacles, coins, and particles
- Spatial culling for off-screen objects
- Primitive shape rendering -- no texture assets
flutter pub get
flutter run