Object Count

0 favourites
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • cant this be done with families ?

    Stuff all balls in 3 identical families.

    Families instance variable color

    3 way collision, same color balls

    event

    fam1 overlapping fam2

    fam1.color = fam2.color

    fam2 overlapping fam3

    fam2.color = fam3.color

    fam3 overlapping fam1

    fam3.color = fam1.color

    action

    fam1 destroy

    fam2 destroy

    fam3 destroy

    In theory this should be able to destroy the 3 balls with the same colors overlapping.

  • You should try it because that's how you learn. Why don't you make an attempt, upload it, and when I get home in 10 hours I will look at it and fix it if it's not working.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • God knows that I will have tried hundreds of times to no avail <img src="smileys/smiley11.gif" border="0" align="middle" />

  • If you upload your best attempt (using my original example) to figure out how split up the groups of overlapping objects so that each group only spawns one other sprite, I can take a look at it and help in getting it to work

  • Instance Variables

    Boolean: Red1 touching Red2 (R1R2) = false

    Boolean: Red1 touching Red3 (R1R3) = false

    Boolean: Red2 touching Red3 (R2R3) = false

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

    IsColliding(Red2) with (Red3) - Set R2R3 (true)

    Else R2R3 (false)

    IsColliding(Red1) with (Red2) - Set R1R2 (true)

    Else R1R2 (false)

    IsColliding(Red1) with (Red3) - Set R1R3 (true)

    Else R1R3 (false)

    Then you will want to do something like this:

    R1R2(true) - Red1.destroy, Red2.destroy, Red3.destroy

    (condition) R2R3 (true)

    (condition) R1R3 (true)

  • I do not understand some things that you put up, you can explain it better.

    It took all day yesterday trying

  • give those balls instance variables.

    1. ball color (as u wish)

    2. ball collision (number) = 0

    If the blue ball collides with another blue ball make the "ball collision" instance counting up.

    If the ball collision is 2 them destroy them.

    The next steps are depending on your game design, so i can't say exactly how u have to do it.

    But i think you need a every second event which decreases the ball collision number by 1 when its higher than 0.

  • I made this several days ago but was hoping you would try to work through the example yourself so you can figure out what's going on, and ask specific questions about where your attempts failed so we can help you understand the logic and make you a bit more independent <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">.

    Since that hasn't happened, here's the cap (only done for the red blocks), hopefully that's enough to get you going enough to be able to make any other modifications on your own.

    Any 3 or more red blocks that touch together in any sort of formation (they don't all have to touch each other, just be part of a connected group) are destroyed, and a new red block forms at a location of their average X and average Y

    https://dl.dropboxusercontent.com/u/308 ... merge.capx

  • Thanks for everything

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