animate(opt?: AnimateCompOpt): AnimateComp

A component to animate properties.

paramopt- Options for the animate component. See

let movingBean = add([
      sprite("bean"),
      pos(50, 150),
      anchor("center"),
      animate(),
]);

// Moving right to left using ping-pong
movingBean.animate("pos", [vec2(50, 150), vec2(150, 150)], {
    duration: 2,
    direction: "ping-pong",
});

returnsThe animate comp.

sincev3001.0

kaplay logo

Misc

Layer