• Content Count

  • Joined

  • Last visited

About sharks

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hey, it's me from the thread you referenced. I've added my code and added some comments for you var overlapObjects ='Overlap')['objects']; //my Object layer was called Overlap let overlapObjectsGroup ={ }); let i = 0; overlapObjects.forEach(object => { let obj = overlapObjectsGroup.create(object.x, object.y, 'grass'); obj.setScale(object.width/32, object.height/32); //my tile size was 32 obj.setOrigin(0); //the positioning was off, and B3L7 mentioned the default was 0.5 obj.body.width = object.width; //body of the physics body obj.body.height = object.height; }); overlapObjectsGroup.refresh(); //physics body needs to refresh console.log(overlapObjectsGroup);, overlapObjectsGroup, this.test, null, this);
  2. sharks

    Overlapping on a Tilemap Object Layer

    That makes sense, you're a lifesaver! I'm unsure how to setOrigin on a layer created using `` as it's body so for now, hardcoding works.
  3. I asked a similar question - might be helpful
  4. sharks

    Overlapping on a Tilemap Object Layer

    Alright that was correct indeed regarding Tile ID. It's such a weird solution though, considering we may have any number of objects in a layer and we won't possibly know the IDs assigned to them. Right now, the overlap works. But the coordinates shown in Tiled for the object and the map are off. It's above where it should be on the map. I tried converting the coordinates using WorldToTileX/Y but didn't work. Any thoughts? For anyone who has the same question in the future, this is how a single large object in object layer can be scaled (minus the position offset issue) var overlapObjects ='Overlap', 2, { key: 'overlap_item' }); var ladders ={ key: 'ladders', setXY: { x: overlapObjects[0].x, y: overlapObjects[0].y }, setScale: { x: overlapObjects[0]._scaleX, y: overlapObjects[0]._scaleY } }); //obviously this needs to be looped as there might be multiple objects
  5. sharks

    Overlapping on a Tilemap Object Layer

    Thanks, that makes sense. When it says object ID 26, what does it mean? Could you please share a screenshot of it from tiled? And your object conversion method looks nice. I'll give it a try shortly.
  6. Hi guys, I have several layers on my map and I have an "Overlap" object layer which has a rectangle created around tiles. Now when the player (physics sprite) walks on it, I would like to trigger events. I'm unable to detect if the user is walking on it or not and would like some help. Thanks.
  7. sharks

    Creating & Switch Tilemaps dynamically

    You guys were absolutely correct. Stopping & Creating a scene works wonderfully and it's the solution I'm going with. Thanks!
  8. sharks

    Creating & Switch Tilemaps dynamically

    Alright, will give it a try tonight. Thanks. :)
  9. Hi guys, I've worked on a part of the system which loads multiple layers for a given tile map for a key "Map A" (All of them are static). Now at some time, I'd like to move the user to the next map with key "Map B". What's the best way to destroy a tilemap/layers and recreate the world? Thanks, S