markcornwell / spacewar

Javascript implementation of 1962 game Spacewar! originally developed for the PDP-1
MIT License
0 stars 0 forks source link

Try using the E6 module structure to modularize code #23

Closed markcornwell closed 4 years ago

markcornwell commented 4 years ago

https://tylermcginnis.com/javascript-modules-iifes-commonjs-esmodules/

Things will get easier to manage if we apy attention to the module structure. I think the matrix and vector operations really cry out to be in a separate module. Also some the the drawing and rendering operations, and collision detection. These are likely to be replaced by libraries in the future as we evolve. Not committed to doing that just yet, but will keep our options open.

markcornwell commented 4 years ago

Got this working after some work. Key gotcha's:

While I was at it, I factored out some of the self test code. We now have the start of a simple test framework, that could grow. Feeling good about the direction this takes us. Better sect to tackle what lays ahead!

markcornwell commented 4 years ago

Just pushed up my updated code. More files now, but cleaner and simpler to understand.