No description
  • Nix 53.4%
  • Shell 42.4%
  • Rust 4.2%
Find a file
2026-06-16 14:33:08 +00:00
.cargo Initial commit 2026-06-16 14:33:08 +00:00
.forgejo/workflows Initial commit 2026-06-16 14:33:08 +00:00
.husky Initial commit 2026-06-16 14:33:08 +00:00
assets Initial commit 2026-06-16 14:33:08 +00:00
src Initial commit 2026-06-16 14:33:08 +00:00
.envrc Initial commit 2026-06-16 14:33:08 +00:00
.gitignore Initial commit 2026-06-16 14:33:08 +00:00
Cargo.lock Initial commit 2026-06-16 14:33:08 +00:00
Cargo.toml Initial commit 2026-06-16 14:33:08 +00:00
flake.lock Initial commit 2026-06-16 14:33:08 +00:00
flake.nix Initial commit 2026-06-16 14:33:08 +00:00
README.md Initial commit 2026-06-16 14:33:08 +00:00
rust-toolchain.toml Initial commit 2026-06-16 14:33:08 +00:00
rustfmtl.toml Initial commit 2026-06-16 14:33:08 +00:00

Bevy Game Template

A robust starting template for 2D/3D games built with the Bevy Engine in Rust.

Overview

This project serves as a foundation for developing games with Bevy (v0.18.1), coming pre-configured with a selection of excellent ecosystem crates and optimized build profiles to accelerate your workflow.

Features & Included Crates

  • Engine: Bevy (v0.18.1)
  • Tilemaps: bevy_ecs_tilemap for performant 2D tile-based rendering.
  • Input: leafwing-input-manager for powerful, declarative action-based input handling.
  • Debugging: bevy-inspector-egui (optional, via the dev feature) for real-time ECS inspection.
  • Utilities: rand for random number generation and husky-rs for Git hooks.

Project Structure

The src/ directory is organized into a modular structure:

  • components/ - ECS Components
  • systems/ - ECS Systems
  • plugins/ - Bevy Plugins
  • ui/ - User Interface logic
  • main.rs - Application entry point

Getting Started

Prerequisites

Running the Project

Standard Build

cargo run

Development Build (Recommended) Runs the game with dynamic linking (for significantly faster iterative compile times) and enables the debug inspector:

cargo run --features dev

Build Profiles

This template includes tailored build profiles in Cargo.toml:

  • dev: High optimization for dependencies (opt-level = 3), low for your code (opt-level = 1) to ensure fast compile times while keeping the game running smoothly.
  • release: Maximized for runtime performance (lto = "thin", codegen-units = 1).
  • wasm-release: Specifically optimized for size to reduce web payloads (opt-level = "s", stripped debug info).

Nix & Flake

This project includes a flake.nix configured with bevy-flake and rust-overlay for reproducible development environments.

Usage

Enter the Development Shell This will drop you into a shell with the required Rust toolchain, system dependencies, and CLI tools (like bevy-cli) pre-installed.

nix develop

Build the Project To build the project using Nix:

nix build

Run the Project To run the game directly:

nix run

Building for Web (WASM)

To build for web, make sure you have the WASM target installed:

rustup target add wasm32-unknown-unknown
cargo build --profile wasm-release --target wasm32-unknown-unknown