Hatch Game Engine Documentation v1.4.0
The documentation for the Hatch Game Engine
Loading...
Searching...
No Matches
Collision Class Reference

Entity collision functions. More...

Public Member Functions

void ProcessEntityMovement (Entity entity, hitbox outer, hitbox inner)
 Processes movement of an instance with an outer hitbox and an inner hitboxes.
boolean CheckTileCollision (Entity entity, bitfield cLayers, CMODE cMode, integer cPlane, integer xOffset, integer yOffset, boolean setPos)
 Checks tile collision based on where an instance should check.
boolean CheckTileGrip (Entity entity, bitfield cLayers, CMODE cMode, integer cPlane, integer xOffset, integer yOffset, decimal tolerance)
 Keeps an instance gripped to tile collision based on where an instance should check.
boolean CheckEntityTouch (Entity thisEntity, hitbox thisHitbox, Entity otherEntity, hitbox otherHitbox)
 Checks if an instance is touching another instance with their respective hitboxes.
boolean CheckEntityCircle (Entity thisEntity, decimal thisRadius, Entity otherEntity, decimal otherRadius)
 Checks if an instance is touching another instance with within their respective radii.
C CheckEntityBox (Entity thisEntity, hitbox thisHitbox, Entity otherEntity, hitbox otherHitbox, boolean setValues)
 Checks if an instance is touching another instance with their respective hitboxes and sets the values of the other instance if specified.
boolean CheckEntityPlatform (Entity thisEntity, hitbox thisHitbox, Entity otherEntity, hitbox otherHitbox, boolean setValues)
 Checks if an instance is touching the top of another instance with their respective hitboxes and sets the values of the other instance if specified.

Detailed Description

Entity collision functions.

Member Function Documentation

◆ CheckEntityBox()

C Collision.CheckEntityBox ( Entity thisEntity,
hitbox thisHitbox,
Entity otherEntity,
hitbox otherHitbox,
boolean setValues )

Checks if an instance is touching another instance with their respective hitboxes and sets the values of the other instance if specified.

Parameters
thisEntityThe first instance to check.
thisHitboxThe first entity's hitbox.
otherEntityThe other instance to check.
otherHitboxThe other entity's hitbox.
setValuesWhether to set the values of the other entity.
Returns
Returns the side the entities are colliding on.

◆ CheckEntityCircle()

boolean Collision.CheckEntityCircle ( Entity thisEntity,
decimal thisRadius,
Entity otherEntity,
decimal otherRadius )

Checks if an instance is touching another instance with within their respective radii.

Parameters
thisEntityThe first instance to check.
thisRadiusRadius of the first entity to check.
otherEntityThe other instance to check.
otherRadiusRadius of the other entity to check.
Returns
Returns whether the entities have collided.

◆ CheckEntityPlatform()

boolean Collision.CheckEntityPlatform ( Entity thisEntity,
hitbox thisHitbox,
Entity otherEntity,
hitbox otherHitbox,
boolean setValues )

Checks if an instance is touching the top of another instance with their respective hitboxes and sets the values of the other instance if specified.

Parameters
thisEntityThe first instance to check.
thisHitboxThe first entity's hitbox.
otherEntityThe other instance to check whether it is on top of the first instance.
otherHitboxThe other entity's hitbox.
setValuesWhether to set the values of the other entity.
Returns
Returns whether the entities have collided.

◆ CheckEntityTouch()

boolean Collision.CheckEntityTouch ( Entity thisEntity,
hitbox thisHitbox,
Entity otherEntity,
hitbox otherHitbox )

Checks if an instance is touching another instance with their respective hitboxes.

Parameters
thisEntityThe first instance to check.
thisHitboxThe first entity's hitbox.
otherEntityThe other instance to check.
otherHitboxThe other entity's hitbox.
Returns
Returns whether the entities are touching.

◆ CheckTileCollision()

boolean Collision.CheckTileCollision ( Entity entity,
bitfield cLayers,
CMODE cMode,
integer cPlane,
integer xOffset,
integer yOffset,
boolean setPos )

Checks tile collision based on where an instance should check.

Parameters
entityThe instance to base the values on.
cLayersWhich layers the entity can collide with.
cModeCollision mode of the entity.
cPlaneCollision plane of which to get the collision (A or B).
xOffsetHow far from the entity's X value to start.
yOffsetHow far from the entity's Y value to start.
setPosWhether to set the entity's position if collision is found.
Returns
Returns whether the instance has collided with a tile.

◆ CheckTileGrip()

boolean Collision.CheckTileGrip ( Entity entity,
bitfield cLayers,
CMODE cMode,
integer cPlane,
integer xOffset,
integer yOffset,
decimal tolerance )

Keeps an instance gripped to tile collision based on where an instance should check.

Parameters
entityThe instance to move.
cLayersWhich layers the entity can collide with.
cModeCollision mode of the entity.
cPlaneCollision plane of which to get the collision (A or B).
xOffsetHow far from the entity's X value to start.
yOffsetHow far from the entity's Y value to start.
toleranceHow far of a tolerance the entity should check for.
Returns
Returns whether to grip the instance.

◆ ProcessEntityMovement()

void Collision.ProcessEntityMovement ( Entity entity,
hitbox outer,
hitbox inner )

Processes movement of an instance with an outer hitbox and an inner hitboxes.

Parameters
entityThe instance to move.
outerThe outer hitbox.
innerThe inner hitbox.