Effect

Effect

Base class for all effect types.

Effects are transient pieces (not saved with the board) used to animate thrown items, projectiles, fire, clouds, etc. Unlike terrain/items/agents, effects are NOT immutable — they maintain frame state as they animate.

Effects implement onFrame(event, cell, frame) and are registered with the board's AnimationProxy list when added to a cell (mirrors Java's EffectBag registering Animated effects via board.addAnimated). Each effect gets its own proxy with a frame counter starting at 0 (randomSeed = false).

Effects self-remove by calling cell.removeEffect(this) inside onFrame when their animation is complete, matching Java's cell.getEffects().remove(this).

Constructor

new Effect()

Source:

Classes

Effect

Members

currentSymbol

Description:
  • Current animation frame symbol.

Source:

Current animation frame symbol.

isExpired

Description:
  • True if this effect has finished animating and should be removed.

Source:

True if this effect has finished animating and should be removed.

Methods

isAboveAgent()

Description:
  • Should this effect render above an agent that occupies the same cell? Override to return true for effects that should appear on top.

Source:

randomSeed()

Description:
  • Effects always start at frame 0 (not a random seed). Mirrors Java where all effects return randomSeed() = false.

Source: