Hello forum!
I'm looking my way around to load a level.
I did this quite some times already. However, this time I need a bit more of information to be loaded.
One time, I used XML and realised, it is too verbose for my undertaking.
Another time, I was going with a simple 0 1 0 2 0 0 0 0 ... per line for the physics. Each number describing how it shall behave.
Additionally providing a graphics file, telling what graphics sheet to use and which coordinates for which tile.
This time, it is a bit different.
I have objects, that have a function, when they are being hit by the player and a different one when hit by the mouse.
Therefore, every object in the level-file will create its own Lua object, this will subscribe to its needed processes in the C++ engine.
Now, how would I do this rather "clean"?
Every object needs the following information:
- Position (x, y)
- Event-Trigger (varying: on_entry, on_click, in_front, ...)
- Animation-Sheet path
- Graphics-path
Now, I feel like parting these pieces of information can become a bit messy.
Parting in terms of handling one file for every important piece.
On the other hand, having it all in one place... can become very verbose.
I'm planning to replace manual editing with a level editor anyway!
Though, I'm trying to think about an elegant way to implement the way the level is stored.
Any suggestions to provide a rather quick loading for this matter?
Thanks for reading my thread! : )