How do I do Advanced Spawning and Randomization?

0 favourites
  • 4 posts
From the Asset Store
Advanced inventory mechanics for your RPG game (Array-based). Take Items, split them, pick up them, read the description
  • Hey guys! I'll try to explain this as best I can. I'm trying to spawn (x) amount of objects in a certain space, but I need specific objects to spawn, and the rest of the space to be filled with multiple instances of another object.

    I already have the space defined with an array, but now I need to manipulate how objects spawn within that array. Let's say I have a space like this :

    As you can see I have a 3x3 space of the same object, but let's say I want to inject two different objects into the 3x3 space, spawning in random available spaces in that 3x3 space and filling the remaining slots with our blue circle control group every time the layout is run, like this :

    or this :

    The problem isn't spawning the unique objects in random positions in the 3x3 space and filling the rest of the 3x3 space with one object with multiple instances. The problem is that when the unique objects spawn in the 3x3 space, there's a chance that they will overlap one another. Let's say I want to spawn 2 unique objects among the controlled object with multiple instances in the 3x3 space. I need a way to ensure that they won't spawn on the same tile If one unique objects spawns on one space, I need to make sure that the other object knows that space is no longer available to spawn on.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • just a thought...

    capx> http://s000.tinyupload.com/index.php?fi ... 5803457407

    (r200)

  • just a thought...

    capx> http://s000.tinyupload.com/index.php?fi ... 5803457407

    (r200)

    I love you. <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

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