Class ChaseAmbush
java.lang.Object
edu.uoc.pacman.model.entities.characters.ghosts.chase.ChaseAmbush
- All Implemented Interfaces:
ChaseBehaviour
It implements the
Its target position is four steps ahead of Pacman's position in the direction Pacman is facing.
ChaseBehaviour
interface according to an ambush behaviour.Its target position is four steps ahead of Pacman's position in the direction Pacman is facing.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
The amount of tiles/cells/positions/steps that must be added to the Pacman's position. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetChasePosition
(Ghost ghost) The ghost will chase the position which isTILES_OFFSET
steps/tiles/cells/positions ahead of Pacman's position in the direction Pacman is facing.
-
Field Details
-
TILES_OFFSET
private static final int TILES_OFFSETThe amount of tiles/cells/positions/steps that must be added to the Pacman's position.- See Also:
-
-
Constructor Details
-
ChaseAmbush
public ChaseAmbush()
-
-
Method Details
-
getChasePosition
The ghost will chase the position which isTILES_OFFSET
steps/tiles/cells/positions ahead of Pacman's position in the direction Pacman is facing.- Specified by:
getChasePosition
in interfaceChaseBehaviour
- Parameters:
ghost
- Ghost object that chases.- Returns:
- Position where the ghost must go, i.e. the position which is
TILES_OFFSET
steps ahead of Pacman’s position in the direction Pacman is facing. - Since:
- getChasePosition in interface
ChaseBehaviour
.
-