Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer
    
Nice, makes perfect sense. I can't wait to implement it and see how it goes, Thank You very much! –  tp0w3rn Nov 16 '10 at 15:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.