How do I create random blocks generators like in Minecraft

0 favourites
  • 5 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • 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?

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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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..

  • 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

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)