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.
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 }), ])
returns
The move comp.
since
v2000.0