Jump to content

One way collision on tilemaps


BenClarkson
 Share

Recommended Posts

Hey, I am hard at work on my game "Space Cat" and I have some questions about one way collision on tilemaps. Like, is there a way to do this without making the one way colliding tiles into immovable objects (which I assume isn't TERRIBLE, it still uses the quadtree but it has to update more variables).

I have a collision tilemap in two layers, one with "ground" and "walls" and one for one way platforms. The problem is how the tilemap body is handled isn't super clear.

I was thinking of writing an extension of the collide function to specifically deal with this. 

Any help would be groovy.

Link to comment
Share on other sites

  • 4 weeks later...

 

yup!

tile.collideLeft = false;tile.collideRight = false;tile.collideUp = true;tile.collideDown = false;tile.faceUp = true;tile.faceDown = false;tile.faceLeft = false;tile.faceRight = false; 

 

I am curious to know if there is any difference/preference between this and setCollisionhttp://docs.phaser.io/Phaser.Tile.html#setCollision

Currently I'm having problems getting collideDown to work at all.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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