Constructor
new KnockbackMotor(configopt)
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config | Object | <optional> | Properties
|
- Source
Classes
Methods
applyImpulse(vx, vy)
Apply a directional knockback impulse.
Parameters:
| Name | Type | Description |
|---|---|---|
vx | number | |
vy | number |
- Source
step(deltaTime, currentBounds, solidObstacles) → {Object}
Step knockback displacement against solid obstacles. If knockback collides into a wall, movement stops at the wall surface and normal velocity is zeroed (preventing wall clipping).
Parameters:
| Name | Type | Description |
|---|---|---|
deltaTime | number | |
currentBounds | Object | Entity bounds { left, right, top, bottom } |
solidObstacles | Array.<Object> | List of static { left, right, top, bottom } |
- Source
Returns:
{ dx: number, dy: number, hitWall: boolean }
- Type:
- Object
stop()
Clear active knockback immediately.
- Source