Re:Show HN: Mini Metroidvania in 13KB of JavaScript
by arikgalactic on Tuesday September 13, 2022 @07:03PM
(#32831267)
1. The WebAudio api requires user interaction to allow playing audio. The main menu saying "press any key" is intended to trigger that.
2. One WebAudio is ready to use, I build all the sound effects procedurally. There's 13 SFX and 3.5 minutes of music that need to be generated! This takes about 5-6 seconds total to churn through all the math used to build the audio buffers.
Re:Show HN: Mini Metroidvania in 13KB of JavaScript
by Narishma on Tuesday September 13, 2022 @08:17PM
(#32831784)
Why aren't they generated while waiting for the player to press a key?
Re:Show HN: Mini Metroidvania in 13KB of JavaScript
by lioeters on Tuesday September 13, 2022 @11:06PM
(#32832850)
I'm guessing it's because WebAudio won't let you create audio buffers until a user gesture like a click allows audio context to be started ("resumed").
Re:Show HN: Mini Metroidvania in 13KB of JavaScript
by nonethewiser on Tuesday September 13, 2022 @06:26PM
(#32830964)
But seriously, why is that?
Re:Show HN: Mini Metroidvania in 13KB of JavaScript
by solumunus on Wednesday September 14, 2022 @05:09AM
(#32834809)
I assume the code is 13kb but loads external assets like image/audio.
Re:Show HN: Mini Metroidvania in 13KB of JavaScript
by filleduchaos on Wednesday September 14, 2022 @05:37AM
(#32834971)
That is not permitted in JS13K, no.
In seriousness though, this is awesome! I love little metroidvanias. :) And the interactions, like the jump and swipe, feel remarkably satisfying. Great stuff.