/bevy-moonracer

Primary LanguageRustMIT LicenseMIT

bevy-moonracer

A little game to try out bevy.

Online demo: https://tristancacqueray.github.io/bevy-moonracer.

Checkout the initial prototype in Haskell: moonracer.

Gameplay

  • 2d spaceship racing game.
  • Reach the goals as fast as possible.
  • Edit the inputs frame by frame to make the perfect score, e.g.: tool assisted speedrun (TAS).

Features and roadmap

The goal of this project is to implement the core pieces of a classic video game. This can be used by beginners to get some starting points for their own game.

Game mechanics

  • 2d box collision system.
  • Reach goals to increase the score.
  • Finish the level by landing back on the launch pad.
  • Save user data (powered by bevy_pkv).
  • Save ghost input data.
  • Difficulty settings (Crash on high velocity, no drag, no gravity).
  • Story line (e.g. a pilot trying to become an astranaut).

Levels

  • Levels data stored in levels.svg (editable with inkscape).
  • Minimum completion time.
  • Walls
    • Solid
    • Bumper
    • Trap
  • Goals
    • Passing gate
    • Crate that increases ship weight
    • Black hole that reverses the gravity
  • Codegen at buildtime the level data to remove the xml parser dependencies from the runtime.

Inputs

  • Keyboard wasd/arrow
  • Gamepad
  • Touchscreen

Sounds

  • Background music
  • White noise shhhh for the thrust
  • Rewarding bell sample when reaching a goal

Graphisms

  • Logo
  • Shader background
  • Thrust particles
  • Crash animation
  • 3d models
  • Custom font

User Interface

  • Menus (powered by ui-navigation).
  • Pause/resume.
  • Level selection screen.
  • Level end screen with current score and a next level button.
  • Tooltips to explain current goal.
  • Background demo to show what needs to be done. (e.g. a bot playing the first level).
  • Settings menu to adjust the sound volume and toggle the bloom effect.
  • About screen with link to the source.
  • HUD for the ship velocity and current time.
  • TAS mode with input editor and stepping through the frames.

Toolchain

  • Reproducible build with nix.
  • Run native version with cargo run linked with mold.
  • Build wasm version with nix build .#web.
  • Setup GitHub action to update the online demo.
  • Build native version for windows/mac/linux

Clear save data in browser local storage or in ~/.local/share/save/bevy_pkv.sled/.