[solved] would using a family solve this?

  • hello again!

    i've been struggling to fix this over the past few days:

    what i want to happen:

    • spawn 1 ground piece,
    • spawn 1 gap piece,
    • repeat
    • i will eventually expand this to spawn ground pieces and gap pieces of set sizes but randomly so i have been using a spawn sensor to detect when they no longer overlap to spawn the next one. so when the ground piece no longer overlaps the sensor, spawn a gap, when the gap piece no longer overlaps the sensor spawn a ground piece.

    would using a family solve this? (my thought is "pick all family" "family is not overlapping sensor"

    or is there a better way to generate terrain, randomly but in sequence like this?

    CAPX

    picture of code for those without r117

    sidenote: i will be buying a license eventually, i just wanted to wait until i had a game closer to completion but if families can solve this i would consider buying one now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Didn't look at your Capx yet, and beeing a noob to Construct 2 myself I'm not sure if this helps. Hoping so.

    I created a family (Heroes) of several sprites.

    Then I created heroes with something very similar to this:

    system -> Create object Heroes on layer 1 (10,10)   

    =First hero needs a postition

    system -> Create object Heroes on layer 1 (Heroes.X+60,Heroes.Y)

    system -> Create object Heroes on layer 1 (Heroes.X+60,Heroes.Y)

    = The rest of the heroes are created randomly from the Heroes family with a dynamic position referred from the latest instance of Heroes. I only created three, but the principle should work with, for example, a For loop.

    Just set the first instance of family somewhere and loop the rest.

  • Tumba - thanks for the reply!

    i have solved it using UID's and families, sticking the platform creation under one event and adding two events with a "checker" variable to set to 1 or 0 depending on what is touching the sensor. woohoo!

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