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 connectedMovableEntity
to 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 boolean
atGoal(float dt)
Can the goal be reached by the next frame?void
dispose()
removes itself from parentPoint
getGoal()
float
getMinspeed()
Get the value of minspeedboolean
handleMessage(com.badlogic.gdx.ai.msg.Telegram msg)
void
setMinspeed(float minspeed)
Set the value of minspeedvoid
setParent(AbstractEntity body)
void
update(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:
handleMessage
in interfacecom.badlogic.gdx.ai.msg.Telegraph
-
getGoal
public Point getGoal()
- Returns:
-
setParent
public void setParent(AbstractEntity body)
-
-