wojo1086 Posted June 22, 2017 Share Posted June 22, 2017 I have this code: map = GameService.game.add.tilemap('ground'); //map.addTilesetImage('main-tileset', 'tiles'); map.addTilesetImage('base_out_atlas', 'tiles1'); map.addTilesetImage('build_atlas', 'tiles2'); map.addTilesetImage('obj_misk_atlas', 'tiles3'); map.addTilesetImage('terrain_atlas', 'tiles4'); baseLayer1 = map.createLayer('Sub1'); baseLayer1.resizeWorld(); baseLayer2 = map.createLayer('Sub2'); baseLayer2.resizeWorld(); baseLayer3 = map.createLayer('Sub3'); baseLayer3.resizeWorld(); initPlayer(); baseLayer4 = map.createLayer('Super1'); baseLayer4.resizeWorld(); baseLayer5 = map.createLayer('Super2'); baseLayer5.resizeWorld(); baseLayer6 = map.createLayer('Super3'); baseLayer6.resizeWorld(); collisionBodies = GameService.game.physics.p2.convertCollisionObjects(map, 'Collisions'); I'm sure you can see what it's doing, but basically, I create a few layers, initialize my player, create a few more layers, and then convert my Tiled object layer into collision objects. My question is, what do I do with `collisionBodies`? Will `convertCollisionObjects` put the objects onto the map? It should by default, right? Does `convertCollisionObjects` give my objects bodies? I think they do, but my player is not stopping when he touches them. Am I supposed to write a function to handle what actually happens when they collide? Sorry for all the questions, I can't find an example of this in use in the documentation. Link to comment Share on other sites More sharing options...
wojo1086 Posted June 24, 2017 Author Share Posted June 24, 2017 Anybody? Link to comment Share on other sites More sharing options...
Recommended Posts