Package model

Class PacMann


public abstract class PacMann extends Actor
The yellow protagonist of the game who seeks to eat the dots in the board maze while evading capture by the ghosts. Subclasses are responsible to PacMann's navigation, whether this is from user inputs or an AI.
  • Constructor Details

    • PacMann

      public PacMann(GameModel model)
      Construct a PacMann character associated to the given `model`.
  • Method Details

    • visitVertex

      public void visitVertex(MazeGraph.MazeVertex v)
      Alert the model that PacMann has arrived at a vertex so it can update its state accordingly.
      Specified by:
      visitVertex in class Actor
    • reset

      public void reset()
      Set PacMann's current location to the end of his "starting edge" returned by the `pacMannStartingEdge()` method in the `MazeGraph` class.
      Specified by:
      reset in class Actor
    • guidancePath

      public List<MazeGraph.MazeEdge> guidancePath()
      Default to the single-edge path that PacMann is currently traversing.
      Specified by:
      guidancePath in class Actor
    • baseSpeed

      public double baseSpeed()
      Description copied from class: Actor
      Return the current base speed of this actor, before factoring in the weight of the edge they are traversing.
      Specified by:
      baseSpeed in class Actor