From e8dbe717cd01cd8d6928eaa5b245da4bda0a57f8 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 16 Mar 2024 16:12:35 +0100 Subject: [PATCH] simple black window with Q key to exit --- src/main.rs | 51 ++++++++------------------------------------------- 1 file changed, 8 insertions(+), 43 deletions(-) diff --git a/src/main.rs b/src/main.rs index 565cf02..1230455 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,51 +2,16 @@ use bevy::prelude::*; fn main() { App::new() - .add_plugins((DefaultPlugins, HelloPlugin)) + .add_systems(Update, handle_input) + .add_plugins((DefaultPlugins, )) .run(); } -#[derive(Resource)] -struct GreetTimer(Timer); - -#[derive(Component)] -struct Name(String); - -#[derive(Component)] -struct Person; - -fn add_people(mut commands: Commands) { - commands.spawn((Person, Name("Elaina Proctor".to_string()))); - commands.spawn((Person, Name("Renzo Hume".to_string()))); - commands.spawn((Person, Name("Zayna Nieves".to_string()))); -} - -fn update_people(mut query: Query<&mut Name, With>) { - for mut name in &mut query { - if name.0 == "Elaina Proctor" { - name.0 = "Elaina Hume".to_string(); - break; - } - } -} - -fn greet_people(query: Query<&Name, With>, time:Res