bounciness

controls the bounciness of the collider

Examples

const A = $.makeCircleCollider($.w/2-30,50,20);
A.fill = "#54d89f";
A.direction = 180;
A.friction = 0;
A.speed = 30;
A.bounciness = 20;

const C = $.makeCircleCollider($.w/2+30,50,20);
C.fill = "rgba(160,54,68,1)";
C.friction = 0;
C.direction = 180;
C.speed = 30;

const floor = $.makeBoxCollider( $.w/2, $.h-20, $.w, 20);
floor.static = true;

const ceiling = $.makeBoxCollider( $.w/2, 20, $.w, 20);
ceiling.static = true;

function update() {
    A.draw();
    C.draw();
    A.collides(floor);
    C.collides(floor);

    A.collides(ceiling);
    C.collides(ceiling);
    floor.draw();
    ceiling.draw();
}