As mentioned in my previous post, I plan to move all my projects to use bunjs.
So in that process, I'm scrapping some old projects:
- extract some kind of demo out of them
- stash them
My goal is to send my projects to the graveyard, in a way that I can still go back and take out ideas from them, and that anyone can use if they have a better idea than me on how to use them.
The first one to go will be dok-gl-canvas.
As all project I start, I always think that I'll turn it into a nice solid engine which I'll be keeping forever, but it ends up becoming scrapped. That said, there are a lot of interesting ideas from that project that I want to document and reuse in the future.
There are three packages of that project:
- For loops
- If statements
- Calling subroutines
- Storing variables
- Pausing execution
- Executing game loops
Within this repo, there is a demo with an editor where you can write NAPL code and it will just execute it.
This component is simply the schema. This makes it easy to build up NAPL code in JSON or YAML within an editor, having intelli-sense on some properties.
This component contains a React component that wraps a canvas and can be added on any webpage. Using NAPL code, we can execute WebGL commands.
The example shows various things it can do:
I had a tough time, but I reached the point where I could show actual WebGL animations,
One of the concept that NAPL wasn't able to handle properly was asynchronous calls. I couldn't load two separate images in parallel, and process them properly onLoad. As I looked further, it seems like some design flaw prevented this to work and the fix would require a deep redesign.
This project was interesting, but the design flaws at the end made it difficult to work with. In future projects, I need to make sure asynchronous calls are handled properly right off the bat.
Having the WebGL engine configurable fully with NAPL code might be useful. It could provide the flexibility to change game genre on the fly. I'll try to explore this further in my future projects.