Jump to content

Question about the overlap function


TheBlackSword
 Share

Recommended Posts

Quick question about the overlap function. Does it only return as true when the two bodies initially overlap and not after, even if they still overlap? Or does it return as true during the entire duration of the overlap? 

My test code indicates the former, but maybe I'm doing something wrong. 

if(game.physics.arcade.overlap(this.enemySprite, player_sprite))
{
	game.debug.text('enemy and player overlap', 10, 10);
}
else
{
	game.debug.text('enemy and player do not overlap', 10, 10);
}

Practical application is that I have bullets randomly passing through enemies, and I thought this was one possible explanation. 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...