using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Game_Itself : MonoBehaviour {
public Text Gametext;
public int max;
public int min;
public int guess;
public Button higher;
public Button lower;
public Button equal;
public string endloader;
// Use this for initialization
void Start () {
max=50000;
min=1;
guess=(min+max)/2;
max=max+1;
Gametext.text = ("Is your number " + guess + "?");
}
// Update is called once per frame
public void Update ()
{
if (Input.GetKeyDown (KeyCode.UpArrow)) {
more ();
} else if (Input.GetKeyDown (KeyCode.DownArrow)) {
less ();
}
if (Input.GetKeyDown (KeyCode.Return)) {
nomore();
}
}
//it's all lowside
public void less(){
max=guess;
guess=(min+max)/2;
Gametext.text = ("Is your number " + guess + "?");
}
public void more() {
min=guess;
guess=(min+max)/2;
Gametext.text = ("Is your number " + guess + "?");
}
//It's gonna take a lot to drag me away from you..
public void nomore ()
{
Gametext.text = ("Your number is " + guess + ".\nTo replay press P");
if (Input.GetKeyDown (KeyCode.P)) {
Application.LoadLevel ("win");
}
}
}