Class PassiveNPC

All Implemented Interfaces:
Killer, Cloneable, Iterable<String>, Serializable
Direct Known Subclasses:
SilentNPC, SpeakerNPC

public abstract class PassiveNPC extends NPC
  • Constructor Details

    • PassiveNPC

      public PassiveNPC()
  • Method Details

    • createPath

      protected void createPath()
      Create path for the NPC. Sub classes can implement this method.
    • reversePath

      public void reversePath()
      Changed the entity's path to walk in the opposite direction
    • reroute

      public void reroute()
      Plan a new path to the old destination.
      Overrides:
      reroute in class GuidedEntity
    • onMoved

      protected void onMoved(int oldX, int oldY, int newX, int newY)
      Description copied from class: ActiveEntity
      Notification of intra-zone position change.
      Overrides:
      onMoved in class GuidedEntity
      Parameters:
      oldX - The old X coordinate.
      oldY - The old Y coordinate.
      newX - The new X coordinate.
      newY - The new Y coordinate.
    • handleObjectCollision

      protected void handleObjectCollision()
      Overrides:
      handleObjectCollision in class GuidedEntity
    • handleSimpleCollision

      protected void handleSimpleCollision(int nx, int ny)
      Description copied from class: ActiveEntity
      a simple collision is from tiled collision layer or the edge of the map.
      Overrides:
      handleSimpleCollision in class ActiveEntity
    • setTeleportsFlag

      public void setTeleportsFlag(boolean teleports)
    • isTeleporter

      public boolean isTeleporter()