Fix hovering when roaming

This commit is contained in:
Luke Murphy 2020-02-09 20:01:03 +01:00
parent 5ab451e862
commit 33df91f7d3
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -451,7 +451,11 @@ function draw() {
let shape = shapes[i];
// if hovering over the shape, play the recorded sound
let hovering = collidePointPoly(mouseX, mouseY, shape.vectors);
let hovering = collidePointPoly(
mouseX - screenX,
mouseY - screenY,
shape.vectors
);
if (hovering === true) {
if (shape.hover === false) {
shape.sound();