Bevy Game Engine

Bevy Game Engine Explained Visually

A visual tour of how Bevy helps you compose complex, emergent games from small independent systems and a data-driven architecture.

scroll to explore ↓

Build your game by composing systems

In Bevy, you build small independent systems and orchestrate them into complex emergent behaviors.

main.rs
App::new()
  .add_plugins(DefaultPlugins)
  .add_systems(Startup, spawn_player)
  .add_systems(Startup, spawn_enemies)
  .add_systems(Update, fire_bullet)
  .add_systems(Update, check_collisions)
  .run()

Direct your systems with Bevy's scheduler

Unlike traditional game loops that run everything every frame with if-checks scattered through your code, Bevy's scheduler decouples when a system runs.

main.rs
App::new()
  .add_systems(OnEnter(Playing), setup)
  .add_systems(Update, enemy_shoot
.run_if(player_is_alive))
  .add_systems(OnExit(Playing), despawn_all)
  .add_systems(OnEnter(GameOver), game_over)
  .run()

Build your game actors by composing data

Your player is a collection of data. Health, Score are plain Rust structs. Attach them to a player, an enemy, a destructible wall. The same building blocks compose any actor in your game.

main.rs
#[derive(Component)]
struct Health(f32);
#[derive(Component)]
struct Score(u32);
commands.spawn((
Player,
Health(100.),
Score(0),
));

Query your game world like a database

Your game world is a database. Every actor/entity is a row, every component is a column. No more manually passing data between systems. You declare what you need, Bevy queries the world and returns every match.

system.rs
fn track_hit_player(
mut players: Query<&mut Health>,
enemies: Query<&Transform>,
) {
dodge(&enemies);
shoot(&enemies, &mut players);
}

Trigger chain reactions across systems

Fire one event and Bevy broadcasts it to every system that listens. A bullet lands, health drops, score updates, sound plays, particles spawn. One signal, and the whole game responds.

events.rs
fn on_hit(
event: On<HitEvent>,
mut q: Query<&mut Health>,
) {
apply_damage(event, q);
}

Make impossible states impossible

Bevy States are Rust enums, meaning only one variant can be active at a time. You define the possible states, and the type system enforces them. Patrolling while attacking simply doesn't compile. A whole class of bugs disappears.

SCALE YOUR GAME WITH PLUGINS

As systems pile up, things get tangled fast. Plugins help organize the chaos, with each one acting as a self-contained module with its own systems, resources, and run conditions.

PARALLEL BY DEFAULT

Every system's parameters declare what it reads and writes. Bevy reads them and spreads systems across your cores. Two systems writing the same resource forces one to wait. Touching different data, they run in parallel.

And more…

Bevy ships with everything from rendering pipelines to audio entities. The ecosystem keeps growing.

Hands-on Bevy Tutorials

Build a 2D game from scratch

Start by setting up a player and watch it move. Build a procedurally generated world. Add collisions, inventory, and particle effects. Give enemies pathfinding, implement health and damage, layer in sound effects, save game states, and implement multiplayer networking.

Start Learning