Luke JL Posted April 2, 2014 Share Posted April 2, 2014 Hello,I'm trying to make a strategy tiled-based game, where each tile can be terrain or building (eg. road, meadow, forrest, road, farm, barracks, woodcutter hut etc.) I want to create a user interface, where player would have various tools e.g. "build", "bulldoze/destroy" so that he/she could change the landscape of the game and create buildings etc.. Technicaly - to put new tiles on map I'm using map.putTile. And this works OK. But... How can I remove a tile? The problem is I don't see in TileMap an option to remove tiles, so I started wondering: am I doing it wrong? Should I use TileMap to create objects like farm or road that can be destroyed during gameplay? Or maybe there is a way to remove an individual tile from map? Link to comment Share on other sites More sharing options...
drhayes Posted April 3, 2014 Share Posted April 3, 2014 Can you put an empty tile? If the user is building in empty space then add the empty space back in? Like, add the grass tile instead? Link to comment Share on other sites More sharing options...
Luke JL Posted April 6, 2014 Author Share Posted April 6, 2014 thx, I put empty tile now. And I saw similar advice in this topic: http://www.html5gamedevs.com/topic/5212-breakable-tiles-in-phaser-2/ , so I guess it is good way to do it. Link to comment Share on other sites More sharing options...
Recommended Posts