← All Examples

Abilities Addon

A close-quarters brawl built on @yagejs-addons/abilities: two swappable 1-2-3 combos chain hitbox phases, each a windup → active → recovery sequence that leaves you briefly exposed after landing (or whiffing) — every combo stage, the charge finisher, and the parry counter set a priority above the addon's built-in stagger reaction, so a committed attack still takes damage but can't be flinched or knocked back out of it. FISTS ends in a lunging hook and charges a homing fireball; KICKS chains front, high, and flying kicks and charges the existing heavy kick. Its bullet time begins just before the kick starts. Tapping dash mid-attack buffers it to fire the instant the hit lands, cancelling the recovery, while holding dash runs. dash and the parry counter both pair invulnerable with a matching game-defined flash step, so invulnerability from any source (those windows, or the post-hit i-frames HitReceiver arms automatically) strobes the sprite. Guard is a hold-vs-tap split: holding reduces every landed hit in place with no stagger and stays open across as many hits as land, tapping cancels the hold into a short parry that negates and punishes back through the Hittable trait, with a counter (melee punch or projectile reflect, both hand-rolled) on a successful parry. potion plays on its own "item" lane so it works even mid-stagger. Enemies close to melee range for a telegraphed hitbox strike or hang back and fire a projectile fireball, flashing a warning tint and bursting particles through their windup — unlike the player, enemies carry no priority, so a landed hit always interrupts the telegraph. An engagement token lets only one enemy attack at a time; the rest orbit/strafe at mid range instead of piling on. Pressing E swaps the player's complete definition set between the FISTS and KICKS movesets. The game calls replaceDefinitions(), disposes the old input driver, and creates the driver for the new loadout; active abilities and cooldowns are cleared by the destructive swap. Landed hits scale hitstop, camera shake, impact particles, and a hit thock by weight; the camera is zoomed in and softly follows the player, clamped to the arena; the bottom hotbar tracks each action's cooldown with a clock-wipe arc. WASD/Arrows move · Space/J tap to combo, hold to charge · Shift/K tap to dash, hold to run · F/L hold to block, tap to parry · Q/1 potion · E swap FISTS/KICKS loadout · H toggle hitbox/collider debug overlay · R reset