Jump to content

tile maps added to a group


Recommended Posts

i have been trying to add a tile map to a group so that when i destroy a level and add a new one. the player doesnt go behind the layer. it adds the tile map to the screen but the collision doesnt happen.

levels = this.add.group();        //add tilemap to the game using preloaded json file        map = this.add.tilemap('level');        //add an image to the map to be used as a tileset	map.addTilesetImage('tileTest', 'tiles');	//create a new TilemapLayer object and add it to the map, maps can have multiple layers	map.setCollision([1,2,4,5,6,7,8]);	layer = levels.create(map.createLayer('Tile Layer 1'));
Link to comment
Share on other sites


  • Recently Browsing   0 members

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