Skip to content

About

OpenSurfer is an open source endless runner game built in Flutter and Flame

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

OpenSurfer

A 3D endless runner game built with Flutter and the Flame engine.

Gameplay

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

Controls

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

Architecture

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

Packages

  • flame ^1.29.0 -- Game engine
  • flame_audio ^2.1.0 -- Audio playback

Spawning

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.

Camera

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.

Performance

  • Object pooling for obstacles, coins, and particles
  • Spatial culling for off-screen objects
  • Primitive shape rendering -- no texture assets

Setup

flutter pub get
flutter run

About

OpenSurfer is an open source endless runner game built in Flutter and Flame

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages