diff --git a/src/asteroids.rs b/src/asteroids.rs new file mode 100644 index 0000000..ca7e363 --- /dev/null +++ b/src/asteroids.rs @@ -0,0 +1,51 @@ +/// This is the module containing all the rock-related things +/// not... not the whole game. +use bevy::prelude::*; + +use crate::{GameAssets, Position, Rotation, Velocity}; + +#[derive(Component, Deref, DerefMut)] +struct Asteroid(AsteroidSize); + +enum AsteroidSize { + SMALL, + MEDIUM, + LARGE, +} + +#[derive(Resource)] +struct AsteroidSpawner { + timer: Timer, + // TODO: Configurables? + // - interval + // - density + // - size distribution +} + +/// Update the asteroid spawn timer and spawn any asteroids +/// that are due this frame. +fn tick_asteroid_manager( + mut commands: Commands, + mut spawner: ResMut, + game_assets: Res, + time: Res