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
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 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?
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.
tatiangMember, Sous Chef, PRO, Senior Sous-ChefPosts: 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.
Comments
To randomly select something, Google random table gamesalad and you'll find methods for doing this.