Add basic loading state
All checks were successful
CI / Formatting (push) Successful in 1m6s

This commit is contained in:
Michael Bradley 2025-05-24 18:44:04 -04:00
parent 85ca3af12d
commit f0d690a9f8
Signed by: MichaelBradley
SSH key fingerprint: SHA256:o/aaeYtRubILK7OYYjYP12DmU7BsPUhKji1AgaQ+ge4
2 changed files with 24 additions and 7 deletions

View file

@ -11,6 +11,8 @@ use bevy::{
use rand::{Rng as _, SeedableRng};
use wyrand::WyRand;
use crate::AppState;
use super::{
objects::{Ball, Player, Radius, Wall},
rng::thread_rng,
@ -21,6 +23,12 @@ const BALL_COUNT: u8 = 32;
const BALL_SIZES: Range<f32> = 10.0..25.0;
const DIMENSION_SIZES: Range<f32> = 500.0..2000.0;
pub fn check_for_seed(seed: Option<Res<Seed>>, mut next_state: ResMut<NextState<AppState>>) {
if seed.is_some() {
next_state.set(AppState::InGame);
}
}
/// The size of the playable area (x, y)
#[derive(Resource)]
pub struct PlayableArea(f32, f32);