WebAssembly COBOL Pong
moxon6.github.io
moxon6.github.io
https://github.com/moxon6/cobol-js-emscripten/blob/master/co...
[0] While ES2015 was a major leap in and of itself, it wouldn't have happened had ES5 not laid the groundwork by introducing "minor improvements" that we now take for granted like JSON, strict mode and Function.prototype.bind to name a few.
How did you remove all the bloat generated after Emscripten's compilation?
I've coded a snake game in C and when I compiled, the app.js file itself was ~2mb.
https://moxon6.github.io/cobol-js-emscripten/cobol-js/index....
where is the cobol?
https://github.com/moxon6/cobol-js-emscripten/blob/master/co...
I am still looking around so may be wrong.
`index.wasm` is built using the build scripts in the source repo
`main.cob` contains the main logic used to generate `index.wasm`
https://github.com/moxon6/cobol-js-emscripten/blob/master/co...
What's the deal with the alternator function (in app.js)? Why should keypresses be read only on every other attempt?
Also, is there some kind of implicit sleep or requestAnimationFrame somewhere? Or is it busy-looping and polling for key presses as fast as it can?
This is just a hack around that to simulate entering a value and then pressing escape on the next prompt request
There are many choices, but for example, using A/Z for left player up/down and J/M for right player up down would not require any mental work. Once you place your fingers, up is up and down is down.