Commit 0eb2ec9b authored by Rahix's avatar Rahix 🦀
Browse files

player: Adjust fixed spawn and movement speed

parent 414dc787
......@@ -4,7 +4,7 @@ use crate::components;
pub fn create_player(world: &mut legion::World) -> legion::Entity {
world.push((
components::Player,
components::Position::new(800.0, 800.0),
components::Position::new(600.0, 600.0),
components::Movable::new(),
colliders::Collider::new_circle_collider(50.0),
))
......
......@@ -90,13 +90,13 @@ impl gamestate::State for InGameState {
.get_mut(&mut self.world, player)
.unwrap();
match event {
gamestate::Event::KeyDown("w") => player_movable.velocity.y = -30.0,
gamestate::Event::KeyDown("w") => player_movable.velocity.y = -50.0,
gamestate::Event::KeyUp("w") => player_movable.velocity.y = 0.0,
gamestate::Event::KeyDown("a") => player_movable.velocity.x = -30.0,
gamestate::Event::KeyDown("a") => player_movable.velocity.x = -50.0,
gamestate::Event::KeyUp("a") => player_movable.velocity.x = 0.0,
gamestate::Event::KeyDown("s") => player_movable.velocity.y = 30.0,
gamestate::Event::KeyDown("s") => player_movable.velocity.y = 50.0,
gamestate::Event::KeyUp("s") => player_movable.velocity.y = 0.0,
gamestate::Event::KeyDown("d") => player_movable.velocity.x = 30.0,
gamestate::Event::KeyDown("d") => player_movable.velocity.x = 50.0,
gamestate::Event::KeyUp("d") => player_movable.velocity.x = 0.0,
_ => (),
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment