asset

This property is used to attach an image or animation to a collider. It will make a copy of it that it holds internally.

Examples

const exampleAsset = $.loadImage(
    0, 0,  //x and y
    "/images/sir_cheesealot.png"  //filepath
);
const example = $.makeCircleCollider($.w/2,$.h/2,50);
example.asset=exampleAsset; //.asset can be given an image or animation
function update() {
    example.x += 1;
    if(example.x > $.w) {
    example.x = 0;
    }
    example.draw();
}