Entity QML Type

Entity is the base for any component used in your game. More...

Import Statement: import Bacon2D 1.0
Inherited By:



Detailed Description

Each Entity gets updated from the Scene on each step of the game loop. The Entity can include a Behavior, which gets run on each update. You can also change the updateInterval so your Behavior doesn't get run on each update of the Entity, reducing processing time.

If physics are enabled in the Scene, Entities will become part of the scene's Box2D physics world. Box2D uses the term "body" for all items participating in the physics world. Your entities are bodies to Box2D, so whenever you see the term body used in the documentation, remember in Bacon2D it's an Entity.

You can apply forces, torques, and impulses to entities. An Entity can be static, kinematic, or dynamic.

Bodies (Entities) are the backbone for fixtures (shapes). Bodies carry fixtures and move them around in the world. Entites are always rigid bodies in Box2D. That means that two fixtures attached to the same rigid body never move relative to each other and fixtures attached to the same entity don’t collide.

Fixtures have collision geometry and density. Normally, entities acquire their mass properties from the fixtures. However, you can override the mass properties after an entity is constructed.

Property Documentation

behavior : Behavior

This property holds the Behavior to be run on on each updateInterval

updateInterval : int

This property holds the interval in milliseconds between execution of the Behavior.