+ 1
Make a game with turns
Hi all! I am looking to some ideas to code a game. Is a simple game for 2 players. I have to think how to code the game not the code itself. Example a guess the number game: Player 1 first chance, then player 2 repeat till one player guess the number. Is not about how to guess the number I need help thinking in the player turns. Thanks!
2 Answers
+ 14
Have a counter for the number of turns. So it starts off like this:
var turn = 1;
loop{
if(turn%2==0)
playerOneGuess();
else
playerTwoGuess();
turn++;
}
So keep looping until a player guesses correctly.
+ 1
Thank you I will try to use that to make a 3 players game. One select the number and the other 2 try to guess.