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).
This commit is contained in:
Harald Hoyer 2026-05-06 15:05:32 +02:00
parent c9188f58f6
commit 9d80626cc6
7 changed files with 72 additions and 6 deletions

View file

@ -39,3 +39,11 @@ pub const TRACTOR_BEAM_WIDTH: f32 = 20.0;
pub const TRACTOR_BEAM_DURATION: f32 = 3.0;
pub const TRACTOR_BEAM_COLOR: Color = Color::rgba(0.5, 0.0, 0.8, 0.6);
pub const CAPTURE_DURATION: f32 = 10.0; // How long the player stays captured
// Starfield constants
pub const STAR_COUNT: usize = 150;
pub const STAR_MIN_SIZE: f32 = 1.0;
pub const STAR_MAX_SIZE: f32 = 3.0;
pub const STAR_MIN_SPEED: f32 = 20.0;
pub const STAR_MAX_SPEED: f32 = 100.0;
pub const STAR_Z_DEPTH: f32 = -10.0; // Behind all game entities