A simple Breakout clone built in Rust using Bevy. Playable in the browser.
- Move left: A
- Move right: D
- Gameplay mechanics:
- Score based on destroyed tiles
- Three lives that get depleted when the ball hits the bottom wall
- Simple ball physics
- Simple particle system that is used to spawn a trail for the ball
- A ball speedup system that is also indicated by the color of the ball trail
- Simple audio system for sound effects
- Multiple game states:
- Main menu screen
- Settings screen with global volume control
- Game state
- Game over screen
- Playable in the browser utilizing wasm
If you only want to run the game natively:
- Install the latest Rust version (via rustup)
- Install the Bevy OS Dependencies depending on your OS
Optionally, if you also want to run the webapp:
- Install Node.js 22 (via nodejs.org)
- Install project dependencies (run in root):
npm ci
This project uses npm scripts to orchestrate the webapp builds. You can either run the project using the root npm scripts or cargo if you want to just run the game natively.
Go to the bevy-breakout folder and run the game using cargo:
cd bevy-breakout && cargo runUse the --release -argument to run the release build.
These scripts are available in the project root:
Start the webapp in development mode:
npm run dev:webappNote: This also builds and generates the wasm bindings and copies all the assets to the webapp directory. The first time you run this will take some time. Also there is no auto watch for the game wasm, this is meant just for developing the website template.
Run the bevy game with debug build:
npm run dev:gameRun the wasm target build, generate bindings and copy the artifacts to webapp:
npm run bundle-wasmCopy the assets from the game to be used by the webapp:
npm run copy-assetsBuilds the bundle that is used for GitHub Pages deployment:
npm run dist:gh-pagesThis project is dual-licensed under the terms of MIT License (MIT) or the Apache License 2.0 (Apache-2.0). See the LICENSE-MIT and LICENSE-APACHE files for details.
