Update to Bevy 0.9

This commit is contained in:
2022-11-28 22:16:05 +01:00
parent e70ec51673
commit 0e5114c3d9
8 changed files with 643 additions and 498 deletions

View File

@@ -14,7 +14,7 @@ pub struct FruitPlugin;
impl Plugin for FruitPlugin {
fn build(&self, app: &mut App) {
app.add_event::<EatenEvent>()
.add_startup_system(spawn_fruit_system.after(snake::SystemLabel::StartUp))
.add_startup_system(spawn_fruit_system)
.add_system(eat_fruit_system.run_if(tick_triggered))
.add_system(debug_eaten_event_system)
.add_system(despawn_fruit_system)
@@ -53,7 +53,7 @@ fn spawn_fruit_system(mut commands: Commands, coordinate_query: Query<&grid::Coo
.expect("Should always be found.");
commands
.spawn_bundle(SpriteBundle {
.spawn(SpriteBundle {
sprite: Sprite {
color: Color::GREEN,
custom_size: Some(Vec2::splat(grid::SEGMENT_SIZE) * 0.6),