reliosvitini's Forum Posts

  • 1 posts
  • Hello,

    Actually it quite hard for me to describe my problem in title. So i will try here.

    I have three arrays ( all XY)

    array 1: X coordinates array ( has coords for X position of the object for creation)

    array 2: Y coordinates array ( has coords for Y position of the object for creation)

    array 3: and Position array ( has information like 0 and 1 in which positions to generate object)

    I have field 6 x 6. Where random 4 cells have 1 and others 0.

    I want to check which cells have 1 in it, then take this cell coordinates - and generate object by using coordinates of X and Y positions from first two arrays.

    Too bad it looks like that i can't use simple For each XY element of array 3 and put inside System create object X Array2name.CurX Y Array2name.CurY since i'm doing it in another array.

    I also can't store these Cell coordinates in values and then use create object X Array1name.ValueName Y Array1name.Valuename cause it only wants CurX or CurY.

    Any hints how to solve it.. if anyone understood what i want from these arrays.

    Or maybe there are more simply way... My goal is :

    i have grid of 6x6 elements. In each "cell" of this grid i want to spawn an object. Those are enemies..

    But i also want to generate a "free passage" tunnel from left to right by removing some of the objects in this grid that will make path for player. I want it to be randomly generated (example: it starts on second row..then follows 3 cells, then goes one down and then goes to end right..) each time it can be generated randomly on which row it starts, where this twist will be.

    Right now i'm stuck :(

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1 posts