A kids traffic mat in Elm
matiasklemola.com
A kids traffic mat in Elm
1–10 of 17 posts
Re: A kids traffic mat in Elm
#2Re: A kids traffic mat in Elm
#3Like SimCity.
Re: A kids traffic mat in Elm
#4This has been a fun (and rather long) project. I craved for a simple city builder that a toddler could play and understand. You might want to start from the first devlog entry to see where Liikennematto came from.
You can play Liikennematto in your browser on itch.io[1] (the link is buried at the end of the article).
Re: A kids traffic mat in Elm
#5Whoa, didn’t expect to make it here. Thanks, OP! This has been a fun (and rather long) project. I craved for a simple city builder that a toddler could play and understand. You might want to start from the first devlog entry to see where Liikennematto came from. You can play Liikennematto in your browser on itch.io[1] (the link is buried at the end of the article). [1] https://yourmagicisworking.itch.io/liikennematto
Re: A kids traffic mat in Elm
#6Re: A kids traffic mat in Elm
#7Re: A kids traffic mat in Elm
#8Well done to the author on this project. A beautiful architecture and code base with not an "object" in sight. Projects such as this demonstrate how complex interactive applications can be built without pervasive mutable state. Pure functions are everywhere, which makes it much easier to reason about, test and reuse this code
Though many games have been built with Elm, I've had to implement lots of "game engine" code myself. For example, the collision system, physics (acceleration etc.), and path finding are custom code. It's worth mentioning that this is my fist gamedev project, and I've had to read up a quite a bit on the topic. Still the difficult was not in Elm itself, but in math and data structures, as it would be on any language.
Elm's lack of runtime exceptions and mutable state makes any game quite robust. Most of the bugs in Liikennematto have been of omissions (forgot to update something) and in math formulas. 3rd party Elm libraries are often excellent with great docs and have helped along the way.
Lastly Elm is quite performant (pure functions can be inlined and easily optimized) and I can create a single .js file that contains the game code, UI and the assets (which are still SVG in Elm). The whole game is still about 1 megabyte minimized! I think that's amazing, despite not shipping the runtime enviroment (the browser).
Re: A kids traffic mat in Elm
#9I've done some basic game dev in Elm and was surprised how nice it was. In one game, I had melee fighters moving around a map fighting each other. Much later I came back to add a projectile class.
Having not touched the game code in months, adding an archer was a matter of adding an `Archer` model (with archer specific state) to an enum and then following the errors until I'd handled the archer at every switch site in the code. It blew my mind that I had a working archer system without even running the code once and without having to reload the whole code base into my head.