How to interact with different object spawned instances

0 favourites
  • 5 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • I'm doing a game where there are objects spawning (didn't implement that yet), and when those objects are clicked they go into a grid, which i'm making by taking the image points of a grid sprite i made and assigning the clicked object's position to each corresponding image point.

    The problem i'm facing now though is that when I have a grid "filled" by those objects there is gonna spawn another grid instance, of the same grid sprite, where i can keep assigning objects into, however i don't know how to keep creating other instances in relation to the last created so i can make up a grid of grids, in order to get to the second part of the game.

    This is a screenshot of what i have so far

    Any help is greatly appreciated

  • 'however i don't know how to keep creating other instances in relation to the last created so i can make up a grid of grids, in order to get to the second part of the game.' what ?

  • Sorry, that was confusing, I mean at the end i'll be making a larger grid that has all those sprites inside of it, including the grid sprites with the clickable objects.

    So there'll be grids inside of a larger grid that I want to make by spawning those one beside the other, sry that's confusing me too..

    So at the end would be something like this, with each "Grid" containing 9 clickable objects:

    Grid | Grid | Grid

    ------------------

    Grid | Grid | Grid

    ------------------

    Grid | Grid | Grid

    But I'm not sure how to get each instance of the "Grid"'s to position them in that pattern once they're being spawned one by one.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would probably do this with hierarchies. Assuming that all objects stored in small grid are instances of the same sprite (say, Icons), you can create a hierarchy with SmallGrid + 9 icons on an unused layout. Then you can spawn the entire hierarchy with all icons already in place. Filling it will be a matter of setting the correct animation for each icon. Maybe you can store these animations in an array or something.

    Or you can even prepare the whole thing (BigGrid + 9 SmallGrids + 9*9 icons) on the layout in advance, and hide most of them. When you need to reveal the big grid - make them all visible.

  • I could do that, but the clickable objects can vary and won't initially be attached to the grid, they'll be randomly positioned, that's why i'm setting them to go as they're clicked, so that I can assign which ones go in each space of the grid.

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