Ents - an Entity-Component and Model-View-Controller framework for Games

This is the Java version of a library I’ve been working on in my free time, and it’s time to let it loose!

Here’s the Java page on GitHub
Here’s an example Asteroids clone with runnable JARs for the Java2D and LWJGL back-ends.

To summarize it’s strengths:

  • Components can be anything you want, they don’t need to extend a base class
  • Components can have alternative implementations (think of method overriding in OOP)
  • Components can have their values dynamically generated, pooled, shared between entities of the same type, etc.
  • Controllers are simple ways of adding behavior to entities that have certain components
  • Views (Renderers) is decoupled from the game, so different back-ends can be plugged in
  • Renderers have a life cycle, they are created when an Entity is and destroyed when an Entity is. This is useful when your Entity has rendering information (like VBO data) and you want to make sure to clean everything up properly.
  • EntityFilters + EntityIterators let you iterate over all your entities looking for ones that match any criteria (based on components, controllers, if it’s visible, etc).
  • Templates are used to define entity types given a set of components, controllers, and a view.
  • Entities can have components, controllers, and views added dynamically.

Let me know what you think!