I'm having trouble understanding how I would implement a moving platform in the actual map file. Lets say its a file of character's and maybe the letter 'P' would stand for Platform. Then, how would the game know which direction it moves, how far it's suppose to move before returning, what size it is, etc... Am I even suppose to represent it in the map file?

I'm coming from the approach of making the game handle the maps as dynamically as possible, where you could basically make a new map file and play it in the game without having to hard code any special information for that map.


1 Answer 1


Well obviously you need more than just a single character for your moving platform. Try just putting a chunk at the end of the file for all your dynamic objects that need more data. Maybe it's a block of XML or JSON for easy parsing. Then you just need to say "there's a moving platform at X,Y that looks like Z and moves to Z,W over Q seconds" or whatever data you need.

  • \$\begingroup\$ Nice, makes perfect sense. I can't wait to implement it and see how it goes, Thank You very much! \$\endgroup\$
    – tp0w3rn
    Nov 16, 2010 at 15:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .