Character Selection

I'm working on a fighting game that's based on character selection and need a way to change the character you play as. What's the best way to be able to select an actor? Is it possible to change the actor's attributes as well, or can you only change the image?

Comments

  • UtopianGamesUtopianGames Member Posts: 5,692

    You could make a game.integer and set it to 1 then if you select the 3rd character change the game.integer to 3 then you can either change the images based on the integer or make all the characters as separate actors and simply do a rule to destroy them if the game integer doesn't match a self integer.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited January 2015

    Check out the "Airship Defender" game template that comes with GS. There´s one way of doing a character selection.

    Mental Donkey Games
    Website - Facebook - Twitter

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291

    Hello @Snoop1000,

    There are a zillion tutorials and templates on how to accomplish this but I will give you the basic.

    I would create a game integer attribute and call it something like; "Which_Character_Am_I"

    In your character actor, you can say;

    • When game.Which_Character_Am_I = 1; change image to (choose the desired image)

    • When game.Which_Character_Am_I = 2; change image to (choose the desired image)

    and so on for how ever many characters you have.

    (For the animations, you can have a rule that says;

    • When game.Which_Character_Am_I = 1; (have all of character 1's animations)

    • When game.Which_Character_Am_I = 2; (have all of character 2's animations)

    and so on for how ever many characters you have.

    ~NEXT~

    This all depends on how you are having the player pick his character. But essentially you would have this;

    In the first character image in the character select section, say;

    • When touch is pressed; change attribute game.Which_Character_Am_I; to 1

    In the second character image in the character select section, say;

    • When touch is pressed; change attribute game.Which_Character_Am_I; to 2

    and so on for how ever many characters you have.

    Hope that helps!

  • robertkdalerobertkdale USAMember Posts: 912
    edited January 2015

    TABLES. You can store character specific attributes inside the tables that are trigger by an event in game. I would store global boolean as well as Integer attributes.

    For example If character X is chosen change Char1 to true.

    If Char1 = true than load data from table X row one column 1,2).

    Also if Char1 is true than you can have your main character actor follow a specific set of rules based off of the Global attribute Char1 and call on special events triggered by attributes stored inside a table.

    You may also what to trigger a spawned actor as well. :)

    Big Smile Games Play Happy!
    Check out our other GameSalad exclusives.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    @robertkdale that's basically the way it's done in the airship defender template.

    Mental Donkey Games
    Website - Facebook - Twitter

  • robertkdalerobertkdale USAMember Posts: 912
    edited January 2015

    @NipaDidlt Thanks for letting me know! I will check it out. :)

    Just checked it out and it is a really good template. The coding techniques used are very useful. I have a few games that I am woking on now that use some similar techniques. GREAT TEMPLATE!

    Big Smile Games Play Happy!
    Check out our other GameSalad exclusives.

  • Snoop1000Snoop1000 Member Posts: 5

    Thanks for all the help!

Sign In or Register to comment.