Move SpawnAsteroid event into events.rs
This commit is contained in:
@@ -8,8 +8,7 @@ use std::time::Duration;
|
||||
use bevy::prelude::*;
|
||||
|
||||
use crate::{
|
||||
GameAssets, Lifetime, WorldSize, config::ASTEROID_LIFETIME, events::AsteroidDestroy,
|
||||
physics::Velocity,
|
||||
config::ASTEROID_LIFETIME, events::{AsteroidDestroy, SpawnAsteroid}, physics::Velocity, GameAssets, Lifetime, WorldSize
|
||||
};
|
||||
|
||||
#[derive(Component, Deref, DerefMut)]
|
||||
@@ -51,13 +50,6 @@ impl AsteroidSpawner {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Event)]
|
||||
pub struct SpawnAsteroid {
|
||||
pos: Vec2,
|
||||
vel: Vec2,
|
||||
size: AsteroidSize,
|
||||
}
|
||||
|
||||
/// Update the asteroid spawn timer and spawn any asteroids
|
||||
/// that are due this frame.
|
||||
pub fn tick_asteroid_manager(
|
||||
|
||||
Reference in New Issue
Block a user