Package model
Class PacMann
java.lang.Object
model.Actor
model.PacMann
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class model.Actor
Actor.DPair, Actor.Location
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
Return the current base speed of this actor, before factoring in the weight of the edge they are traversing.Default to the single-edge path that PacMann is currently traversing.void
reset()
Set PacMann's current location to the end of his "starting edge" returned by the `pacMannStartingEdge()` method in the `MazeGraph` class.void
Alert the model that PacMann has arrived at a vertex so it can update its state accordingly.Methods inherited from class model.Actor
currentEdge, edgeSpeed, getBoundingBoxUL, location, maxPropagationTime, nearestVertex, nextEdge, propagate, traverseEdge
-
Constructor Details
-
PacMann
Construct a PacMann character associated to the given `model`.
-
-
Method Details
-
visitVertex
Alert the model that PacMann has arrived at a vertex so it can update its state accordingly.- Specified by:
visitVertex
in classActor
-
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. -
guidancePath
Default to the single-edge path that PacMann is currently traversing.- Specified by:
guidancePath
in classActor
-
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.
-