Handle collisions between characters that can push each other.
The object owning the behavior
Static
Private
Readonly
epsilonA very small value compare to 1 pixel, yet very huge compare to rounding errors.
This method is called each tick after events are done.
The instanceContainer owning the object
This method is called each tick before events are done.
The instanceContainer owning the object
Check if the Character is "going down", either because it's in the falling state or because it's jumping but reached the jump peak and is now going down (because the jump speed can't compensate anymore the falling speed).
If you want to check if the object is falling outside of a jump (or because
the jump is entirely finished and there is no jump speed applied to the object
anymore), consider using isFallingWithoutJumping
.
Returns true if it is "going down" and false if not.
Check if the Character is on the given object.
Returns true if on the object and false if not.
This method is called when the owner of the behavior
is being removed from the scene and is about to be destroyed/reused later
or when the behavior is removed from an object (can happen in case of
hot-reloading only. Otherwise, behaviors are just de-activated,
not removed. See onDeActivate
).
Set the maximum falling speed of the Character.
The maximum falling speed.
If true and if jumping, tune the current jump speed to preserve the overall speed in the air.
Called at each frame after events. Call doStepPostEvents.
Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead.
The instanceContainer owning the object
Called at each frame before events. Call doStepPreEvents.
Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead.
The instanceContainer owning the object
Called when the behavior must be updated using the specified behaviorData. This is the case during hot-reload, and is only called if the behavior was modified.
The previous data for the behavior.
The new data for the behavior.
true if the behavior was updated, false if it could not (i.e: hot-reload is not supported).
gdjs.RuntimeBehavior#onObjectHotReloaded
Update the behavior properties using the provided data.
The new properties of the behavior.
Should return false
if the behavior does not need any lifecycle function to
be called.
Default, hidden, "capability" behaviors set it to false
.
This avoids useless calls to empty lifecycle functions, which would waste CPU
time (and have a sizeable impact for example when lots of static instances
are living in the scene).
Static
Private
getPrivate
getPrivate
updatePrivate
update
Allow extensions relying on the 3D physics to customize its behavior a bit.