diff --git a/.DS_Store b/.DS_Store index 45d8885..b8fcd3b 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Simon/Assets/.DS_Store b/Simon/Assets/.DS_Store index 5008ddf..5033093 100644 Binary files a/Simon/Assets/.DS_Store and b/Simon/Assets/.DS_Store differ diff --git a/Simon/Assets/Scenes/simon.unity b/Simon/Assets/Scenes/simon.unity index f0a9af2..33b3ff5 100644 Binary files a/Simon/Assets/Scenes/simon.unity and b/Simon/Assets/Scenes/simon.unity differ diff --git a/SimonSays_Wolf.zip b/SimonSays_Wolf.zip index a1d91fe..0034925 100644 Binary files a/SimonSays_Wolf.zip and b/SimonSays_Wolf.zip differ diff --git a/SimonSays_Wolf/.DS_Store b/SimonSays_Wolf/.DS_Store index 62062a5..eceb5d7 100644 Binary files a/SimonSays_Wolf/.DS_Store and b/SimonSays_Wolf/.DS_Store differ diff --git a/SimonSays_Wolf/Scripts/Simon.cs b/SimonSays_Wolf/Scripts/Simon.cs new file mode 100644 index 0000000..43ef907 --- /dev/null +++ b/SimonSays_Wolf/Scripts/Simon.cs @@ -0,0 +1,200 @@ +using UnityEngine; +using System.Collections; +using UnityEngine.UI; + +public class Simon : MonoBehaviour { + + public int button = 0; + public GameObject redButton; + public GameObject greenButton; + public GameObject yellowButton; + public GameObject blueButton; + public GameObject start; + public GameObject gameOverText; + + public bool isPlayer = false; + + + + public int level = 1; + public int playerIndex = 0; + public bool isPlaying = true; + public int[] computerSequence; + //int ComputerSequence [100]; + //int PlayerSequence [100]; + + + + public int ButtonComp = 0; + + // Use this for initialization + void Start () { + computerSequence = new int[400]; + for (int level = 0; level < 400; level++){ + ButtonComp = Random.Range (0, 4); + computerSequence[level] = ButtonComp; + + } + + } + + //RED + + public void red () { + redButton.GetComponent ().Play(); + redButton.GetComponent ().color = new Color (1f, 0.45f, 0.45f); + Invoke ("RedbuttonNormal", 1); + + if (isPlayer == true) { + if (computerSequence [playerIndex] == 0) { + playerIndex++; + checkIfPlayerRight (); + } else { + GameOver (); + } + } + } + + public void RedbuttonNormal () { + redButton.GetComponent ().color = Color.red; + } + + //GREEN + + public void green () { + greenButton.GetComponent ().Play(); + greenButton.GetComponent ().color = new Color (0.369f, 0.875f, 0.431f); + Invoke ("GreenbuttonNormal", 1); + + if (isPlayer == true) { + if (computerSequence [playerIndex] == 1) { + playerIndex++; + checkIfPlayerRight (); + } else { + GameOver (); + } + } + + + + } + + public void GreenbuttonNormal () { + greenButton.GetComponent ().color = new Color (0.055f, 0.816f, 0.149f); + } + + +// YELLOW + + public void yellow () { + yellowButton.GetComponent ().Play(); + yellowButton.GetComponent ().color = new Color (0.988f, 0.996f, 0.376f); + Invoke ("YellowbuttonNormal", 1); + + if (isPlayer == true) { + if (computerSequence [playerIndex] == 2) { + playerIndex++; + checkIfPlayerRight (); + } else { + GameOver (); + } + } + + + + } + + public void YellowbuttonNormal () { + yellowButton.GetComponent ().color = new Color (0.949f, 0.961f, 0f); + } + + // Blue + + public void blue () { + blueButton.GetComponent ().Play(); + blueButton.GetComponent ().color = new Color (0.42f, 0.325f, 0.945f); + Invoke ("BluebuttonNormal", 1); + + if (isPlayer == true) { + if (computerSequence [playerIndex] == 3) { + playerIndex++; + checkIfPlayerRight (); + } else { + GameOver (); + } + } + + + + } + + public void BluebuttonNormal () { + blueButton.GetComponent ().color = new Color (0.184f, 0.043f, 0.961f); + } + + public void checkIfPlayerRight () { + if (playerIndex == level) { + level++; + startGame (); + playerIndex = 0; + } + } + + public void GameOver () { + gameOverText.SetActive(true); + } + + public void reStart () { + gameOverText.SetActive(false); + isPlayer = false; + + + + level = 1; + playerIndex = 0; + isPlaying = true; + + + } + + + public void startGame () { + gameOverText.SetActive(false); + isPlayer = false; + for (int i = 0; i < level; i++) { + if (computerSequence [i] == 0) { + Invoke ("red", i+2); + } + + if (computerSequence [i] == 1) { + Invoke ("green", i+2); + } + + if (computerSequence [i] == 2) { + Invoke ("yellow", i+2); + } + + if (computerSequence [i] == 3) { + Invoke ("blue", i+2); + } + } + Invoke ("isPlayerTest", level+2); + + } + + + public void isPlayerTest () { + isPlayer = true; + } + + + + + + + // Update is called once per frame + void Update () { + + + } +} diff --git a/SimonSays_Wolf/Scripts/Simon.cs.meta b/SimonSays_Wolf/Scripts/Simon.cs.meta new file mode 100644 index 0000000..c58623d --- /dev/null +++ b/SimonSays_Wolf/Scripts/Simon.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: e75a8e76b54c84d1887e24bfead0b12c +timeCreated: 1476216025 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: