I'd like to know how others have handled the issue of storing the entity's position. (Or maybe it's not an issue and I just make it too complicated.)
I'm undecided on whether to store the position of each entity in the world map file or in the entity's script file. From what I figured, both approaches have their own good and bad points:
If you store the entity's position in the map:
- Good: Easier to edit the map; you can see where the entity will be. Maybe this isn't a problem for integrated map editors, but I'm using an external, general-purpose map editor (GLEED2D).
- Bad: Inside the game it's easier to handle data if the position is inside the entity object, not the map object. So when you load the game, you have to gather data from a lot of places to build your entity object.
On the other hand, if you store the position inside the entity script, the advantages and disadvantages are exactly the opposite of the above.