Bash.tv → GitHub → itch.io

Achievements, milestones and unlockables inside a game. Event- and stat-driven definitions, counters with progress bars, hidden achievements, one-at-a-time unlock toasts, persistence, an achievements screen, unlocking cosmetics or modes, good achievement design (teach, reward mastery, encourage exploration, avoid grind), and forwarding unlocks to Newgrounds, Game Jolt or CrazyGames through bash...

Download skill (.zip) Files on GitHub

Achievement system

Drop-in: assets/achievements.js (tests: counter progress, stat thresholds, unlock once, hidden names masked, persistence across reloads). Portal integration: bash-portal-achievements (its achievements.js talks to Newgrounds medals, Game Jolt trophies and CrazyGames). Connect them with addSink.

import { createAchievements } from "./core/achievements.js";
const ach = createAchievements({
  firstWin:  { name: "First steps",  desc: "Finish level 1",            on: "levelComplete", when: (e) => e.level === 1 },
  batHunter: { name: "Bat hunter",   desc: "Defeat 50 bats",            on: "enemyKilled",   when: (e) => e.type === "bat", count: 50 },
  saver:     { name: "Piggy bank",   desc: "Hold 1,000 coins",          stat: "coins", atLeast: 1000 },
  secret:    { name: "Spelunker",    desc: "Find the hidden cave",       on: "foundCave", hidden: true },
}, { storageKey: "mygame-ach" });
game.events.on("enemyKilled", (e) => ach.event("enemyKilled", e));   // keep game code unaware of achievements
ach.stat("coins", wallet.get("coins"), { set: true });
ach.addSink((a) => portal?.unlock(a.id));                            // optional: portal medals
// HUD: const t = ach.nextToast(); if (t) showToast(`Achievement: ${t.name}`)   screen: ach.list(), ach.summary()

Good achievements

Kind Example
Teach “Use the dash to cross a gap” (guides players to a mechanic)
Progress “Reach world 3” (marks the journey)
Mastery “Finish level 5 without getting hit”
Explore Hidden: “Find the secret room”
Fun / style “Defeat a boss with the starter weapon”

Rules