grandnaguszek Posted November 30, 2017 Share Posted November 30, 2017 I am making a platformer game with Phaser 2.9.2 where the map is loaded from a JSON file and am having difficulty trying to make interactive tiles which are replaced by a new tile with a collision from a single-direction. I have found a function which allows me to control the direction of collision direction of tiles, so I am hoping to find out how to activate a function and replace individual tiles when there is the sprite and tile are overlapping. I have been thinking of adding the tiles individually in JSON with unique properties and using the .createFromObjects method, but I want every tile to have the same properties and the potential to make multiple stages. So I am hoping there is way to activate a function when the players sprite overlaps with the tile, and in the function it replaces that individual tile with another tile from the tilemap. Link to comment Share on other sites More sharing options...
grandnaguszek Posted December 4, 2017 Author Share Posted December 4, 2017 No one has any idea's? Link to comment Share on other sites More sharing options...
Fenopiù Posted December 5, 2017 Share Posted December 5, 2017 Have you tried to put your tiles in a group (so they can have the same properties) and make a function for the on collide event that replace the tile collided with the next one?? Link to comment Share on other sites More sharing options...
samme Posted December 5, 2017 Share Posted December 5, 2017 You can modify the tiles in place if you just need to change the collision directions. Otherwise see http://phaser.io/examples/v2/tilemaps/replace-tiles. Link to comment Share on other sites More sharing options...
Recommended Posts