Skip to content

Moving

class Moving(
internal var nextStep: StepDirection? = null,
target: Tile3? = null,
var targetFootprint: Footprint? = null,
private val steps: Deque<Step> = ArrayDeque(),
var within: Int? = null
) : Component()
constructor(worldObject: WorldObject)
constructor(target: Entity)
Example
on_object_option(Assets.WorldObject.poordoor, "Call") { player ->
val goblin = World.spatial.npcsWithin(target.tile4.tile, radius = 8, shard = target.shardId).firstOrNull()
?: return@on_object_option player.message("Nobody comes.")
goblin.replaceComponent(Moving(target))
}
var targetFootprint: Footprint?
var within: Int?
var target: Tile3?
override fun onComponentRemovedFromEntity()
fun hasDestination(): Boolean
fun clear()
fun addStep(
step: Tile3,
type: StepType,
detectCollision: Boolean = true
)