mr kglad here i am again, collision and mousemove
I i try implementing the chiken invaders GUI in my little crappy game, and all went well spachip moves fine, shoots, and kills spaships, but unlike with buttons control, now the hitTest wont execute, unless i clic on the bad spaceship, i try puting it in its own event, switch it to the move event, on top or down of the mousemove code, but execution is the same, if i hover player, over enemy1 nothing happens, unlest i clic on it and then the alert works 😞
this.on("tick", moverPlayerMou.bind(this));
function moverPlayerMou(evt) {
var pt = this.enemy1.hit.localToLocal(this.enemy1.hit.dot1.x,
this.enemy1.hit.dot1.y, this.player.box);
if (this.player.box.hitTest(pt.x, pt.y)) {
alert("collision")
this.player.x = -1000
deadenemies++
}
this.player.x = stage.mouseX;
this.player.y = stage.mouseY;
}
heres the file
https://drive.google.com/file/d/1BXvg3b931cB8KKeEjWcmyeVYqUsYwyEF/view?usp=sharing
