goowik Posted March 7, 2017 Report 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 Quote Link to comment Share on other sites More sharing options...
goowik Posted March 9, 2017 Author Report Share Posted March 9, 2017 bump Quote Link to comment Share on other sites More sharing options...
drhayes Posted March 9, 2017 Report 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.