0
\$\begingroup\$

I want to use Ashley but I also want to use actions and listeners with Scene2d. I read that it is not a good idea, but why? Ican create a system with stage.act(); and stage.draw(); in the update method or is it a bad idea? Thanks.

\$\endgroup\$
0
\$\begingroup\$

I don't think you can say it's always a bad idea to mix Scene2D and an ECS like Ashley. It may make a lot of sense to use Scene2D.UI for your user interface, and then Ashley for everything else. As you point out, there isn't a technical reason why you couldn't tie these two together. It's a judgment call based on your particular use case.

That being said, one reason why you typically wouldn't use Scene2D and Ashley together is that they have a lot of overlap. One of the basic principles of computer science is "Don't Repeat Yourself"- don't build the same thing twice, and when you do build something, make sure you use as few parts as possible. This includes avoiding libraries you don't need.

If you use Scene2D's actions to move your actors/entities, and you use Stage#draw() to draw everything, what's left for Ashley to add? Likely not enough to justify the complexity it adds.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks! Maybe I should use my own system of 'Actions' in Ashley? \$\endgroup\$ Dec 18 '16 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.