Jump to content

Issue with Sprite vs Sprite collision - Phaser 1.1.4


Mefteg
 Share

Recommended Posts

Hello everybody,

 

I have an issue with a Sprite vs Sprite collision (Phaser 1.1.4 - Master branch).

I don't know why but my player only collides with the bottom of the rock.

 

You can see the problem here : http://folia-game.herokuapp.com/index-dev.html

 

The 2 scripts involved are player.js and rock.js (you can see the code with your developer tools too).

 

The rock is immovable and I call the "game.physics.collide()" in the update function of Rock (in rock.js).

 

As you can see on the image below, my player has a specific bounding box (done with the sprite.body.setRectangle() function).

 

post-5541-0-07951600-1392136932.png

 

I tried but I can't figure it out. Please, help me :)

 

Thank you.

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