// Diese Klasse stellt die einzelnen Geister dar. public class Ghost extends Picture { // Die übergeordnete Klasse ist Picture private static final long serialVersionUID = -5352006665147359473L; private int xPos; private int yPos; private int HCost; private int GCost; private int FCost; public Ghost(int index) { super("Pinky"); // Aufrufen der übergeordneten Klasse // xPos = 150 + 40 * index; if (index == 0) { this.changeSauce("Blinky"); } else if (index == 2) { this.changeSauce("Inky"); } else if (index == 3) { this.changeSauce("Clyde"); } } public int getPos(char coordinate, long dt) { if (coordinate == 'x') { return xPos; } else if (coordinate == 'y') { return yPos; } else return -1; } public void setPos(char coordinate, int newPos) { if (coordinate == 'x') { xPos = newPos; } else if (coordinate == 'y') { yPos = newPos; } } public void moveUp() { } public void moveDown() { } public void moveRight() { } public void moveLeft() { } public int getHCost() { return HCost; } }