Page 1 of 1

Am I correct writing my own Component code for relative pos, rot, etc or doing unnecessary work?

Posted: Fri Mar 02, 2018 5:34 pm
by idchlife
Hello! I'm new to love2d and I did not yet find anything specific about component framework at least in terms of graphics (I don't quiet understand yet lovetoys but as I see - it's more for structuring application and components and not for "component.add_component; component.rotate(39) - which will also rotate children")

Am I doing redundant work or everyone writing libraries/frameworks for theirs projects?

Thanks for answers in advance!

Re: Am I correct writing my own Component code for relative pos, rot, etc or doing unnecessary work?

Posted: Fri Mar 09, 2018 2:18 pm
by jojomickymack
I'm having trouble visualizing what you're trying to create. Generally speaking, you don't want to start a game by implementing an ECS before getting something on screen. Depending on what you're ultimately trying to do it might be best done without that design overhead. I personally add that in a refactoring step only after deciding that there are enough components to make it worth the trouble.

That being said, the best frameworks for that are really lightweight, I like this one.

https://love2d.org/wiki/tiny-ecs

if you check the docs here, you can see positional coordinates in an example.

http://bakpakin.github.io/tiny-ecs/doc/