I am curious to know some of you have gone about implementing moving platforms in your games, whether you use a custom tile map system or Tiled.
I am currently looking to write a TileMap system and can imagine two possible ways of handling moving platforms:
- I can animate the platform tiles within the tile map by manipulating the map array. This could be a nightmare to manage as each platform will have different constraints on how and where it moves, but I can handle entity collisions with the platforms in the same way as all other tiles, which would be nice.
- I create objects external from the TileMap system, which would be nice in the way of setting their travel paths, speeds and the like, but handling collisions would be more difficult
With my previous attempt at a tile map system, I handle collisions by updating entity velocity and then processing the x and y components separately, adjusting the velocity magnitude if a blocked tile is in the path of travel. If I have moving platforms as external objects, then would it be as simple as to check both the map and a list of moving platform objects during this collision checking process?