scar
  • The scar game library
  • Application Structure
    • App
    • Scenes
    • Spaces
    • Entities
    • Components
    • Systems
    • Objects
    • Drawing
    • Events
  • Builtin Features
    • Actions
    • Assets
    • Config
    • Input
    • Logger
    • Music
    • Tweens
    • Util
    • Vectors & Rects
  • Builtin Components
    • Text
    • Sprite
    • Animated Sprite
  • Builtin Systems
    • Animate Sprites
Powered by GitBook
On this page

Was this helpful?

  1. Application Structure

Objects

PreviousSystemsNextDrawing

Last updated 5 years ago

Was this helpful?

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 . 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.

Entity