Browse Source

added the Ghost GG in the Field

remotes/origin/ghostsbehaviour
fdai2751 11 months ago
parent
commit
6615bb9b1c
  1. 4
      src/main/java/pacmanGame/VisualizerPlainText.java

4
src/main/java/pacmanGame/VisualizerPlainText.java

@ -54,6 +54,7 @@ public class VisualizerPlainText implements Visualizer {
boolean containsGhosts4 = false; boolean containsGhosts4 = false;
boolean containsGhosts5 = false; boolean containsGhosts5 = false;
boolean containsGhosts6 = false; boolean containsGhosts6 = false;
boolean containsGhosts7 = false;
boolean containsPlayer = false; boolean containsPlayer = false;
for( int i = 0; i < gameManager.ghosts.length; i++) { for( int i = 0; i < gameManager.ghosts.length; i++) {
if(gameManager.ghosts[i].position.equals(cell.pos)) { if(gameManager.ghosts[i].position.equals(cell.pos)) {
@ -88,6 +89,9 @@ public class VisualizerPlainText implements Visualizer {
else if (containsGhosts6) { else if (containsGhosts6) {
output += ghostSprite6; output += ghostSprite6;
} }
else if (containsGhosts7) {
output += ghostSprite7;
}
else if (sprites.containsKey(cell.type)) { else if (sprites.containsKey(cell.type)) {
output += sprites.get(cell.type); output += sprites.get(cell.type);

Loading…
Cancel
Save