How do I open several doors with multiple buttons by using families ?

0 favourites
From the Asset Store
With this template you will learn how to use the GooglePlay Games native plugin
  • I think that I am on the right track with what proposed but there is still a problem with the functions :

    If I put one of the characters on a blue button, it's OK the blue doors are moving. Then, If I put the second character on another blue button, nothing else happens and this is the expected behavior, so it's OK ! BUT, if I removed only one of the two characters from a blue button, the doors go back to their positions even if the other character is still on a blue button.

    If someone has any idea to fix that, it could be very cool because I'm lost ! Thank you !

  • From my file remove the trigger once from the first few events

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OK, I tried and there is a little trembling movement but I think i can fix it. Thank you for helping. It was pretty useful !

  • I updated the file, now the buttons are all pressed at the same time if one of the two characters is standing on one of them. I think it is more logical and understandable for the player.

    Now, my only concern is about this trembling movement when one of the two characters is leaving a button which is already pressed. It's just a matter of polish.

  • Is there a way to pick my buttons like this ?

    "Pick all buttons where instance variable color is the same"

    In order to create this event :

    "If all buttons of the same color are not overlapping at offset a character = close the doors of this color".

  • Yes, you would have multiple conditions in the same event.

    The first condition would be

    Family Buttons - Color = "blue" (for example)

    Family buttons - is not overlapping character

    The second condition would work with only the conditions picked in the first condition, which are, only the instances where the family instance variable "Color" is of value "blue".

  • Thank you Kyatric I understand your answer, sorry I didn't explain my question very well.

    In fact, because I will have a lot of buttons with the same behavior but of different colors, I would like to avoid to repeat the event for each color. So yes, it works if I use :

    Family Buttons - Color = "blue"

    +

    Family Buttons - Color = "red"

    +

    Family Buttons - Color = "green"

    and so on...

    But what I would like to to is to create an event in which it is written :

    "Pick all buttons where instance variable color is equal to the color of the current instance"

    In other words, I would like to have this event :

    "- For each button

    - Pick all other buttons of the same color

    - If none of them is pressed

    Action = deactivate all the doors of this color".

  • Have an array.

    Set each index to contain a word (0 = blue, 1 = red, 2 = cyan, etc...).

    Check back my previous answer, add the array condition "For each X element" as first condition.

    As second event, use the "Check Family button instance variable color" and check if its value is equal to array.at(array.curX).

    This will loop through all the colors contained in your array, picking all instances with this color, and does so in a single event.

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