O'Reilly logo

Libgdx Cross-platform Game Development Cookbook by Alberto Cejas Sánchez, David Saltares Márquez

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Component-based entity systems with Ashley

Making games is an art and as such, it has a high degree of creative freedom, which means that there is no one single way to reach your goal.

On one hand, traditional hierarchy-based games development is quite intuitive as you can see in the next diagram:

Component-based entity systems with Ashley

However, as the game grows, the class hierarchies become more annoying and hardly reusable.

On the other hand, a viable alternative to destroy that pyramid from hell is component-based development. In this way, we would have, for instance, our T-Rex class working as a container for a series of behaviors called components. The advantage of this is that those ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required