Browse Source

added triggerItem function to cell

remotes/origin/menu
fdai7910 11 months ago
parent
commit
d1ccd84e74
  1. 28
      src/main/java/pacmanGame/Cell.java

28
src/main/java/pacmanGame/Cell.java

@ -8,4 +8,32 @@ public class Cell {
this.pos = pos; this.pos = pos;
this.type = type; this.type = type;
} }
public void triggerDot() {
//todo: code
}
public void triggerPill() {
//todo: code
}
public void triggerFruit() {
//todo: code
}
public void triggerItem() {
if(type.equals("dot")) {
triggerDot();
}
else if(type.equals("pill")) {
triggerPill();
}
else if(type.equals("cherry")) {
triggerFruit();
}
else {
System.out.println("cell contains no item!");
}
}
} }
Loading…
Cancel
Save