Player modifs
This commit is contained in:
+2
-2
@@ -10,7 +10,7 @@ pub struct Player;
|
|||||||
|
|
||||||
// Speed of the player
|
// Speed of the player
|
||||||
#[derive(Component)]
|
#[derive(Component)]
|
||||||
struct Velocity(Vec2);
|
pub struct Velocity(Vec2);
|
||||||
|
|
||||||
// Spawn entity player
|
// Spawn entity player
|
||||||
fn spawn_player(mut commands: Commands) {
|
fn spawn_player(mut commands: Commands) {
|
||||||
@@ -23,7 +23,7 @@ fn spawn_player(mut commands: Commands) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Input + movement system for the player
|
// Input + movement system for the player
|
||||||
fn move_player(
|
pub(crate) fn move_player(
|
||||||
input: Res<ButtonInput<KeyCode>>,
|
input: Res<ButtonInput<KeyCode>>,
|
||||||
time: Res<Time>,
|
time: Res<Time>,
|
||||||
mut player: Query<(&mut Velocity, &mut Transform), With<Player>>,
|
mut player: Query<(&mut Velocity, &mut Transform), With<Player>>,
|
||||||
|
|||||||
Reference in New Issue
Block a user