Skip to content

Idle beta ​

Interface of @v12-engine/engine

ts
export interface Idle

A unit with nothing to do, this tick: no orders. Set handled and do what it does instead of what idle units do (fight back, go for enemies that come close, which is only for those that fight): a healer that goes to the wounded, a worker that goes back to work. Asked often: keep it cheap

Members ​

dt ​

ts
readonly dt: number;

Seconds the tick lasts

entity ​

ts
readonly entity: Entity;

The unit with nothing to do

fights ​

ts
readonly fights: boolean;

Whether it fights by itself: it has an attack and is not told to stand down. The engine only does that

handled ​

ts
handled: boolean;

Whether a handler took over the idle unit; set it to stop the engine's own idle behaviour