Class NPCShip

java.lang.Object
All Implemented Interfaces:
CollisionCallBack

public class NPCShip
extends Ship
implements CollisionCallBack
NPC ship entity class.
  • Field Details

    • stateMachine

      public com.badlogic.gdx.ai.fsm.StateMachine<NPCShip,​EnemyState> stateMachine
  • Constructor Details

    • NPCShip

      public NPCShip()
      Creates an initial state machine
  • Method Details

    • update

      public void update()
      updates the state machine
      Overrides:
      update in class Entity
    • goToTarget

      public void goToTarget()
      is meant to path find to the target but didn't work
    • followTarget

      public void followTarget()
      creates a new steering behaviour that will make the NPC beeline for the target doesn't factor in obstetrical
    • stopMovement

      public void stopMovement()
      stops all movement and sets the behaviour to null
    • wander

      public void wander()
      Meant to cause the npc to wander
    • BeginContact

      public void BeginContact​(CollisionInfo info)
      Description copied from interface: CollisionCallBack
      Called once a collision has being notices
      Specified by:
      BeginContact in interface CollisionCallBack
      Overrides:
      BeginContact in class Ship
    • EndContact

      public void EndContact​(CollisionInfo info)
      Description copied from interface: CollisionCallBack
      Called after the collision has being solved
      Specified by:
      EndContact in interface CollisionCallBack
      Overrides:
      EndContact in class Ship
    • EnterTrigger

      public void EnterTrigger​(CollisionInfo info)
      if the agro fixture hit a ship set it as the target
      Specified by:
      EnterTrigger in interface CollisionCallBack
      Overrides:
      EnterTrigger in class Ship
      Parameters:
      info - the collision info
    • ExitTrigger

      public void ExitTrigger​(CollisionInfo info)
      if a taget has left remove it from the potential targets Queue
      Specified by:
      ExitTrigger in interface CollisionCallBack
      Overrides:
      ExitTrigger in class Ship
      Parameters:
      info - collision info