No description
Find a file
Harald Hoyer 80b8e665f7 chore: enable bevy/debug and bevy/track_location by default via dev feature
Cargo features cannot be scoped to a build profile, so add a `dev` feature
that pulls in `bevy/debug` and `bevy/track_location` and make it a default
feature. This surfaces real type names and source locations in ECS panics
(e.g. B0001 query conflicts) for normal `cargo build` / `cargo run` /
`cargo test`, at the cost of a small overhead. Shipping builds opt out
with `--release --no-default-features`.

Removes the now-redundant `[dev-dependencies] bevy = { features = ["debug"] }`
override, since the default feature already covers test builds.
2026-05-13 12:04:00 +02:00
.roo iii 2025-04-11 10:43:48 +02:00
.vscode feat: add cratedocs server configuration to mcp.json 2025-04-15 12:05:18 +02:00
src fix(enemy): make entering_query and path_query disjoint to avoid B0001 panic 2026-05-13 11:59:04 +02:00
tests chore: apply cargo fmt formatting 2026-05-07 23:31:30 +02:00
TODO Merge branch 'opencode/happy-rocket' 2026-05-09 14:07:28 +02:00
.envrc feat: initial commit 2025-03-29 10:58:19 +01:00
.gitignore chore: .gitignore 2026-05-07 14:57:22 +02:00
.mcp.json add .mcp.json 2026-05-06 21:09:21 +02:00
AGENTS.md docs: add line for testing 2026-05-07 14:53:17 +02:00
Cargo.lock feat(persistence): add high score saving/loading 2026-05-07 23:30:59 +02:00
Cargo.toml chore: enable bevy/debug and bevy/track_location by default via dev feature 2026-05-13 12:04:00 +02:00
CLAUDE.md chore: add CLAUDE.md 2026-05-13 11:32:57 +02:00
flake.lock refactor: replace nixify with flake-utils and rust-overlay in flake.nix 2026-05-04 22:15:27 +02:00
flake.nix fix(flake): guard linux-only deps behind stdenv.isLinux 2026-05-13 11:31:56 +02:00
opencode.json chore: fix mcp 2026-05-13 11:55:53 +02:00
README.md chore: enable bevy/debug and bevy/track_location by default via dev feature 2026-05-13 12:04:00 +02:00

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 cargo build

The dev cargo feature is enabled by default and turns on bevy/debug and bevy/track_location so ECS panics (e.g. B0001 query conflicts) report real type names and source locations. For a shipping release build, disable it:

nix develop --command cargo build --release --no-default-features

How to Test

nix develop --command cargo test 

How to Run

  1. Make sure you have Rust and Nix installed.
  2. Clone the repository.
  3. Navigate to the project directory.
  4. Run the game using the command: nix develop --command 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 launch
  • NUM — number of screenshots to take
  • DELAY_START — seconds to wait after launch before the first shot
  • PAUSE_INBETWEEN — seconds between consecutive shots
  • OUTPUT_DIR — where to write shot-NNN.png files (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):

nix develop --command cargo build
nix run .#take-screenshots -- ./target/debug/bglga 3 6 1 ./shots