This is a simple demo heavily inspired by this Pico8 example I found on twitter.
Just run a local server in this folder (e.g. serve .).
You can see the engine in action here.
If you want to learn how this is done, use only the index.js and the main.js.
index.js holds the initialization code (canvas setup, dom manipulation, and the actual starting of render), whilst the main.js holds the util functions and other functions used by index.js.
WARNING: The code is heavily uncommented, read at your own peril!!

