java.lang.Object
edu.uoc.pacman.model.entities.characters.ghosts.chase.ChaseAmbush
All Implemented Interfaces:
ChaseBehaviour

public class ChaseAmbush extends Object implements ChaseBehaviour
It implements the 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

    Fields
    Modifier and Type
    Field
    Description
    private static final int
    The amount of tiles/cells/positions/steps that must be added to the Pacman's position.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    The ghost will chase the position which is TILES_OFFSET steps/tiles/cells/positions ahead of Pacman's position in the direction Pacman is facing.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • TILES_OFFSET

      private static final int TILES_OFFSET
      The 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

      public Position getChasePosition(Ghost ghost)
      The ghost will chase the position which is TILES_OFFSET steps/tiles/cells/positions ahead of Pacman's position in the direction Pacman is facing.
      Specified by:
      getChasePosition in interface ChaseBehaviour
      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.