use bevy::prelude::*; const FALL_SPEED: f32 = 300.0; // Falling speed const DIVE_SPEED: f32 = 700.0; // Falling speed sped up const HORIZONTAL_SPEED: f32 = 300.0; // Lateral movement speed // The player #[derive(Component)] pub struct Player; // Speed of the player #[derive(Component)] pub struct Velocity(Vec2); // Spawn entity player fn spawn_player(mut commands: Commands) { commands.spawn(( Player, Velocity(Vec2::ZERO), Sprite::from_color(Color::srgb(1.0, 1.0, 1.0), Vec2::new(20.0, 40.0)), Transform::from_xyz(0.0, 0.0, 1.0), )); } // Input + movement system for the player pub(crate) fn move_player( input: Res>, time: Res