Skip to documentation
CranberryClock.Ideas / Systems / Design

INDEPENDENT TOOL / v0.1.0

TempoOverview

Charges, cooldowns, and the space between spells. Make every moment feel intentional.

Small clocks for powerful little abilities. Tempo tracks stored charges, sequential recharge, per-use cooldowns and an optional global cooldown. It has no dependencies, timers, renderer, DOM, callbacks or other Cranberry Forge packages. Use it for dash charges, spells, healing items or any finite ability reserve in a Three.js game.

The Spellgarden showcase drives three original procedural spells from successful tryUse results. Charge crystals in the world and the HUD read the same public state. Adjust time scale, pause, tune recharge, or save and restore the clocks.

Why this small tool exists

Ability timers are an established category. Phaser provides scene clocks, timer callbacks, time scaling and pause controls in its engine. Unreal's Gameplay Ability System addresses a much larger ability architecture, including effects, costs and cooldowns. Phaser time documentation, Epic's Gameplay Ability System tutorial.

Tempo's narrow contribution is an explicit, independently installable charge policy for a Three.js host: sequential recharge, concurrent per-use/global locks, caller-owned time, returned events, and validated snapshots. This is an integration choice, not a claim that cooldown tools or charge systems did not previously exist. It deliberately excludes ability trees, resource costs, animation state machines, status effects, casting channels and networking.

Tutorial and verification

Follow TUTORIAL.md for Three.js integration, HUDs, pause/time scaling, save handling and the Spellgarden scene API. Ten targeted Node tests cover sequential timing, tick partition behavior, global bypass, independent clocks, lifecycle and detached data, active snapshot continuation, malformed/sparse snapshot atomicity, configuration rejection, stable event ordering, bounded catch-up and procedural scene construction. Browser visual QA was unavailable in the build environment; offline scene illustrations are labeled as such.

MIT licensed. No runtime or peer dependencies.

View versioned source on GitHub ↗