Procedural generated tile grid with arrays - How to do it?

0 favourites
  • 3 posts
From the Asset Store
Snap to visible grid - perfect solution for any game genre
  • hi everyone.

    So I was trying to learn how to work with arrays and tried to make a procedural generated tile grid, however and obviously, I still don't have the knowledge to do it.

    I tried to create a grid lets say, with objects in the array's Y coordinate from 1 to 6. After that, i wanted to generate an object in Y =7 and the Y=1 line was destroyed (I managed to do this last part). But for the rest, it always started and endless loop generating objects from 1 to 6, then from 1 to 7, then 1 to 8... I don't know if I'm explaining the problema very well, so I'll send the project file.

    Basically what I want is to create objects on the bottom side of the screen and destroy them in the upper part of the screen. Hope someone can help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi Ricardo,

    I highly recommend the post R0j0hound made in the conversation below:

    it looks like you have the right idea, however you may need to make some adjustments to the array values. For instance When I want to clear out a portion of the array, to make an open space, I can do this:

    [attachment=0:10ee9l5s][/attachment:10ee9l5s]

    MapForeground is the name of my array, and I want to clear the entire width of the array to a depth of 10. (11 cells). I hope this helps!

  • that method is so much better! I managed to do what I needed, thanks

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