Skip to content

@modoki/engine / index / applyImpulse2D

Function: applyImpulse2D()

applyImpulse2D(world, entity, x, y, wakeUp?): boolean

Apply an instantaneous linear impulse (world-unit momentum) — the one-shot velocity kick for jumps, knockback, launches. Returns false if the entity has no dynamic body yet.

Parameters

world

World

entity

Entity

x

number

y

number

wakeUp?

boolean = true

Returns

boolean

Built with Modoki.