How do I create random blocks generators like in Minecraft

Get help using Construct 2

Post » Mon Jun 01, 2015 5:10 pm

Hi All,

I am trying to create a game like minecraft but in 2D. It would be something like mine blocks 2D from Zanzlanz.

The idea is to have a character walking around breaking blocks, picking stuff up and creating/crafting new items.
That part is easy to do. The hardest part is to randomly generate the blocks efficiently and properly.
I thought about adding the blocks myself but the game experience would not be the same.

I have seen some stuff in the forum but nothing solid. Have anyone tried something like this before and wouldn't mind sharing with us?
B
122
S
50
G
24
Posts: 401
Reputation: 22,462

Post » Mon Jun 01, 2015 5:26 pm

The terrainGen.capx from this thread is pretty good..

viewtopic.php?f=147&t=120451&p=862291&hilit=terrain#p862291
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jun 01, 2015 5:57 pm

@LittleStain

It is nice but it only create one type of block. I am sure it would be pretty hard to create a variety of types.
Also, in games like Minecraft the levels have different types of blocks. For example, you can only find diamond in a very deep level.
B
122
S
50
G
24
Posts: 401
Reputation: 22,462

Post » Mon Jun 01, 2015 7:58 pm

Than you should change it to incorporate more types of blocks..
Right now the array is filled with 0's and 1's, maybe adding 2's and 3's and 4's could be used to add more materials?
And if diamond is only found in a deep level you might want to add a condition
"If level is deep add diamonds"
So only if level is deep ( I guess you know when a level is deep and are able to tell the computer when that is) add the number 5 to the array (assuming number 5 is diamond)

If this all is a bit too much, you might want to opt for creating the levels yourself inside the tilemap-object and or array..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Jun 01, 2015 8:58 pm

Yeah. I will study the code to see if it makes sense do it or create the levels manually.
If you stumble upon anything else please let me know
B
122
S
50
G
24
Posts: 401
Reputation: 22,462


Return to How do I....?

Who is online

Users browsing this forum: beohs, blackhornet, MadSpy, tunepunk and 12 guests