Whether the object is active and should be updated
Rotation angle (in radians)
Rotation slowdown (0-1)
The object's angular velocity
Optional
animationThe animation of the object sprite.
Whether the object is bounded by the scene and cannot move outside.
Whether the object collides with other objects
Whether the object is static and should not move
Optional
colorThe color of the object (if no sprite).
The object's damping (0-1)
Whether the object is dead and should be removed
The object's elasticity (0-1)
Optional
familyThe family of the object.
Whether the object is flipped horizontally (mirrored)
Whether the object is flipped vertically
The force applied to the object (acceleration)
The object's friction (0-1)
Optional
gidThe global ID of the object image from TMX map (if any).
How much gravity affects the object
The ID of the object.
Optional
imageThe image of the object (if any).
Last position of the object
Optional
layerThe layer ID of the object (if any).
The object's mass (0 is static)
Maximum speed
Optional
nameThe name of the object.
Optional
objThe object the entity is standing on
Current position of the object
Custom properties of the object
Render order
The shape of the entity.
The size of the object (scaled by tileSize)
Whether the object is solid and collides with other objects
Time the entity was spawned
The sprite of the object.
Optional
ttlThe time to live of the object in milliseconds.
Optional
typeThe type of the object.
Whether the object is visible and should be drawn
Applies a force to the entity (affected by mass)
The force to be applied.
Checks if this entity collides with another entity.
The entity to check collision with.
true
if a collision occurs, false
otherwise.
Checks if the entity collides with a tile.
The ID of the tile to check collision with.
The position of the entity.
True if the entity collides with the tile, false otherwise.
Checks if the entity collides with a tile using raycasting.
The data of the tile to check collision with.
The position of the entity.
True if the entity collides with the tile, false otherwise.
Draws the entity on the screen if it is visible and within the screen bounds. If the entity has a tile object, it draws the tile object with the specified transformations. Otherwise, it draws the entity's sprite. If the game is in debug mode, it also displays debug information.
Sets the animation for the entity.
The animation to set.
(Optional) Whether to flip the animation horizontally. Default is false.
(Optional) Whether to flip the animation vertically. Default is false.
The Entity class represents a game object in the scene.