Rust Game Engine

reliz1 pts0 comments

GitHub - relizv/rust-engine · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

relizv

rust-engine

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>20 Commits<br>20 Commits

.github/workflows

.github/workflows

engine-cli

engine-cli

engine-core

engine-core

engine-editor

engine-editor

engine-renderer

engine-renderer

engine-runner

engine-runner

textures

textures

.gitignore

.gitignore

AGENTS.md

AGENTS.md

Cargo.lock

Cargo.lock

Cargo.toml

Cargo.toml

LICENSE

LICENSE

README.md

README.md

View all files

Repository files navigation

rust-engine

A small "Godot-Lite" 2D game-engine experiment written in Rust. It is a learning project — the goal is to build, piece by piece, a familiar scene-tree / node-and-component runtime with an egui-based editor.

Workspace layout

Crate<br>Purpose

engine-core<br>Scene tree, node + component model, built-in components (Transform2DComponent, SpriteComponent, ScriptComponent), a fixed-timestep PhysicsServer2D with AABB collisions, and JSON scene (de)serialization.

engine-renderer<br>The Renderer trait and a simple TerminalRenderer that prints draw calls to stdout.

engine-cli<br>A tiny CLI demo that builds a scene with a scripted player and runs the loop against the terminal renderer.

engine-editor<br>An eframe/egui IDE — scene hierarchy, inspector, viewport with textured sprites and collider gizmos, play/pause simulation, save/load to scene.json.

├── engine-core/<br>├── engine-renderer/<br>├── engine-cli/<br>├── engine-editor/<br>├── textures/ # PNG assets resolved via `res://textures/...`<br>├── Cargo.toml # workspace<br>└── .github/workflows/ # CI: lint+test on Linux, release build on Windows

Requirements

Rust stable ≥ 1.85 (the dependency tree includes hashbrown 0.17, which requires the edition2024 Cargo feature).

On Linux, the editor needs the usual GUI dev packages: libgtk-3-dev libxkbcommon-dev libwayland-dev libfontconfig1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev.

Build & run

# Build everything<br>cargo build --workspace

# Run the CLI demo (prints frames to stdout)<br>cargo run -p engine-cli

# Launch the editor IDE<br>cargo run -p engine-editor

Run from the workspace root so that res://textures/... paths resolve correctly (the editor strips the res:// prefix and treats the rest as a CWD-relative path).

Tests & lints

cargo test --workspace<br>cargo clippy --workspace --all-targets -- -D warnings

CI runs both on every push / PR.

Status

This is a work-in-progress hobby engine. Currently supported:

Scene tree with parent/child relationships and depth-first traversal.

Components: Transform2DComponent, SpriteComponent, ScriptComponent (custom SimpleScript), RigidBody2DComponent (Dynamic / Static / Kinematic), BoxCollider2DComponent (with trigger support).

Fixed-timestep physics with brute-force AABB collision detection and minimum-translation-vector resolution.

Polling-style input system (tree.input.is_action_pressed("jump")) with an action map that binds logical names to keys / mouse buttons. The editor pipes egui's key + pointer events into it every frame while the simulation is running.

Audio: data-only AudioSourceComponent + AudioEvent queue in engine-core, backed by a kira-driven AudioServer in the editor. Sounds are registered by name (synthesized beeps at startup, real WAV/OGG via register_from_file), and scripts trigger playback either via autoplay-on-ready or by pushing AudioEvent::Play into tree.audio_events. The editor gracefully degrades to a silent no-op backend on machines without an audio device.

JSON scene serialization with #[serde(default)] for backward compatibility.

An egui editor with hierarchy, inspector, viewport, console, and play/pause simulation.

Editor controls

While the simulation is playing (▶ Run Simulation):

W / A / S / D or Arrow keys — move the PlayerControlled crate node around. Demonstrates the input system end-to-end (egui → tree.input → script → Transform2D).

The PlayerShip continues to rotate via its RotatingScript...

engine editor cargo scene tree rust

Related Articles