Jump to content

Overlap not being detected


fitness23
 Share

Recommended Posts

I am enable to detect 2 overlapping objects for some reason, but I've always been able to do it before.

 

The page in question is here = http://www.andy-howard.com/prison-purge/index.html

 

I have set arcade physics = this.game.physics.startSystem(Phaser.Physics.ARCADE);

 

I have also enabled physics on the 2 objects in questions:

 

this.game.physics.arcade.enable(this.feet);

and

this.game.physics.arcade.enable(this.walkingBoundaries);

 

And then in the update function I have set: this.game.physics.arcade.overlap(this.feet, this.walkingBoundaries, stopPlayer, null, this);

 

 

I'd just like to know when the players feet overlap with the green line but it doesn't seem to work.

The only things that I am doing differently compared to what I normally do it overlapping with a line instead of a sprite, and also the movement is based on a tween not velocity - but I don't think that should make any difference.

Link to comment
Share on other sites

Hello,

I think physics and tweens kinda don't go well together if you are not changing physics values (velocit, ...). You can check overlaping by tween movement (change in x/y) in other way see phaser example.

 

EDIT:

Try setting movement by body.velocity and check wheter or not your overlap goes off to, if it doesn't work then there is a problem elsewhere.

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...