Hello guys, my first time here. Sorry for my english!
I noticed on my game that sometimes it was setting the first limite after the inicial guess in a wrong way. For exemple:
The game asks at begining if the number was 361; I press Lower; and the game asks if it is 545!?!
I noticed that it is happening only with the first guess.
So I put some “print” statements on the console showing the current value of the variables max, min, and guess to figure out what was going on. I found out the at the Start function, the game is modifying the variable guess 2 times. It is using the first value to make the limite, and displaying the second value on UI Text. Here a print of the exemple above:
You can replicate the logs on your game by adding this lines on the NextGuess() function:
void NextGuess () {
guess = Random.Range(min,max+1);
text.text = guess.ToString()+"?";
maxGuesses=maxGuesses-1;
if(maxGuesses<=0){
Application.LoadLevel(“Win”);
}
print ("guess = "+guess);
print ("max = "+max);
print ("min = "+min);
}