dchhetri Posted December 5, 2013 Share Posted December 5, 2013 This is the image, the blue is collidable with the sprite. As you can see, there is some space between the actual character and the blue tile. The character sprite is 32x32 as well as the blue tile. What I wanted to do was to adjust the collision handler so that the sprite can move say 5px more to the left in the below case. Is this possible right now? I was looking at some example and thought the following would work:function processCallback(a,b,c,d,e){ if(a.body.facing == Phaser.LEFT){ //do extra collision logic } return true; } this.game.physics.collide(sprite,layer2,collideCallback,processCallback);But that does not work, meaning that even if processCallback returned false, the two images still collides. Anyone have any advice on how to achieve this? Link to comment Share on other sites More sharing options...
jcs Posted December 5, 2013 Share Posted December 5, 2013 make the sprite's physics bounding box narrower by setting its 'body.width' to be narrower (& adjust 'body.offset.y', if necessary) dchhetri 1 Link to comment Share on other sites More sharing options...
dchhetri Posted December 5, 2013 Author Share Posted December 5, 2013 Perfect thanks, I tried that before but I must have done something wrong. Link to comment Share on other sites More sharing options...
Recommended Posts