Skip to content

Commit

Permalink
add: WASD movement added
Browse files Browse the repository at this point in the history
  • Loading branch information
PrethamMuthappa authored Apr 10, 2024
1 parent 865e2da commit 7ecc87b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ public void initInput() {
onKey(KeyCode.RIGHT, () -> player.getComponent(PlayerComponent.class).moveRight());

onKeyDown(KeyCode.SPACE,() -> player.getComponent(PlayerComponent.class).shoot());

onKey(KeyCode.W, () -> player.getComponent(PlayerComponent.class).moveUp());
onKey(KeyCode.S, () -> player.getComponent(PlayerComponent.class).moveDown());
onKey(KeyCode.A, () -> player.getComponent(PlayerComponent.class).moveLeft());
onKey(KeyCode.D, () -> player.getComponent(PlayerComponent.class).moveRight());

}
/**
* Summary :
Expand Down

0 comments on commit 7ecc87b

Please sign in to comment.