AnimationManager

AnimationManager

AnimationManager — drives all visual effects at ~6 fps using rAF.

Each tick:

  1. Calls onTick() on every active effect
  2. Advances InFlightItem projectiles one cell in their direction
  3. Removes expired effects
  4. Calls player.onFrame(cell) so damage/heal flashes fade

The board and player references are set by the Game controller just before the game loop starts via setContext().

Constructor

new AnimationManager()

Source:

Classes

AnimationManager

Members

_board :Board|null

Source:
Type:

_player :Player|null

Source:
Type:

onProjectileLanded

Description:
  • Called by game.js after each tick that moves an InFlightItem.

Source:

Called by game.js after each tick that moves an InFlightItem.

Methods

setContext(board, player)

Description:
  • Inject game context. Called by the Game controller before start().

Source:
Parameters:
Name Type Description
board Board
player Player