Jump to content

Tilemap collision


Squall
 Share

Recommended Posts

Hello!
I am working with Phaser and having some problem to collide sprite with tiles, the sprite can walk through everything.

on create:

map = game.add.tilemap('ninomap');
   		map.addTilesetImage('tilesheet', 'tilesheet'); 
    	ground = map.createLayer('background');
        ground.resizeWorld();
        wcollide = map.createLayer('walls');

        map.setCollision(1624, true, wcollide);

Where 1624 is the index of tile to collide.

I've been looking the posts on this forums, but couldn't get it to work yet, so i'm asking for help to understand the collide system on Phaser and how can i get my sprite to collide with certain tile indexes or layers.
 

Link to comment
Share on other sites

  • 1 year later...
 Share

  • Recently Browsing   0 members

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