Jump to content
  • Advertisement
Sign in to follow this  
Pattyfatieo

Unity Question about level programming

This topic is 2630 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!