I’ve been working on a Super Mario clone in Elm.
I’ve been building it gradually, starting with just Mario, then a level made up of Tiles. Then I’ve introduced collision detection with the tiles. Then I’ve introduced the first enemy, a Goomba and to do so I’ve abstracted away the concept of an entity and I’ve generalised most of the physics code.
Now I’m reaching the point where I’d like to animating tiles, colliding tiles and entities, and entities with other entities.
A tile when animated, and an entity like Mario are not too dissimilar from each other. In other languages at this point I would follow ECS: https://www.wikiwand.com/en/Entity–component–system
I’ve found someone on the internet exploring an ECS in Elm: https://gist.github.com/TheSeamau5/4fc43cb00253f4e5d7b4
What are approaches are you using to structure games in Elm, maybe more specifically 2d platformers?
Thanks.