实时音频代码

// 本游戏中的所有声音均使用:
const synth = newChiptuneSynth();
await synth.init();
// 捕球游戏中使用的音效:
synth.playPreset('coin'); // 接住金币
synth.playPreset('1up');     // 接住星星
synth.playPreset('explosion'); // 炸弹击中
synth.playPreset('hit'); // 受到伤害
synth.playPreset('blip'); // 漏接金币
synth.playPreset('powerup'); // 升级

事件日志

    芯片音乐捕手

    得分:0 | 生命:3 | 关卡:1

    芯片音乐接币器

    接住下落的硬币,躲开炸弹!

    AD 键移动
    所有声音均由 ChiptuneSynth 实时生成

    游戏结束

    得分:0
    synth.playPreset('coin') • synth.playPreset('explosion') • synth.playPreset('1up')