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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

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