AliveEntity

Classes derived from this one

Type
Monster
LandMonster

Members

Type Member Description
Vec2 pos Position
Vec2 vel Vitesse

Constructors

No constructors. Instances should be created using the centauri api.

Methods

Ret Function Args
instanceDestroy ()
[X] getContext ()
physicsUpdateGravity (dt, gravity, friction, ground_fric, on_ground)
[X] boundingBoxRelative ()
[X] boundingBox ()
bool alive ()
[X] hurtBase (damages, *owner)
bool wall (rect, scalex)
float wallHeight (rect, scalex, max)
multiplayerSmooth
Movement
(buffer)
[X] status ()

Descriptions

instanceDestroy()

Destroy the entity.

WorldContext& getContext()

Return the associated WorldContext of the entity.

physicsUpdateGravity

Type ArgName Description
float dt Delta time
float gravity Vertical gravity force
Vec2 friction Air friction vector
float ground_fric Horizontal ground friction
bool on_ground Specify if on ground

Apply gravity to the internal force vector vel.

Rect boundingBoxRelative()

Return the relative axis aligned bounding box of the entity.

Rect boundingBox()

Return the axis aligned bounding box of the entity.

bool alive()

Indicate if health of the entity is > 0.

Hit hurtBase()

Base class method without any overriding.

bool wall

Type ArgName Description
Rect rect
float scalex

Check if there is any wall on the side.

float wallHeight

Type ArgName Description
Rect rect
float scalex
i32 max

Return the height of the side wall.

multiplayerSmoothMovement

Type ArgName Description
StreamData& buffer Received packet buffer

Read pos and vel from the buffer and do some interpolation to get a smooth movement in multiplayer.

AlterationStatus& status()

Return the status associated to the entity.