Namespace in reactor_fight_tactical.js

U

8 functions in 3 groups · hide internal

A Tactical battle on a 2D map.

Quick Reference

Actions 2

placeBars() The bars, placed over each unit's head where the view shows it now (every frame, from the pool).
placeForecast() The selected action's hit chance beside the valid hovered target.

Updating & Drawing 3

drawRings3D() Draws the rings3 d.
drawRings2D() The rings of a 2D map, pooled, in a layer under the characters.
update() Each frame, after the marks: who is marked is read (no more than that), rings are laid again when it changed,…

Other 3

collect() Every unit to mark, into the arrays (U.x, U.y: the middle of its body in tiles; U.ground, U.tall; U.w, U.d: i…
track() Where each marked unit stands now (it may be walking): a few numbers a unit, every frame.
covers() Whether a marked unit (its feet, middle or head) or the cursor's cell is drawn inside a rectangle of the scre…

Actions

placeBars

static source
U.placeBars(spriteset, on)

The bars, placed over each unit's head where the view shows it now (every frame, from the pool).

placeForecast

static source
U.placeForecast(spriteset, on)

The selected action's hit chance beside the valid hovered target.

Updating & Drawing

drawRings3D

static source
U.drawRings3D(live)

Draws the rings3 d.

drawRings2D

static source
U.drawRings2D(spriteset, on)

The rings of a 2D map, pooled, in a layer under the characters.

update

static source
U.update(spriteset)

Each frame, after the marks: who is marked is read (no more than that), rings are laid again when it changed, bars are placed.

Other

collect

static source
U.collect(fight)

Every unit to mark, into the arrays (U.x, U.y: the middle of its body in tiles; U.ground, U.tall; U.w, U.d: its body; U.team as an index of U.TEAMS; U.hp 0 to 1; U.flags).

Details

Every unit to mark, into the arrays (U.x, U.y: the middle of its body in tiles; U.ground, U.tall; U.w, U.d: its body; U.team as an index of U.TEAMS; U.hp 0 to 1; U.flags). Read when the battle's revision moved (someone acted, fell, joined, was hurt): between those only where each stands is read (U.track). Returns a number that changes when anything a ring shows changed.

track

static source
U.track()

Where each marked unit stands now (it may be walking): a few numbers a unit, every frame.

Details

Where each marked unit stands now (it may be walking): a few numbers a unit, every frame. Returns the number collect does.

covers

static source
U.covers(fight, x, y, w, h)

Whether a marked unit (its feet, middle or head) or the cursor's cell is drawn inside a rectangle of the screen (x, y, w, h in game pixels): a HUD panel there would cover it.

Details

Whether a marked unit (its feet, middle or head) or the cursor's cell is drawn inside a rectangle of the screen (x, y, w, h in game pixels): a HUD panel there would cover it.