h

gets/sets the current height of the collider. For a circle collider it will always have the same width/height so updating one updates the other.

Examples

const circleExample = $.makeCircleCollider(75, 75, 50);
circleExample.fill="blue";
const boxExample = $.makeBoxCollider(75,75,150,50);
circleExample.fill="orange";

function update() {
    boxExample.h -= 1;
    //a collider throws an error if its width is set to 0
    if(boxExample.h <= 1) { 
        boxExample.h = 150;
    }
    boxExample.draw();
    $.colour.fill="black";
    $.text.print(75,$.h/2-10,"box w"+boxExample.h.toString());
    
    //when the w of a circle collider is changed the h is also updated, and vice versa.
    circleExample.h += 1;
    if(circleExample.h > $.h){
        circleExample.h = 25;
    }
    circleExample.draw();
    $.colour.fill="black";
    $.text.print(75,210,"circle w"+circleExample.h.toString());
}