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 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 workvoidShipDeath()NEW Called when the ship diesvoidstopMovement()stops all movement and sets the behaviour to nullvoidupdate()updates the state machinevoidwander()Meant to cause the npc to wander-
Methods inherited from class com.mygdx.game.Entitys.Ship
biggerDamage, getAttackRange, getFreeze, getHealth, getPlunder, getPosition, isAlive, plunder, setFaction, setFreeze, setHealth, setPosition, setShipDirection, setShipDirection, shoot, shoot, shoot8Directions, tempImmortality, unlimitedAmmo
-
Methods inherited from class com.mygdx.game.Entitys.Entity
addComponent, addComponents, cleanUp, getComponent, getComponent, getComponents, getName, raiseEvents, setName
-
-
-
-
Field Detail
-
stateMachine
public com.badlogic.gdx.ai.fsm.StateMachine<NPCShip,EnemyState> stateMachine
-
-
Method Detail
-
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:CollisionCallBackCalled once a collision has being notices- Specified by:
BeginContactin interfaceCollisionCallBack- Overrides:
BeginContactin classShip
-
EndContact
public void EndContact(CollisionInfo info)
Description copied from interface:CollisionCallBackCalled after the collision has being solved- Specified by:
EndContactin interfaceCollisionCallBack- Overrides:
EndContactin classShip
-
EnterTrigger
public void EnterTrigger(CollisionInfo info)
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
public void ExitTrigger(CollisionInfo info)
if a taget has left remove it from the potential targets Queue- Specified by:
ExitTriggerin interfaceCollisionCallBack- Overrides:
ExitTriggerin classShip- Parameters:
info- collision info
-
-