Bash.tv → GitHub → itch.io

Temporary abilities, buffs, upgrades and pickups. Timed buffs with stacking rules (refresh, extend, stack, replace), stat modifiers (add and multiply), flags like shield, invincibility and magnet, charge-based power-ups, expiry warnings, pause-safe timers, HUD icons, spawning by need, and permanent upgrades between runs. Includes tested powerups.js. Use for "add power-ups / buffs / pickups / up...

Download skill (.zip) Files on GitHub

Power-up system

Drop-in: assets/powerups.js (tests: multiply and add modifiers, stacking to a max, charges, expiry warning, extend, expiry, need-weighted spawning).

import { PowerUps, pickPowerUp } from "./core/powerups.js";
player.pu = new PowerUps(player);
player.pu.add({ id: "speed", icon: "boot", duration: 6, mods: { speed: { mul: 1.5 } } });               // refresh on re-pickup
player.pu.add({ id: "rage", duration: 5, stack: "stack", maxStacks: 3, mods: { damage: { add: 2 } } });
player.pu.add({ id: "shield", charges: 1, flags: ["shield"] });                                          // when hit: if (pu.consumeCharge("shield")) return;
// each step: player.pu.update(dt);  speed = player.pu.stat("speed", cfg.speed);  if (player.pu.has("magnet")) pullCoins();
// HUD: player.pu.hud() → icons with time left; blink the ones in pu.expiringSoon(1.5)
const next = pickPowerUp([{ id: "heart", weight: (c) => (c.hp < 0.3 ? 8 : 1) }, { id: "bomb", weight: 1 }], { hp: player.hp / player.maxHp }, rng.next, last);

Stacking rules (choose per power-up)

Rule Picking up again… Good for
refresh Resets the timer Speed, magnet
extend Adds time Invincibility star, slow-mo
stack +1 stack (up to max), resets the timer Damage, fire rate
replace Old one ends, new one starts Weapon types

Design rules