Browse Source

Merge branch 'main' of https://gitlab.cs.hs-fulda.de/fdai7012/pacmayham

remotes/origin/menu
fdai7012 1 year ago
committed by Julian Wenzel
parent
commit
5daadeaa06
  1. 21
      src/main/java/pacmanGame/Player.java

21
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);
}
}
}
Loading…
Cancel
Save