Hi Scratchers,
I am trying to make a world generator.
Here are some facts:
What type?: Planetary (Completely 360 World Generator), 2D
ow many types of ore? 5: Diamond, Gold, Granite, Rock, and Soil
Should some be rarer than others? How much rarer?: It's in order from rare to most common
Should the rarer ores be more common as you go deeper? Yes they should.
Offline
This looks amazingly similar to another thread I've seen today. Anyway, something like this will store it in an array:
Just keep adding more if statements in order of least rare to most rare. You'll get a grid that is basically 2 dimensional. To access an item on the grid, use this:deleteall ▼ofgrid ▼setito0repeatwidth*heightchangei ▼by1setdepth ▼toroundi/width-0.5set# ▼topick random1todepth*100if#<40play around with these numbers for rarity.adddirttogrid ▼elseif#<170addstonetogrid ▼elseif#<200addgranitetogrid ▼
item zero has the coordinates (1,0) (remember, "y" begins at zero, and "x" begins at one)itemof+y*widthxgrid ▼
Last edited by MoreGamesNow (2012-04-03 21:01:13)
Offline