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>stateMachineFields inherited from class com.mygdx.game.Entitys.Ship
shipDirections -
Constructor Summary
Constructors Constructor Description NPCShip()Creates an initial state machine -
Method Summary
Modifier and Type Method Description voidBeginContact(CollisionInfo info)Called once a collision has being noticesvoidEndContact(CollisionInfo info)Called after the collision has being solvedvoidEnterTrigger(CollisionInfo info)if the agro fixture hit a ship set it as the targetvoidExitTrigger(CollisionInfo info)if a taget has left remove it from the potential targets QueuevoidfollowTarget()creates a new steering behaviour that will make the NPC beeline for the target doesn't factor in obstetricalvoidgoToTarget()is meant to path find to the target but didn't workvoidstopMovement()stops all movement and sets the behaviour to nullvoidupdate()updates the state machinevoidwander()Meant to cause the npc to wanderMethods inherited from class com.mygdx.game.Entitys.Ship
getAttackRange, getHealth, getPlunder, getPosition, isAlive, plunder, setFaction, setShipDirection, setShipDirection, shoot, shootMethods inherited from class com.mygdx.game.Entitys.Entity
addComponent, addComponents, cleanUp, getComponent, getComponent, getComponents, getName, raiseEvents, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
stateMachine
-
-
Constructor Details
-
NPCShip
public NPCShip()Creates an initial state machine
-
-
Method Details
-
update
public void update()updates the state machine -
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
Description copied from interface:CollisionCallBackCalled once a collision has being notices- Specified by:
BeginContactin interfaceCollisionCallBack- Overrides:
BeginContactin classShip
-
EndContact
Description copied from interface:CollisionCallBackCalled after the collision has being solved- Specified by:
EndContactin interfaceCollisionCallBack- Overrides:
EndContactin classShip
-
EnterTrigger
if the agro fixture hit a ship set it as the target- Specified by:
EnterTriggerin interfaceCollisionCallBack- Overrides:
EnterTriggerin classShip- Parameters:
info- the collision info
-
ExitTrigger
if a taget has left remove it from the potential targets Queue- Specified by:
ExitTriggerin interfaceCollisionCallBack- Overrides:
ExitTriggerin classShip- Parameters:
info- collision info
-