GreatSprites is in preparation. Join early access for two free tests at launch.
GreatSprites Early access

Docs

Moments

Named frames inside a clip, such as impact or release, that fire events in your game on the exact frame.

A clip can carry named moments: impact, release, land, or your own names. The element emits each one as an event on the frame it marks, with the clip's name as the second argument.

hero.on('impact', (moment, clip) => camera.shake(0.3));
await hero.play('punch');

To wait for a moment rather than the end of the clip:

await hero.play('throw', { until: 'release' });
launchProjectile();

Speed and moments

With speed above 1 the clip plays faster, and its moments still arrive on their frame. Nothing is skipped, so sound cued on a moment stays with the motion.

← Playing clipsCharacters →