Objects

Objects are an alternative way of creating entities. If you do not want to use Scar's entity-component-system architecture, you can build Entities with data and behaviour in an object-oriented way via Objects.

Object is a subclass of Entity. This means, that you can use them like any other entity, even add components to it, while still having data contained in the Object itself. Object has the same three methods init, update and render as a system has. Here you can write your logic like you would in a system, only that you have direct access to your Object.

You can throw Objects into spaces like you would with normal entities, Scar handles all the calling of init, update and render.

Last updated