bglga/README.md

61 lines
1.9 KiB
Markdown

# 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
```
## 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
```