pacman.game.internal.PacMan Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pacman-main Show documentation
Show all versions of pacman-main Show documentation
The main code for Ms. Pac-Man Vs Ghosts
package pacman.game.internal;
import pacman.game.Constants.MOVE;
/*
* Data structure to hold all information pertaining to Ms Pac-Man.
*/
public final class PacMan {
public int currentNodeIndex, numberOfLivesRemaining;
public MOVE lastMoveMade;
public boolean hasReceivedExtraLife;
public PacMan(int currentNodeIndex, MOVE lastMoveMade, int numberOfLivesRemaining, boolean hasReceivedExtraLife) {
this.currentNodeIndex = currentNodeIndex;
this.lastMoveMade = lastMoveMade;
this.numberOfLivesRemaining = numberOfLivesRemaining;
this.hasReceivedExtraLife = hasReceivedExtraLife;
}
public PacMan copy() {
return new PacMan(currentNodeIndex, lastMoveMade, numberOfLivesRemaining, hasReceivedExtraLife);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy