How do I link characters?

  • Hello there!

    I'm working on my first in-depth project after being out of games coding for years!

    I'm making a top down Gauntlet style game it's based on an old Sega game called Gain Ground.

    When a character's health drops to 0 I'm trying to do the following:

    Change the normal sprite to a 'defeated' sprite (I can do this bit)

    But I'm having a load of characters in the game. So the idea is that you can rescue a downed character, but it needs to remember which character is downed & rescueable.

    Do I have to just manually do this for each player sprite, or can it be grouped somehow?

    So there are character objects - P1, P2, P3 (for example) which need downed objects (D1, D2, D3)

    I'm hoping that makes sense!

  • I guess you could put them all in a family named "characters" or something and give each individually their "alive" and their "downed" animations with the same names for each.

    Make a group variable that checks if the health is 0, and then say "if Characters family variable is equal to 0, set animation to downed"

    That should work I think :)

  • Assuming the characters are all separate objects you can put them all in a family then give the family a boolean instance variable named "Downed". Set the boolean to "true" when in the save event you set their animation.

    You can pick all of them in an event with "Is boolean set"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you both! I'm going to bhave a play around with those ideas this week.

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