Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 2d platformer game map generation.
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Atherial




PostPosted: Thu Oct 08, 2015 7:20 pm   Post subject: 2d platformer game map generation.

What is it you are trying to achieve?
<Trying to make a randomly generated map that you can scroll around on, depending the direction your character is going. (For my motherload styled game.)>

What is the problem you are having?
I can only think of assigning a variable to each 64x64 pixel 2d block i put in, with a random int on each to choose what block it is.

Please specify what version of Turing you are using
4.11



Any recommendations on how I could achieve this. I thought of a series of variables that reach across the screen and move down after completing each layer too, but I need each 64x64 pixel section to be mineable, and I dont know how that would be possible doing such.
Thanks!
-Mac
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Fri Oct 09, 2015 2:17 pm   Post subject: RE:2d platformer game map generation.

This is a pretty complicated question. Randomly generated worlds aren't easy to make, even for 2D platformers. That said, it's not impossible and there are a lot of ways to do it. A big 2D array to store your block types would be a good place to start. Fill it up with dirt blocks, then insert ores/treasures/whatever randomly. How you pick where to put the stuff is up to you. Personally, I'd pick a level where each ore spawns at (say, copper spawns at 10 feet below ground). Give it an even distribution horizontally, but the further up or down you go from there the less likely it is to spawn. Or you could create 'hot spots' where a certain ore is more likely to spawn to get denser groupings of ores. You've got to think about how you want it to look and come up with a formula that will achieve it.
Atherial




PostPosted: Fri Oct 09, 2015 3:00 pm   Post subject: RE:2d platformer game map generation.

Thank you! Gonna work at learning arrays, for now no further help is needed unless anyone wants to add to this or recommend anything else, but again, thanks.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: