Jump to content

Tilemap problem collidin with layer


eugenioclrc
 Share

Recommended Posts

Hello to everyone!!

 

I am making a small 2d  rpg / rogue like game.

 

I have make a map with two layers. One of the layers got the property collides.

 

So i do this in the create method;

 

    map.layers.forEach(function(l){      var layer=map.createLayer(l.name);      if(l.properties.hasOwnProperty('collides')){        map.setCollisionByExclusion([],true,layer);      }            layer.resizeWorld();    });    this.map=map;    

Then in the update method i add the collision;

// 1 is the ground layerthis.physics.arcade.collide(this.hero, this.map.layers[this.map.getLayer('wall')]);

I have make it work with other code, but why this isnt working?

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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