move(dir: number | Vec2, speed: number): EmptyComp

Move towards a direction infinitely, and destroys when it leaves game view.

paramdir- The direction to move towards.

paramspeed- The speed to move at.

requires

// enemy throwing feces at player
const projectile = add([
    sprite("feces"),
    pos(enemy.pos),
    area(),
    move(player.pos.angle(enemy.pos), 1200),
    offscreen({ destroy: true }),
])

returnsThe move comp.

sincev2000.0

kaplay logo

Misc

Layer