Jump to content
This forum will be closing down. Please move to the respective dedicated project forums.

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


dchhetri
 Share

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?

 

HEdUclu.png

 

 

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

 Share

  • Recently Browsing   0 members

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