add-3d-assets
Replace primitive 3D shapes with real GLB models — animated characters, world props, buildings, and scenery for Three.js games.…
Game audio engineer using Web Audio API for procedural music and sound effects in browser games. Zero dependencies. Use when adding music or SFX to a game.
$ npx -y skills add playableintelligence/game-creator --skill game-audio --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/game-audioContext preview
The summary Claude sees to decide when to auto-load this skill.
Game audio engineer using Web Audio API for procedural music and sound effects in browser games. Zero dependencies. Use when adding music or SFX to a game.
name: game-audio description: Game audio engineer using Web Audio API for procedural music and sound effects in browser games. Zero dependencies. Use when adding music or SFX to a game. argument-hint: "[topic]" license: MIT metadata: author: OpusGameLabs version: 1.3.0 tags: [game, audio, music, sfx, web-audio-api, bgm]
You are an expert game audio engineer. You use the **Web Audio API** for both background music (looping sequencer) and one-shot sound effects. Zero dependencies — everything is built into the browser.
For detailed reference, see companion files in this directory:
| Purpose | Engine | Package | |---------|--------|---------| | Background music | Web Audio API sequencer | Built into browsers | | Sound effects | Web Audio API one-shot | Built into browsers | | Synths | OscillatorNode (square, triangle, sawtooth, sine) | — | | Effects | GainNode, BiquadFilterNode, ConvolverNode, DelayNode | — |
No external audio files or npm packages needed — all sounds are procedural.
src/ ├── audio/ │ ├── AudioManager.js # AudioContext init, BGM sequencer, play/stop │ ├── AudioBridge.js # Wires EventBus → audio playback │ ├── music.js # BGM patterns (sequencer note arrays) │ └── sfx.js # SFX (one-shot oscillator + gain + filter)
The AudioManager owns the AudioContext (created on first user interaction for autoplay policy) and runs a simple step sequencer for BGM loops.
// AudioManager.js — Web Audio API BGM sequencer + SFX context
class AudioManager {
constructor() {
this.ctx = null;
this.currentBgm = null; // { stop() }
this.masterGain = null;
}
init() {
if (this.ctx) return;
this.ctx = new (window.AudioContext || window.webkitAudioContext)();
this.masterGain = this.ctx.createGain();
this.masterGain.connect(this.ctx.destination);
}
getCtx() {
if (!this.ctx) this.init();
return this.ctx;
}
getMaster() {
if (!this.masterGain) this.init();
return this.masterGain;
}
playMusic(patternFn) {
this.stopMusic();
try {
this.currentBgm = patternFn(this.getCtx(), this.getMaster());
} catch (e) {
console.warn('[Audio] BGM error:', e);
}
}
stopMusic() {
if (this.currentBgm) {
try { this.currentBgm.stop(); } catch (_) {}
this.currentBgm = null;
}
}
setMuted(muted) {
if (this.masterGain) {
this.masterGain.gain.value = muted ? 0 : 1;
}
}
}
export const audioManager = new AudioManager();See `sequencer-pattern.md` for the full sequencer function, `parsePattern()`, example BGM patterns, and anti-repetition techniques.
See `sfx-engine.md` for `playTone()`, `playNotes()`, `playNoise()`, and all common game SFX presets (score, jump, death, click, powerUp, hit, whoosh, select).
import { eventBus, Events } from '../core/EventBus.js';
import { audioManager } from './AudioManager.js';
import { gameplayBGM, gameOverTheme } from './music.js';
import { scoreSfx, deathSfx, clickSfx } from './sfx.js';
export function initAudioBridge() {
// Init AudioContext on first user interaction (browser autoplay policy)
eventBus.on(Events.AUDIO_INIT, () => audioManager.init());
// BGM transitions
eventBus.on(Events.MUSIC_GAMEPLAY, () => audioManager.playMusic(gameplayBGM));
eventBus.on(Events.MUSIC_GAMEOVER, () => audioManager.playMusic(gameOverTheme));
eventBus.on(Events.MUSIC_STOP, () => audioManager.stopMusic());
// SFX (one-shot)
eventBus.on(Events.SCORE_CHANGED, () => scoreSfx());
eventBus.on(Events.PLAYER_DIED, () => deathSfx());
}See `mute-button.md` for mute toggle event handling, `drawMuteIcon()` Phaser Graphics implementation, UIScene button creation, and localStorage persistence.
1. Create `src/audio/AudioManager.js` — AudioContext + sequencer + master gain 2. Create `src/audio/music.js` — BGM patterns as note arrays + sequencer calls 3. Create `src/audio/sfx.js` — SFX using Web Audio API (oscillator + gain + filter) 4. Create `src/audio/AudioBridge.js` — wire EventBus events to audio 5. Wire `initAudioBridge()` in `main.js` 6. Emit `AUDIO_INIT` on first user click (browser autoplay policy) 7. Emit `MUSIC_GAMEPLAY`, `MUSIC_GAMEOVER`, `MUSIC_STOP` at scene transitions 8. **Add mute toggle** — `AUDIO_TOGGLE_MUTE` event, UI button, M key shortcut 9. Test: BGM loops seamlessly, SFX fire once and stop, mute silences everything
Go from game idea to deployed, monetized browser game in minutes — not hours. Tell your AI coding agent "make a space invaders game" and get a fully playable 2D or 3D browser game with pixel art, procedural audio, and automated QA. Deploy instantly to the web.
Replace primitive 3D shapes with real GLB models — animated characters, world props, buildings, and scenery for Three.js games.…
Replace geometric shapes with pixel art sprites — recognizable characters, enemies, and items with optional animation. Use when…
Add music and sound effects to a game using the Web Audio API — background music, gameplay themes, and SFX. Zero dependencies.…
Add a new gameplay feature to an existing browser game following its architecture patterns. Use when the user says "add a…
Add real-time or turn-based multiplayer to an existing browser game using PartyKit (Cloudflare Durable Objects). Scaffolds a…
Audit and improve the visual design, polish, and player experience of an existing game. Use when the user says "make my game look…