Opponent attack.

Hi everyone. I'm creating a game and I would like to integrate its internal fights like pokemon. the problem is that I can not do attack the opponent automatically. can anyone help or have a referral link?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I can not do attack the opponent automatically
    You're going to have to be more specific and focused in terms of your question. What exactly are you having problems coding? Attacking an opponent automatically can mean many things such as choosing a card from your hand, looking up the card's data from a table, comparing two cards to each other, determining when a turn begins and ends, updating health/score/etc. Which part are you wanting help with?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • advicegamesadvicegames Member Posts: 27
    I can not do attack the opponent automatically
    You're going to have to be more specific and focused in terms of your question. What exactly are you having problems coding? Attacking an opponent automatically can mean many things such as choosing a card from your hand, looking up the card's data from a table, comparing two cards to each other, determining when a turn begins and ends, updating health/score/etc. Which part are you wanting help with?
    the battle is structured as follows: each character has attacks (buttons). when you press a button, your character does the attack selected. at this point is the opponent's turn. the opponent must select attacks itself but since the system will have to be random. I can not seem to pass the turn to the opponent and select the attack at random.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    To change turns, you'll need to represent whose turn it is somehow. I recommend an integer. Set it to 0 initially and then to 1 when it is player 1's turn, and then to 2 when it is player 2's turn (or the computer's turn).

    To randomly select something, Google random table gamesalad and you'll find methods for doing this.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • advicegamesadvicegames Member Posts: 27
    thank you very much. I managed to create turns. I'm studying now how to do the attacks with the tables.
Sign In or Register to comment.