Initial commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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)]
|
||||
struct Player;
|
||||
|
||||
// Speed of the player
|
||||
#[derive(Component)]
|
||||
struct Velocity(Vec2);
|
||||
|
||||
// Spawn player
|
||||
fn spawn_player(mut command: Commands) {
|
||||
command.spawn((
|
||||
Player,
|
||||
Velocity(Vec2::ZERO),
|
||||
Sprite::from_color(Color::srgb(128.0, 0.0, 128.0), Vec2::new(20.0, 40.0)),
|
||||
));
|
||||
}
|
||||
Reference in New Issue
Block a user