Jump to content

Collision detection issues


Zef
 Share

Recommended Posts

Hi there,

 

So I have been developing a game for a university assignment with phaser and it has been going great. I am currently experiencing an issue with physics and collisions and I was wondering if somebody could help. I know the physics in the 1.1.6 are still meant to be a bit ropey in areas but even still I think there must be something wrong.

 

I have number of rocks that have been added to a group and on each update I am calling: 

game.physics.collide(player.sprite, [rocks, gates]);

The issue is this is working very inconstantly. It works most of the time but sometimes the player is able to pass right through the rock objects, I have attached two screen shots demonstrating.

 

Could this be something to do with the order that I am colliding the player in relation to when I call the players update function?

 

Thanks in advance for any help :)

post-7386-0-78558900-1394388772.png

post-7386-0-77187200-1394388781.png

Link to comment
Share on other sites

Actually, my problem is not solved yet :/ . I am making a game like hockey . user score a goal with dragging itself into the ball to bring forward the ball. I use collide function. but when users stick touches the ball , stick and ball enter to each other like your bird and rocks (is it bird or bee? ).  

Link to comment
Share on other sites

Hehe its supposed to be a bee :) I promise it isn't just another flappy bird clone!! 

 

I think I have got things to work again now. Using a sprite.scale.y = -1 causes the issue as well as using negative values in sprite.body.setPolygon.

 

Very weird

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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