Hello fellow community, I am a hobby programmer and have decided to try and make a 2d side scroller in XNA & C#. the problem that I have is how in general ate levels created? Ist it all programmatically, does this mean I need to create a level maker and register every position of every objects ? Or is every level in a game created using random numbers? Or is there another solution?
Thank you very much! Cheers
Pattyfatieo
Question about level programming
Side scrollers should write streaming data from a file to a round buffer that is used as a circle to avoid moving data.
To save space in a desert or ocean, run length encoding can be used to compress levels.
The solid world should be a 2D tile array so that detecting collisions does not have to check against every tile in the world.
Only things that are moving should store positions but they are created and destroyed when needed.
A level editor can be fun for the player but without randomly generated levels, you will only have a few hours before you must play the same levels again.
In case that you want to play the same random level again, use a deterministic random generator with a userdefined seed.
To save space in a desert or ocean, run length encoding can be used to compress levels.
The solid world should be a 2D tile array so that detecting collisions does not have to check against every tile in the world.
Only things that are moving should store positions but they are created and destroyed when needed.
A level editor can be fun for the player but without randomly generated levels, you will only have a few hours before you must play the same levels again.
In case that you want to play the same random level again, use a deterministic random generator with a userdefined seed.
Have a look at something like http://www.mapeditor.org/
Free software, people have said nice things about it; defn saves you writing your own.
If you have your heart set on writing your own, you could just write something that reads text files and (say) beautifies the output.
So # means put a ladder section here, % is earth, O is a rock _ means a thin grass cover, etc. The loader could pick randomly one of several variants for each of the tiles.
Then you can edit the levels in emacs or visual studio or something.
Free software, people have said nice things about it; defn saves you writing your own.
If you have your heart set on writing your own, you could just write something that reads text files and (say) beautifies the output.
So # means put a ladder section here, % is earth, O is a rock _ means a thin grass cover, etc. The loader could pick randomly one of several variants for each of the tiles.
Then you can edit the levels in emacs or visual studio or something.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement