Jump to content

How to add additional logic to sprite vs tile map layer collision?


Recommended Posts

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


  • Recently Browsing   0 members

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