example/bundle.js
// determine if an AABB is fully inside the level dimensions
determine if an AABB is fully inside the level dimensions
determine if an AABB is fully inside the level dimensions
contains(aabb) {
    const minPadding = 1 
    if ((aabb.x < minPadding) || (aabb.y < minPadding)) {
      return false
    }
    if (((aabb.x + aabb.width) > (this.design.dimensions.width - minPadding)) ||
    ((aabb.y + aabb.height) > (this.design.dimensions.height - minPadding))) {
      return false
    }
    return true
  }
contains ( aabb ) { const minPadding = 1 if ( ( aabb . x < minPadding ) || ( aabb . y < minPadding ) ) { return false } if ( ( ( aabb . x + aabb . width ) > ( this . design . dimensions . width - minPadding ) ) || ( ( aabb . y + aabb . height ) > ( this . design . dimensions . height - minPadding ) ) ) { return false } return true }
determine if an AABB is fully inside the level dimensions
determine if an AABB is fully inside the level dimensions
// ensure there is a 1 unit border around the level edge