Search code examples
2d-gamestiledtmx

How to make mystery box like in mario games in Tiled map Editor?


I'am making simple platformer (C++, Tiled). But dont't understand how to implement mystery box. It must be an object or tile? If it better to be tile, then how animate tiles in tmx map.


Solution

  • Assuming you want to predetermine what will come out of the mystery box, it will be easier to use an object (can be a tile object) and not a plain tile on a tile layer. This is because you can associate a custom property with a tile object, to tell your game which item should come out.

    Alternatively, you can use different tiles for each mystery box, but render them all the same in your game. This would allow you to quickly see where you put which item in the editor.

    Using an object in your game rather than a plain tile should make it easier to animate it. But, you can always wait with creating such an object until the point where it is necessary.