Commit graph

27 commits

Author SHA1 Message Date
68e3051f77 refactor: split game logic into library + binary entry point
Move the App setup and module declarations from src/main.rs into a new
src/lib.rs that exposes a single pub fn run(). src/main.rs becomes a
three-line entry point that calls bglga::run(). This is the standard
Bevy-book pattern and lets the game logic be consumed as a library
(e.g. for integration tests, headless tooling, or alternate entry
points) without duplicating the App wiring.

Also gate update_tractor_beam_visual with
run_if(any_with_component::<TractorBeam>) so the system only runs while
a boss has an active tractor beam, instead of every Update tick.
2026-05-06 20:54:09 +02:00
506a775b0c fix: disjoint Transform queries in update_tractor_beam_visual
Add Without<TractorBeamSprite> filter to boss_query so Bevy's parallel
access checker can prove the &Transform read on bosses and the
&mut Transform write on beam-sprite children target disjoint entity
sets. Without it, the system panicked on first run with a B0001
"conflicts with a previous system parameter" error.
2026-05-06 20:54:02 +02:00
35300ec62b Merge branch 'gal-44-add-explosion-effects' 2026-05-06 20:33:23 +02:00
52b0919d3f feat: improve tractor beam visual with 2-layer glow and pulse animation
Replace the single static rectangle with a 2-layer beam (outer glow +
inner core) and sinusoidal opacity pulse. Add per-frame beam height
tracking to follow boss position. Include 8 unit tests for pure math
functions (beam height calculation, pulse alpha).

Refs: GAL-33
2026-05-06 19:35:16 +02:00
2ff561efb1 feat: add explosion animations on entity destruction
Spawn expanding/fading orange explosion effects when enemies or
the player are destroyed. Explosions scale from 15x15 to 50x50
over 0.4s while fading from full opacity to transparent, then
auto-despawn.

Integration points:
- Enemy killed by player bullet (bullet.rs)
- Player hit by enemy bullet (bullet.rs)
- Player collides with enemy (player.rs) - both explode
- Captured player released (player.rs)

Refs: GAL-44
2026-05-06 16:43:16 +02:00
9d80626cc6 feat: add scrolling starfield background
Add 150 stars with randomized positions, sizes, speeds, and brightness.
Stars scroll downward with parallax depth effect and wrap around at
screen edges. Also fixes Bevy 0.13 API issues in game_state.rs
(KeyCode::R → KeyR, Input → ButtonInput).
2026-05-06 15:05:32 +02:00
3c226b3f78 feat: add restart from game over with R key 2026-05-04 22:15:16 +02:00
e484c09f14 chore: remove unused RestartRestarted component 2026-05-04 22:15:12 +02:00
704a4476f0 fix: remove orphaned duplicate code in cleanup_game_entities 2026-05-04 22:14:58 +02:00
28e4e53da9 feat: add start menu with interactive button
- Add StartMenu as the default game state
- Create StartMenuUI and StartButton components
- Implement menu UI with BGLGA title and Start Game button
- Add button interaction system with hover effects
- Set up proper state transitions from menu to game
- Update TODO.md to mark task as completed

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-27 09:31:03 +02:00
efef8df102 feat: Implement boss tractor beam and player capture
This commit introduces a new mechanic where boss enemies can use a tractor beam to capture the player.

Key changes:
- Bosses can now fire a tractor beam that targets the player.
- If the player is caught in the beam for a certain duration, they are "captured".
- Captured players are carried by the boss as it returns to its formation.
- If the boss is destroyed while carrying a player, the player is freed.
- If the player is captured, they lose a life and respawn.
- Refactored player and enemy systems to handle the new capture logic and states.
- Added GEMINI.md and CLAUDE.md to track assistant configurations.
2025-06-26 09:46:49 +02:00
d27d27bb5a refactor: clean up formatting and improve readability in components and player logic 2025-04-16 08:46:12 +02:00
008f9cc24a feat: add Captured and TractorBeam components, enhance enemy behavior with capture mechanics 2025-04-16 08:41:17 +02:00
9aad8dd130 refactor: improve code formatting and readability in components and resources 2025-04-15 12:28:17 +02:00
4a64e12945 refactor: remove unused imports from multiple files
- Removed `std::time::Duration` import from `components.rs`, `resources.rs`, and `enemy.rs` as it was unnecessary.
- Cleaned up imports in `systems.rs` by removing `FormationState`.
2025-04-15 12:26:01 +02:00
c525b376b0 enemy formations
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2025-04-11 10:51:05 +02:00
0b8527b955 split files
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2025-04-11 10:44:23 +02:00
3dbfb9dac1 iii
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2025-04-11 10:43:48 +02:00
ef055fe3c5 feat: Add enemy type differentiation and adjust movement logic for Grunt and Boss enemies 2025-04-05 19:21:09 +02:00
6acfee2f95 feat: Enhance enemy attack dive mechanics with swooping movement towards the center 2025-04-05 12:53:14 +02:00
45482f9e11 refactor: Optimize attack dive timer logic and enemy movement checks 2025-04-05 12:48:58 +02:00
66fd1e8b1b feat: Implement enemy attack dive mechanics and shooting behavior 2025-04-05 12:42:16 +02:00
4256b0046c feat: Implement enemy formation behavior and attack dive mechanics 2025-04-05 00:26:22 +02:00
fe5579727f feat: Implement scoring and stage management systems 2025-04-05 00:21:44 +02:00
0f4737fffd feat: Implement Game Over state and UI cleanup 2025-04-05 00:13:56 +02:00
557b38af79 feat: Implement player lives, destruction, and respawn
Adds a player lives system with respawning and temporary invincibility.

- Introduces  resource (starts at 3).
- Modifies player-enemy collision to decrement lives and despawn player.
- Implements  for delayed respawn.
- Adds  component with a timer for post-respawn protection, including a blinking visual effect.
- Updates window title dynamically to show remaining lives.

Reverted collision detection from  (due to build errors)
back to using .

Fixed several borrow checker (E0499, E0596) and type mismatch (E0308)
errors encountered during implementation, primarily within the
 system.

Added  conditions for systems like shooting, collision checking,
and respawning.

Updates README.md to reflect the current state and completed TODO item.
2025-03-29 13:45:43 +01:00
0a5382187e feat: initial commit
Signed-off-by: Harald Hoyer <harald@hoyer.xyz>
2025-03-29 10:58:19 +01:00