UI > Systems > Board Vfx System

UI system that plays board-level visual effects. Receives BoardVfx events dispatched by the scene and routes them to the appropriate animation.

One-shot effects (SPAWN, MOVE, ATTACK, DAMAGE, DEATH, REGEN) resolve as promises when their animation finishes. Persistent effects (DAZED, BURNING) attach particle emitters to an entity and run until remove() is called. All persistent emitters are cleaned up automatically on scene shutdown.

add

Plays a one-shot effect or attaches a persistent effect for the given BoardVfx event. One-shot effects return a promise that resolves on completion. Persistent effects (DAZED, BURNING) return immediately.

remove

Stops and destroys a persistent effect on the given entity. No-ops if the effect is not currently active on that entity.

#notify

Enqueues a floating text notification above the entity. If no queue exists for the entity the item is added and the drain starts immediately. Otherwise it is appended and the active drain picks it up in turn.

#notifyQueueDrain

Shifts the next item off the entity's queue and renders it as a floating text. Schedules itself again after a delay if more items remain, otherwise removes the queue entry.

#notifyQueueClear

Drops all pending notifications for the entity. Called on death to prevent floating text firing after the entity has been removed.

#onceAttack

Routes to the appropriate attack animation based on damage type and range. Falls back to a no-op promise for unimplemented combinations.

#onceDeath

Plays the death animation — emits a pixel particle burst at the target's position then fades the target to alpha 0 over the configured duration. Destroys the particle emitter on completion.

#onceMove

Tweens the target to the given world position. Uses the default move duration but accepts an override for cases where a unit travels across multiple tiles and each step needs a proportionally shorter duration. Resolves when the tween completes.

#onceSpawn

Fades the target in from alpha 0 to 1 over the configured spawn duration. Resolves when the tween completes.

#addDazed

Attaches three star particle emitters above the entity to indicate a dazed state. No-ops if the entity already has an active dazed effect.

#addBurning

Attaches five burning particle emitters across the entity to simulate a spreading fire. No-ops if the entity already has an active burning effect.

#removeDazed

Destroys all dazed emitters on the given entity and removes it from the dazed tracking map.

#removeBurning

Destroys all burning emitters on the given entity and removes it from the burning tracking map.

#destroy

Destroys all active persistent emitters (burning and dazed) and clears their tracking maps. Called automatically on scene shutdown.




© Gamesanova 2026