I am developing some sophisticated platform game and stuck at level design task. The only way I know to create a model on the screen is to load ready model via loader. But it will be damn hard to create tens of levels this way. Since all my levels will look like this I think it is possible to describe them in JSON or XML. Whole level will be a bunch of different boxes and couple of invisible walls.
Any pointers how to do that?
PS. To do physics I am using bullet.
If you have Blender, then you should be able to design your levels there, export with collision geometry via YABEE, and use BulletHelper’s “fromCollisionSolids” method to generate Bullet collision geometry from the Panda-default geometry exported by YABEE.
However, if you do want to use a text-file approach, I would imagine that the thing to do would be to have a separate specification for each “track”, composed of “runs”; each “run” specifies the run-length and the height of the platform (if you want items or special tiles, then you might specify runs instead as sequences of tiles (with the length coming from the number of tiles in the sequence). Each “tile” could then specify anything special in it, such as ladders, enemies, collectables, etc.). When you read in the file, generate appropriate Bullet geometry for each run, and the sections of level between runs.