Skip to content

Component Velocity

Drakim edited this page Oct 5, 2016 · 2 revisions

Description

While it's possible to have the appearance of movement by just repeatedly using the event "setPosition", the official way to move across the universe as opposed to repeatedly teleporting, is by using the "move" event. The "move" event is just a proxy for "setPosition", but other components that deal with moving and collisions will intercept the "move" event to apply their special logic.

Events

setVelocity (x:Int, y:Int)

addVelocity (x:Int, y:Int)

reduceVelocity (x:Int, y:Int)

increaseVelocity (x:Int, y:Int)

reverseVelocityX ()

reverseVelocityY ()

move (x:Int, y:Int)

update ()

Details

Update

Each update the velocity component gives the entity a "move" event with the x and y speed of the velocity component.