Refactor organisation
This commit is contained in:
@@ -1,18 +1,20 @@
|
||||
use crate::{
|
||||
grid,
|
||||
snake::{SnakeHead, Z_HEIGHT},
|
||||
snake::{self, SnakeHead},
|
||||
tick::tick_triggered,
|
||||
};
|
||||
use bevy::prelude::*;
|
||||
use iyes_loopless::prelude::*;
|
||||
use rand::prelude::*;
|
||||
|
||||
const Z_HEIGHT: f32 = snake::Z_HEIGHT / 2.;
|
||||
|
||||
pub struct FruitPlugin;
|
||||
|
||||
impl Plugin for FruitPlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
app.add_event::<EatenEvent>()
|
||||
.add_startup_system(spawn_fruit_system)
|
||||
.add_startup_system(spawn_fruit_system.after(snake::SystemLabel::StartUp))
|
||||
.add_system(eat_fruit_system.run_if(tick_triggered))
|
||||
.add_system(debug_eaten_event_system)
|
||||
.add_system(despawn_fruit_system)
|
||||
|
||||
Reference in New Issue
Block a user