diff --git a/src/main/java/pacmanGame/Cell.java b/src/main/java/pacmanGame/Cell.java index 8c427b0..6e2ed06 100644 --- a/src/main/java/pacmanGame/Cell.java +++ b/src/main/java/pacmanGame/Cell.java @@ -35,6 +35,11 @@ public class Cell { map.gameManager.score += 405; } + public void triggerOrange() { + this.type = "empty"; + map.gameManager.score += 305; + } + public void triggerItem() { if(type.equals("dot")) { triggerDot(); @@ -48,6 +53,9 @@ public class Cell { else if(type.equals("strawberry")) { triggerStrawberry(); } + else if(type.equals("orange")) { + triggerStrawberry(); + } else { //System.out.println("cell contains no item!"); } diff --git a/src/main/java/pacmanGame/GameManager.java b/src/main/java/pacmanGame/GameManager.java index c79f8e6..af69fb1 100644 --- a/src/main/java/pacmanGame/GameManager.java +++ b/src/main/java/pacmanGame/GameManager.java @@ -52,7 +52,7 @@ public class GameManager { } public String randomFruit() { - String fruitTypes[] = {"cherry","strawberry"}; + String fruitTypes[] = {"cherry","strawberry","orange"}; int randomNumber = (int) (Math. random() * (fruitTypes.length)); return fruitTypes[randomNumber]; } diff --git a/src/main/java/pacmanGame/VisualizerPlainText.java b/src/main/java/pacmanGame/VisualizerPlainText.java index e5f315a..283d761 100644 --- a/src/main/java/pacmanGame/VisualizerPlainText.java +++ b/src/main/java/pacmanGame/VisualizerPlainText.java @@ -14,6 +14,7 @@ public class VisualizerPlainText implements Visualizer { this.put("wall", "[]"); this.put("cherry", "OO"); this.put("strawberry", "T7"); + this.put("orange", "CO"); }}; public final String ghostSprite = "AA";