How do I configure party characters

0 favourites
  • 7 posts
From the Asset Store
Helping streamers give their viewers more excitement.
  • Hello everybody!

    I'm doing a character party selection screen, but I don't know how to do for configure the select player's about the Health, Power, Speed, Sprite, etc, each player have different values.

    I try to find about it and I can use "IF" conditions, but if the party is 3 characters and I can select over 15 players, I should create 75 conditions for all configurations (15 for each player)!? if I create an update with other 15 characters I should do other 75 "IF" sentence!?

    How is the best way for do things like that?

    Thanks for help.

  • Do you have a sprite avatar for each character?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Do you have a sprite avatar for each character?

    I have a Family of Characters and each one have the configuracion about ATK, DEF, etc.

  • I would use JSON text for describing the state of your characters. Then you can use loops to iterate over a given state and do if statements on specific loops.

  • JSON? yeah! that seems a good way!! thanks, sure it's what I need

    But I was thinking about create a DataBase with all these characters, JSON let me get data from MySQL?

    Thanks.

  • You have to use AJAX GET requests to retrieve JSON text from your server.

    You can use PHP (or some other server-side language) to retrieve JSON from the database.

    Do a Google search for "Construct2 mysql database" to find tutorials.

    We use rex_hash to parse JSON state data, but I think the native Construct Dictionary object might work too.

    Other valuable search terms:

    php api tutorial -rest -soap

    php prepared statement mysql

    http get api parameters values

  • Okay, I'll find about it.

    Thanks for your help.

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