use bevy::{ prelude::*, }; #[derive(Component,Debug)] struct Pos(Vec2); #[derive(Component,Debug)] struct Ray(Vec2); #[derive(Component,Debug)] struct Col(Color); #[derive(Component,Debug)] struct Size(f32); fn main() { App::new() .add_plugins(DefaultPlugins) .add_systems(Startup, setup) .add_systems(Update, (animate, rand_color, gizmos)) .run() } fn setup( mut commands: Commands, ) { commands.spawn(Camera2dBundle { transform: Transform::from_xyz(250.0, 0.0, 0.0), ..default() }); commands.spawn(( Pos(Vec2::new(0.0, 0.0)), Ray(Vec2::new(100.0, 5.0)), Col(Color::rgba(1.0, 0.0, 1.0, 1.0)), Size(10.0) )); commands.spawn(( Pos(Vec2::new(0.0, 0.0)), Ray(Vec2::new(200.0, 1.0)), Col(Color::rgba(1.0, 1.0, 0.0, 1.0)), Size(20.0) )); } fn animate( time: Res