velocity.x

gets/sets the x velocity

Examples

const img = $.loadImage(
    $.w/2, 
    $.h/2,
    "/images/sir_cheesealot.png"
);
img.velocity.x = -4;

function update() {
    img.draw();
    if(img.x < 0) {
        img.x=$.w;
    }
}