goowik Posted March 7, 2017 Share Posted March 7, 2017 Hi, I've been planning out my own Bomberman game. The idea is to make it multiplayer somewhere in the near future. As for the creation of the maps I liked the idea of using the TileMap functionality and have certain tiles reside in layers. But... having properties set for example in the application "Tiled" is not something I like or want to do. So my question is: When Phaser creates a Tile is their maybe a callback that can be used upon creation of each Tile to append function/methods? Or should I create my own TileMap class? The idea is for example to add functions on collision like: function update (target) { // target being the colliding player, bomb or any other entity teleportRandom(target); } I hope my question is clear enough Thanks in advance Link to comment Share on other sites More sharing options...
goowik Posted March 9, 2017 Author Share Posted March 9, 2017 bump Link to comment Share on other sites More sharing options...
drhayes Posted March 9, 2017 Share Posted March 9, 2017 You can add a custom collision method to the tiles you care about -- when something (e.g. the player) touches them it'll call your callback. The method you want is "Phaser.Tilemap.setTileIndexCallback". goowik 1 Link to comment Share on other sites More sharing options...
Recommended Posts