Class MoveToAi
- java.lang.Object
-
- com.bombinggames.wurfelengine.core.gameobjects.MoveToAi
-
- All Implemented Interfaces:
com.badlogic.gdx.ai.msg.Telegraph,Component,java.io.Serializable
public class MoveToAi extends java.lang.Object implements com.badlogic.gdx.ai.msg.Telegraph, java.io.Serializable, Component
A component that will move the connectedMovableEntityto a position. Will keep the speed but if it falsl udner a threshold will use this.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanatGoal(float dt)Can the goal be reached by the next frame?voiddispose()removes itself from parentPointgetGoal()floatgetMinspeed()Get the value of minspeedbooleanhandleMessage(com.badlogic.gdx.ai.msg.Telegram msg)voidsetMinspeed(float minspeed)Set the value of minspeedvoidsetParent(AbstractEntity body)voidupdate(float dt)
-
-
-
Constructor Detail
-
MoveToAi
public MoveToAi(Point goal)
- Parameters:
goal-
-
-
Method Detail
-
getMinspeed
public float getMinspeed()
Get the value of minspeed- Returns:
- the value of minspeed
-
setMinspeed
public void setMinspeed(float minspeed)
Set the value of minspeed- Parameters:
minspeed- new value of minspeed
-
atGoal
public boolean atGoal(float dt)
Can the goal be reached by the next frame?- Parameters:
dt- delta time in ms for this this frame- Returns:
- if position is near the goal
-
handleMessage
public boolean handleMessage(com.badlogic.gdx.ai.msg.Telegram msg)
- Specified by:
handleMessagein interfacecom.badlogic.gdx.ai.msg.Telegraph
-
getGoal
public Point getGoal()
- Returns:
-
setParent
public void setParent(AbstractEntity body)
-
-