Package com.mygdx.game.Entitys
Class NPCShip
- java.lang.Object
-
- com.mygdx.game.Entitys.Entity
-
- com.mygdx.game.Entitys.Ship
-
- com.mygdx.game.Entitys.NPCShip
-
- All Implemented Interfaces:
CollisionCallBack
public class NPCShip extends Ship implements CollisionCallBack
NPC ship entity class.
-
-
Field Summary
Fields Modifier and Type Field Description com.badlogic.gdx.ai.fsm.StateMachine<NPCShip,EnemyState>
stateMachine
-
Fields inherited from class com.mygdx.game.Entitys.Ship
shipDirections
-
-
Constructor Summary
Constructors Constructor Description NPCShip()
Creates an initial state machine
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
BeginContact(CollisionInfo info)
Called once a collision has been noticedvoid
EndContact(CollisionInfo info)
Called after the collision has been solvedvoid
EnterTrigger(CollisionInfo info)
If the agro fixture hits a ship, set it as the targetvoid
ExitTrigger(CollisionInfo info)
If a target has left, remove it from the potential targets Queuevoid
followTarget()
creates a new steering behaviour that will make the NPC beeline for the target doesn't factor in obstetricalvoid
stopMovement()
stops all movement and sets the behaviour to nullvoid
update()
updates the state machinevoid
wander()
Meant to cause the npc to wander-
Methods inherited from class com.mygdx.game.Entitys.Ship
getAttackRange, getFaction, getHealth, getPlunder, getPosition, isAlive, plunder, setFaction, setPosition, setShipDirection, setShipDirection, shoot, shoot
-
Methods inherited from class com.mygdx.game.Entitys.Entity
addComponent, addComponents, cleanUp, getComponent, getComponent, getName, raiseEvents, setName
-
-
-
-
Field Detail
-
stateMachine
public com.badlogic.gdx.ai.fsm.StateMachine<NPCShip,EnemyState> stateMachine
-
-
Method Detail
-
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 been noticed- Specified by:
BeginContact
in interfaceCollisionCallBack
- Overrides:
BeginContact
in classShip
-
EndContact
public void EndContact(CollisionInfo info)
Description copied from interface:CollisionCallBack
Called after the collision has been solved- Specified by:
EndContact
in interfaceCollisionCallBack
- Overrides:
EndContact
in classShip
-
EnterTrigger
public void EnterTrigger(CollisionInfo info)
If the agro fixture hits a ship, set it as the target- Specified by:
EnterTrigger
in interfaceCollisionCallBack
- Overrides:
EnterTrigger
in classShip
- Parameters:
info
- the collision info
-
ExitTrigger
public void ExitTrigger(CollisionInfo info)
If a target has left, remove it from the potential targets Queue- Specified by:
ExitTrigger
in interfaceCollisionCallBack
- Overrides:
ExitTrigger
in classShip
- Parameters:
info
- collision info
-
-