问题
I'm trying to write rts-like-tile-based game using Tiled and slick2d.
I don't know how to handle a multi-tile objects, like buildings, how to create, keep and e.g. move them.
回答1:
One solution would be to create a layer in tiled where the tiles are used as "markers" for your game code. These "markers" are never drawn. Instead, when you initialize your game, go through the the tiled map and every time a corresponding marker is found add a "new Building()" to some kind of EntityManager class. This way you can write the code for the class Building yourself, and instead of it being completely static tile you can move it around like you would any other entity. This also lets you make these buildings any arbitrary size independently of any tile sizes.
来源:https://stackoverflow.com/questions/14307668/multi-tile-objects-on-tiled-map