2D WorldGen

Here is my prototype world generation code:


I know it is not the most efficent design, but it is fast on my iPad 2, so it will run on pretty much anything.

Also, here are the sprites:


I plan on having the ability to save and load worlds, soon. It is just that it will take some time to do :slight_smile:

Could we have a screenshot please. Ps looks awesome with lost of potential(platformer, sandbox, 2d minecraft etc.)



Also, I doubt it is ready for being made into an actual game, since the terrain isn’t being regularly drawn, because it can slow it down to some degree. This is probably a problem with efficiency, but that is the only way to combat the slowness without completely rebuilding it.

what about just saving the values when u generate the terrain and the drawing it every frame

I am proud to present, the new version of the TerrainGen! It now has a bottom GUI with functioning Save/Load features, and the ability to save worlds! I hope you guys like it :slight_smile:

Any suggestions?

I would change out the sprites to mesh, and use 1 atlas texture. This would would remove any concerns about speed.

Currently there are none. Due to the fact that nothing but the GUI is drawn, it runs good on pretty much anything.

3.0.1 - Minor Tweaks for Trees and other sprites.

That is what I did.

The user and all related content has been deleted.

How are you generating the terrain? Could you use perlin noise?(looking good)

Sorry for the long break there @Coder. Here is a simplified version of what it does.

It picks a (pseudo)random value for the first height, between 1 and 500(?), then for each block height after it it does a random value for it that goes like this h2 = h1 + math.random(-hilliness,hilliness), over and over until you get to h19.

The biome values are different though. What they do is something like this; it has an average (which is a parameter you can set), and it either adds or subtracts a variation, depending on if the variation Is positive.

Phew! Sorry if that was hard to understand! You can look at the code if it is easier to understand how it works. It is under the tab generation.

And thanks! @NatTheCoder! I will be sure to continue tweaking it to make it better!

My next biggie is to make the terrain more varied and natural, adding more sprites and other stuff.