Jump to content

Tilemap collision


Recommended Posts

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');
        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...

  • Recently Browsing   0 members

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