Minimal architecture
A few years ago, I had a realization while preparing a talk on HTML5 game development. The day before I was scheduled to give the talk, I had written the slides and prepared my delivery, but I had one small problem – I had no demo! I needed a demo of a game to finish off my talk; indeed, I had referenced it in my slides, so I had to produce it. If you've ever been up against a deadline, you know what happens next. All of my ideas about clean code and software architecture were thrown to the side, as I hacked and slashed my way to a working prototype of Asteroids in HTML5. You can still find it on my GitHub here: https://github.com/paytonrules/Boberoids, complete with a name that doesn't make sense.
The code, by virtually any standard, is pretty terrible. In much the same way the code in Chapter 1, Hello WebAssembly, and Chapter 2, Drawing Sprites, proceeds in a straight line with no modules, separation of concerns, or tests, this code brute...