10 préréglages audio instantanés pour jeux. Cliquez sur n'importe quelle carte pour écouter. Une ligne de code = un effet sonore.
// Coin rush — rapid fire coins
for (let i = 0; i < 5; i++)
setTimeout(() => synth.playPreset('coin'), i * 120);
// Battle: shoot → hit → explosion
synth.playPreset('shoot');
setTimeout(() => synth.playPreset('hit'), 200);
setTimeout(() => synth.playPreset('explosion'), 450); const synth = new ChiptuneSynth();
await synth.init();
// Play any built-in preset
synth.playPreset('laser');
synth.playPreset('coin');
synth.playPreset('explosion');
// Get all preset names
const names = ChiptuneSynth.getPresetNames();
// ['laser','coin','jump','explosion','powerup','hit','blip','bass','shoot','1up']
// Load preset params without playing
synth.loadPreset('powerup');