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
Hello there, thanks for the links.
My mario clone attempt is at: https://github.com/soulnafein/mario
Keep in mind that I’m teaching myself Elm at the moment and I’m still exploring the ideal architecture for this so the code isn’t great.
It is always useful to check and learn from each others code. Thanks for sharing!
As of the main question. The game I’m working on and trying to apply the component system is all in the src/elm/Actor.elm file. But I do not have real Physics stuff etc, not sure if it is really useful for you. What it does have is strong separation of concerns with the components.