No description
  • Rust 74.5%
  • Nix 11.1%
  • Shell 6.5%
  • JavaScript 4.2%
  • HTML 3.7%
Find a file Use this template
floride 30ba772186
Some checks failed
Deploy to itch.io / configure (push) Successful in 6s
Deploy to itch.io / build-windows (push) Failing after 6m26s
Deploy to itch.io / build-wasm (push) Failing after 7m18s
Deploy to itch.io / build-linux (push) Failing after 19m14s
Deploy to itch.io / deploy (push) Has been cancelled
build(nix): update wasm-bindgen-cli and add path script
Update wasm-bindgen-cli to version 0.2.125 and add an extraScript to include BF_WASM_BINDGEN in the PATH environment variable.
2026-07-22 11:35:52 +00:00
.cargo fix(cargo): Change the configuration file for compiling in wasm32-unknown-unknown 2026-07-22 11:35:52 +00:00
.forgejo/workflows ci: enable experimental nix features via NIX_CONFIG 2026-07-22 11:35:52 +00:00
.husky feat(screen): Create a screen menu 2026-06-19 23:33:36 +02:00
assets chore(assets): Import NotoSans-Regular 2026-06-19 23:27:15 +02:00
src feat(binary): Add new metadata on the window 2026-06-27 22:50:34 +02:00
wasm fix(cargo): Change the configuration file for compiling in wasm32-unknown-unknown 2026-07-22 11:35:52 +00:00
.envrc chore: initial commit for boilerplate bevy game template structure 2026-06-16 10:08:27 +02:00
.gitignore chore(tooling): Remove husky from gitignore 2026-07-22 11:35:52 +00:00
Cargo.lock fix(cargo): Change the configuration file for compiling in wasm32-unknown-unknown 2026-07-22 11:35:52 +00:00
Cargo.toml fix(cargo): Change the configuration file for compiling in wasm32-unknown-unknown 2026-07-22 11:35:52 +00:00
flake.lock chore: initial commit for boilerplate bevy game template structure 2026-06-16 10:08:27 +02:00
flake.nix build(nix): update wasm-bindgen-cli and add path script 2026-07-22 11:35:52 +00:00
README.md chore(readme): Update the src/ structure inside README 2026-06-16 19:20:05 +02:00
rust-toolchain.toml chore: initial commit for boilerplate bevy game template structure 2026-06-16 10:08:27 +02:00
rustfmtl.toml chore: initial commit for boilerplate bevy game template structure 2026-06-16 10:08:27 +02: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:

src/
├── main.rs
├── core/
│ ├── mod.rs
│ ├── states.rs
│ ├── events.rs
│ └── resources.rs
├── features/
│ ├── player/
│ │ ├── mod.rs
│ │ ├── components.rs
│ │ ├── systems.rs
│ │ └── plugin.rs
│ ├── enemy/
│ ├── combat/
│ └── inventory/
├── ui/
│ ├── mod.rs
│ ├── hud.rs
│ └── menus.rs
└── plugins.rs

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