I'm currently working on a unique "game" project. Check out the code snippet here: jsfiddle
function update() {
coyote.applyForce(gravity);
coyote.edges();
coyote.update();
cactus.update();
if (coyote.intersects(cactus)){
alert("colision");
}
}
One issue I've encountered is that when the coyote character jumps, the div size increases and creates blank spots causing unintended collisions.
I'm looking for possible solutions to improve collision detection. I've thought about implementing an inner hitbox, but haven't quite figured out how to do it yet. Any suggestions?