HI , just make my first ever project on phaser 3. I am making a feeding frenzy like game , and i still confuse on how to detect collision between my player fish with pointer controlled and enemy fish with array image ? . Sorry for my bad english ,thanks for ur help!
var GetBounds = Phaser.Display.Bounds.GetBounds;
var RectangleToRectangle = Phaser.Geom.Intersects.RectangleToRectangle;
for (var fish of fishes) {
if (RectangleToRectangle(GetBounds(player), GetBounds(fish))) {
// …
}
}
I would be easier with physics though.