Make the ball bounce up when the player taps it.
View code
game.animateBounce(ball, 160, 600);
Make things bounce, spin, blink, burst into pieces, and come back together.
Try each example, then copy the words under it and paste them to your AI. You can also send your AI the link to an example.
Move an object without writing any physics.
Make the ball bounce up when the player taps it.
game.animateBounce(ball, 160, 600);
Make the crystal float gently up and down.
game.animateFloat(crystal, 40, 1200);
When a coin is collected, make it fly in an arc to the score.
game.animateArc(coin, score.x, score.y, 180, 700);
Leave a fading trail behind the ball while it moves fast.
game.animateTrail(ball, { durationMs: 900, spacingMs: 30, fadeMs: 300 });
Draw the eye to something that just happened.
Make the heart pulse when the player gains a life.
game.animatePulse(heart, 1.3, 300);
Shake the gem when the player taps it too early.
game.animateShake(gem, 16, 400);
Flattens on impact or stretches before a jump, which makes objects feel soft and alive.
Make the ball squash when it lands and stretch as it jumps again.
game.animateSquash(ball, 1, 120, () => game.animateStretch(ball, 1, 120));
Spin the star when it is collected.
game.animateRotation(star, 360, 800);
Show, hide, and warn without removing anything abruptly.
Fade the gem out slowly when it disappears.
game.animateAlpha(gem, 0, 700);
Make the player blink for a moment after being hit.
game.animateBlink(heart, 5, 900);
Make the crystal flicker like a broken light.
game.animateFlicker(crystal, 1000);
Make the star appear with a wipe from left to right.
game.animateWipe(star, { mode: "reveal", direction: "left-to-right", durationMs: 700 });
The showiest effects: an object cut into pieces that fly, dissolve, or come together.
Make the gem burst into pieces when the player taps it.
game.animateExplode(gem, { rows: 4, cols: 4, speed: 320 });
Make the coin assemble from flying pieces when it appears.
game.animateAssemble(coin, { rows: 4, cols: 4, durationMs: 800 });
Make the crystal crumble away from left to right when it is used up.
game.animateDisintegrate(crystal, { rows: 8, cols: 8, direction: "left-to-right" });
Make the star build itself up from bottom to top when the level starts.
game.animateIntegrate(star, { rows: 8, cols: 8, direction: "bottom-to-top" });