No description
Three major versions of breaking changes: - Bundles → Required Components (SpriteBundle, NodeBundle, ButtonBundle, TextBundle, Camera2dBundle removed; spawn tuples of components instead) - Style merged into Node; TextStyle split into TextFont + TextColor - Color API: rgb/rgba → srgb/srgba; Color::Rgba pattern matching replaced with .alpha()/.set_alpha(); .r()/.g()/.b() → .to_srgba().red/green/blue - Time: delta_seconds() → delta_secs(); elapsed_seconds() → elapsed_secs() - Query: get_single()/get_single_mut() → single()/single_mut() (now Result) - Timer::finished() → Timer::is_finished() - despawn_recursive() removed (despawn() is now recursive); despawn_descendants() removed — replaced with Children query iteration - BorderColor(c) → BorderColor::all(c) - WindowResolution: From<(f32,f32)> removed → cast to (u32,u32) - flake.nix: added wayland to runtime libs (default-on in 0.18) Tests pass (8/8), clippy clean, headless render verified showing start menu, button, starfield, and player ship. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .roo | ||
| .vscode | ||
| src | ||
| .envrc | ||
| .gitignore | ||
| .mcp.json | ||
| AGENTS.md | ||
| Cargo.lock | ||
| Cargo.toml | ||
| flake.lock | ||
| flake.nix | ||
| GEMINI.md | ||
| opencode.json | ||
| README.md | ||
| TODO.md | ||
bglga
This project is a simple Galaga-like space shooter game built using the Bevy engine.
Current State
The game features:
- A player ship at the bottom of the screen that can move left and right.
- Shooting bullets upward using the spacebar or up arrow key.
- Enemy ships that spawn at the top and move downward.
- Collision detection between bullets and enemies.
- Collision detection between the player and enemies.
- A player lives system (starting with 3 lives).
- Player destruction upon collision.
- Player respawn after a short delay with temporary invincibility.
- Remaining lives displayed in the window title.
Controls
- Move Left: A key or Left Arrow
- Move Right: D key or Right Arrow
- Shoot: Spacebar or Up Arrow
How to Compile
nix develop --command bash -c "cargo build"
How to Run
- Make sure you have Rust and Nix installed.
- Clone the repository.
- Navigate to the project directory.
- Run the game using the command:
nix develop --command bash -c "cargo run"
Headless Screenshots
The flake exposes a take-screenshots app that launches a binary inside an
Xvfb display backed by lavapipe (software Vulkan), waits, and captures one or
more PNG screenshots. Useful for smoke-testing rendering without a real GPU.
nix run .#take-screenshots -- EXE NUM DELAY_START PAUSE_INBETWEEN [OUTPUT_DIR]
EXE— path to the executable to launchNUM— number of screenshots to takeDELAY_START— seconds to wait after launch before the first shotPAUSE_INBETWEEN— seconds between consecutive shotsOUTPUT_DIR— where to writeshot-NNN.pngfiles (default: current directory)
Example, capturing three frames of the game one second apart after a six-second warm-up (Bevy + software Vulkan needs roughly that long to render its first frame):
cargo build
nix run .#take-screenshots -- ./target/debug/bglga 3 6 1 ./shots