Skip to content
party.js logoparty.js logo

ReferenceBehaviorsFunction

gravity()

Pulls particles down with a constant acceleration.

function gravity(strength: number): Behavior;

Creates a behavior that continuously accelerates a particle downward by a constant amount, simulating gravity.

strengthnumber

The downward acceleration, in px/s². A positive value pulls towards -y in particle space, which is down in screen space.