1 decade ago by norashishi
IMPACT defines the mouse coordinates
For example
This function in a sub class of
Cheers!
{x: 0, y: 0} so if some entity is at the point the mouseover event will be executed unexpectedly in the beginning. The coordinates should be defined with Number.NEGATIVE_INFINITY or something which is far from common numbers instead of 0 I guess.For example
_overlapped: function() {
return ig.input.mouse.x + ig.game.screen.x > this.pos.x &&
ig.input.mouse.x + ig.game.screen.x < this.pos.x + this.size.x &&
ig.input.mouse.y + ig.game.screen.y > this.pos.y &&
ig.input.mouse.y + ig.game.screen.y < this.pos.y + this.size.y;
}
This function in a sub class of
Entity returns true if the entity is overlapping 0, 0 in the beginning even if the actual mouse cursor is not there.Cheers!
