-
-
Notifications
You must be signed in to change notification settings - Fork 0
ECS
There are a handful of built-in components that are important to know. Through them, you can change the core behavior of the engine.
In magique
an actor is similar to most other engines. An actor is an entity around which the game progresses,
typically
the player itself and networked players if any. The engine will update all entities in update-distance around any actor!
(can be configured in core/Core.h
). There is also a limit on the amount of existing actors at any time (default : 4).
The component controls the position and offset of the camera. There can only be 1 entity with this component at the same
time. To switch the camera you can use core/Core::SetCameraEntity()
. The position of the camera is automatically
assigned each tick to the position of the entity with the camera component. Additionally, if a collision component is
present it automatically offsets the camera by the collision shape end dimensions, so it's centered on the screen.
This offset can also be set manually with core/Core::SetManualCameraOffset()
.
Note: While any custom offset is set other than (0,0) everything else will be ignored.
The script component ONLY shows that an entity should receive script updates! The actual script is set globally for each
entity type with ecs/Scripting::SetScript()
. Again, the existence of this component on a entity only enables that its
global script methods are called with it as parameter.