Function

move

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

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

param dir- The direction to move towards.

param speed- The speed to move at.

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

returns The move comp.

since v2000.0

group Components

requires

kaplay logo

Layer

Miscalenous