Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions GuessBot(UI)(levelManager)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LevelManager : MonoBehaviour
{
public void LoadLevel(string name)
{
Debug.Log("Level load requested for"+name);
Application.LoadLevel(name);
}


public void QuitRequest()
{
Debug.Log("I wanna quit!");
Application.Quit();
}
}
71 changes: 71 additions & 0 deletions GuessBot(UI)(main_script)
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

using UnityEngine;

using System.Collections;
using UnityEngine.UI;



public class GuessGame : MonoBehaviour {



public int max=1000,min=1,guess;

public int MaxGuesses=12;

public Text text;



void Start ()
{
StartGame();

}

void StartGame()
{
max=1000;
min=1;
nextguess();

}

public void nextguess()

{

guess = Random.Range(min,max+1);
text.text=guess.ToString();
MaxGuesses=MaxGuesses-1;
if(MaxGuesses<=0)
{
Application.LoadLevel("Win");
}



}


public void GuessHigh()
{

min = guess;

nextguess();

}

public void GuessLow()
{
max = guess;

nextguess();
}




}
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# UnityPublic
C#Scripts
C#Scripts for the game GuessBot(UI)
its a game where the bot will guess a number u choose in mind in between 1 to 1000.
Bot will have a certain number of tries.
If bot can't guess the Number You win, If it guesses the number You Lose.