diff --git a/hello-world/src/main.rs b/hello-world/src/main.rs index 0bbc21e..3fe511b 100644 --- a/hello-world/src/main.rs +++ b/hello-world/src/main.rs @@ -1,7 +1,6 @@ use bevy::prelude::*; mod orbit_cam; -mod people; mod test_scene; use orbit_cam::{OrbitCam, OrbitCamPlugin}; @@ -12,21 +11,11 @@ fn main() { console_error_panic_hook::set_once(); App::new() - .add_plugins(( - DefaultPlugins, - people::Plugin, - OrbitCamPlugin, - TestScenePlugin, - )) - .add_systems(Startup, hello_world) + .add_plugins((DefaultPlugins, OrbitCamPlugin, TestScenePlugin)) .add_systems(Update, draw_world_axes.after(orbit_cam::pan_orbit_camera)) .run(); } -fn hello_world() { - info!("Hello, world!"); -} - fn draw_world_axes(mut gizmos: Gizmos, q: Query<&OrbitCam>) { let &OrbitCam { focus, radius, .. } = q.single(); diff --git a/hello-world/src/people.rs b/hello-world/src/people.rs deleted file mode 100644 index 7af7036..0000000 --- a/hello-world/src/people.rs +++ /dev/null @@ -1,56 +0,0 @@ -use std::time::Duration; - -use bevy::{ - prelude::{ - info, App, Commands, Component, Query, Res, ResMut, Resource, Startup, Update, With, - }, - time::{Time, TimerMode}, -}; - -pub struct Plugin; - -impl bevy::app::Plugin for Plugin { - fn build(&self, app: &mut App) { - app.insert_resource(Timer(bevy::time::Timer::from_seconds( - 2.0, - TimerMode::Repeating, - ))) - .add_systems(Startup, startup) - .add_systems(Update, greet); - } -} - -#[derive(Component)] -struct Person; - -#[derive(Component)] -struct Name(String); - -impl Name { - fn new>(name: S) -> Self { - Self(name.into()) - } -} - -#[derive(Resource)] -struct Timer(bevy::time::Timer); - -impl Timer { - fn tick(&mut self, delta: Duration) -> &bevy::time::Timer { - self.0.tick(delta) - } -} - -fn startup(mut cmds: Commands) { - cmds.spawn((Person, Name::new("Elaina Proctor"))); - cmds.spawn((Person, Name::new("Renzo Hume"))); - cmds.spawn((Person, Name::new("Zayna Nieves"))); -} - -fn greet(time: Res