A few weeks back one of my roommates mentioned in passing that they were thinking of writing conway’s game of life as a little widget for their website.
I thought that was pretty fun and suggested that it would be really neat if it were in 3D as well.
… anyways fast-forward about two hours and I was stuck in a 3-hour lecture.
So I wrote it (as is pretty evident below)
Disclaimer: I don’t think I can claim to be a good JS programmer so I highly doubt this can be considered “exemplary” javascript code. For example I added parallax to it in a way that definitely wasn’t accidental…let’s call it a “feature”, not a “bug”.
Additional features that are half-baked currently include changing the initial state of the game, game size, etc.
It’s the kind of thing that I had the intention of doing while writing it but kind of got bored after I got the minimum viable product working.
I’d also like to note that Three.js was surprisingly performant and ergonomic to use (though maybe my use-case was just really simple).
The main intent was to have a swanky little widget I can stick on this site so that I can prove that i cAn fRoNt-EnD tOo1 because recruiters seem to think otherwise – even though the bulk of my worked experience is probably fullstack 2.
Maybe I just don’t seem macintosh™ enough to write css
.
Anyways, it’s easily embeddable by copying the appropriate files over (repo) and adding a script
tag to where you want this to show up:
|
|
TODO:
- Add a way to change the initial state of the game
- game grid resizing
- interactive camera control
- better developer api
- optimizing it (abrash’s black book, ch 17, 18) 3
Source code: github.com/ihasdapie/conway3d