diff --git a/src/main/java/pacmanGame/Player.java b/src/main/java/pacmanGame/Player.java index 9e7ca7d..ae012b9 100644 --- a/src/main/java/pacmanGame/Player.java +++ b/src/main/java/pacmanGame/Player.java @@ -18,4 +18,25 @@ public class Player { position = newPosition; } } + + public void processInput(char inputchar) { + + if(inputchar == 'w') { + direction = new Vector2(0,1); + } + + else if(inputchar == 's') { + direction = new Vector2(0,-1); + } + + else if(inputchar == 'd') { + direction = new Vector2(1,0); + } + + else if(inputchar == 'a') { + direction = new Vector2(-1,0); + } + + } + }