diff --git a/Assets/Bounce.cs b/Assets/Bounce.cs new file mode 100644 index 0000000..0de4379 --- /dev/null +++ b/Assets/Bounce.cs @@ -0,0 +1,49 @@ +using UnityEngine; +using System.Collections; + +public class Bounce : MonoBehaviour { + + public GameObject button; + + public bool pressed = false; + public bool collide = false; + int count = 0; + + + void Start() + { + + + } + void Update() + { + if (collide) + { + if (count == 0) + { + pressed = true; + Debug.Log("ON"); + count++; + } + + } + } + + void OnTriggerEnter2D(Collider2D col) + { + + Debug.Log("Enter"); + + collide = true; + Debug.Log(collide); + + + } + void OnTriggerExit2D(Collider2D col) + { + collide = false; + pressed = false; + Debug.Log("Exit"); + count = 0; + } +} diff --git a/Assets/Bounce.cs.meta b/Assets/Bounce.cs.meta new file mode 100644 index 0000000..e4fbac3 --- /dev/null +++ b/Assets/Bounce.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ef0e79fb86b774046ba26f23dac0383f +timeCreated: 1460091985 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/BowlsButton.cs b/Assets/BowlsButton.cs index 2c07b75..ca0ae65 100644 --- a/Assets/BowlsButton.cs +++ b/Assets/BowlsButton.cs @@ -3,46 +3,46 @@ public class BowlsButton : MonoBehaviour { - public GameObject button; + public GameObject button; - public bool pressed = false; - public bool collide = false; - int count = 0; - //GameObject pressureplate1 = GameObject.FindGameObjectWithTag("pressureplate1"); - void Start() - { + public bool pressed = false; + public bool collide = false; + int count = 0; + //GameObject pressureplate1 = GameObject.FindGameObjectWithTag("pressureplate1"); + void Start() + { - } - void Update() - { - if (collide) + } + void Update() { - if (count == 0) + if (collide) { - pressed = true; - Debug.Log("ON"); - count++; - } + if (count == 0) + { + pressed = true; + Debug.Log("ON"); + count++; + } + } } - } - void OnTriggerEnter2D(Collider2D col) - { + void OnTriggerEnter2D(Collider2D col) + { - Debug.Log("Enter"); + Debug.Log("Enter"); - collide = true; - Debug.Log(collide); + collide = true; + Debug.Log(collide); - } - void OnTriggerExit2D(Collider2D col) - { - collide = false; - pressed = false; - Debug.Log("Exit"); - count = 0; - } + } + void OnTriggerExit2D(Collider2D col) + { + collide = false; + pressed = false; + Debug.Log("Exit"); + count = 0; + } } diff --git a/Assets/Moving Note.unity b/Assets/Moving Note.unity new file mode 100644 index 0000000..6ada44e Binary files /dev/null and b/Assets/Moving Note.unity differ diff --git a/Assets/Moving Note.unity.meta b/Assets/Moving Note.unity.meta new file mode 100644 index 0000000..a39188f --- /dev/null +++ b/Assets/Moving Note.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 82e484c9f1644fe4c90520a3df8cb75b +timeCreated: 1460086088 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MovingNote.cs b/Assets/MovingNote.cs new file mode 100644 index 0000000..f6d4804 --- /dev/null +++ b/Assets/MovingNote.cs @@ -0,0 +1,123 @@ +using UnityEngine; +using System.Collections; +using System.Collections.Generic; +using System; + +public class MovingNote : MonoBehaviour { + + SpriteRenderer sr, ss; + public GameObject SimonSaysSwitch; + public GameObject sb1, sb2, sb3, sb4, sb5; + List sequence = new List(); + List bpressed = new List(); + public GameObject door; + bool b1 = false, b2 = false, b3 = false, b4 = false, b5 = false; + + int state = 0; + int rnd = 0; + + + void Start() + { + // Get a reference to the SpriteRenderer so that we can change the button's color. + gameObject.SetActive(true); + sequence.Add(4); + sequence.Add(3); + sequence.Add(2); + sequence.Add(1); + sequence.Add(0); + + } + + // Update is called once per frame + void Update() + { + if (SimonSaysSwitch.GetComponent().pressed == true) + { + bpressed.Clear(); + //sequence.Clear(); + SimonSaysSwitch.GetComponent().pressed = false; + + } + + if (sb1.GetComponent().pressed == true && sb2.GetComponent().pressed == false && + sb3.GetComponent().pressed == false && sb4.GetComponent().pressed == false && + sb5.GetComponent().pressed == false) + { + Debug.Log("ORANGE"); + sb1.GetComponent().pressed = false; + bpressed.Add(4); + } + + if (sb1.GetComponent().pressed == false && sb2.GetComponent().pressed == true && + sb3.GetComponent().pressed == false && sb4.GetComponent().pressed == false && + sb5.GetComponent().pressed == false) + { + Debug.Log("PINK"); + bpressed.Add(3); + sb2.GetComponent().pressed = false; + } + + if (sb1.GetComponent().pressed == false && sb2.GetComponent().pressed == false && + sb3.GetComponent().pressed == true && sb4.GetComponent().pressed == false && + sb5.GetComponent().pressed == false) + { + Debug.Log("YELLOW"); + bpressed.Add(2); + sb3.GetComponent().pressed = false; + } + + if (sb1.GetComponent().pressed == false && sb2.GetComponent().pressed == false && + sb3.GetComponent().pressed == false && sb4.GetComponent().pressed == true && + sb5.GetComponent().pressed == false) + { + Debug.Log("GREEN"); + bpressed.Add(1); + sb4.GetComponent().pressed = false; + } + + if (sb1.GetComponent().pressed == false && sb2.GetComponent().pressed == false && + sb3.GetComponent().pressed == false && sb4.GetComponent().pressed == false && + sb5.GetComponent().pressed == true) + { + Debug.Log("BLUE"); + bpressed.Add(0); + sb5.GetComponent().pressed = false; + } + + + if (bpressed.Count > 4) + { + if (sequence[0] == bpressed[0]) + { + Debug.Log("b1 = true"); + b1 = true; + } + if (sequence[1] == bpressed[1]) + { + Debug.Log("b2 = true"); + b2 = true; + } + if (sequence[2] == bpressed[2]) + { + Debug.Log("b3 = true"); + b3 = true; + } + if (sequence[3] == bpressed[3]) + { + Debug.Log("b4 = true"); + b4 = true; + } + if (sequence[4] == bpressed[4]) + { + Debug.Log("b5 = true"); + b5 = true; + } + if (b1 == true && b2 == true && b3 == true && b4 == true && b5 == true) + { + GameObject.Destroy(door); + } + } + // Debug.Log(bpressed[0] + bpressed[1] + bpressed[2] + bpressed[3]); + } +} diff --git a/Assets/MovingNote.cs.meta b/Assets/MovingNote.cs.meta new file mode 100644 index 0000000..88f1264 --- /dev/null +++ b/Assets/MovingNote.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 4d6aa3181e543964da66a46ebfdbf136 +timeCreated: 1460087032 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/MovingStringNotes.cs b/Assets/MovingStringNotes.cs new file mode 100644 index 0000000..86b5f5d --- /dev/null +++ b/Assets/MovingStringNotes.cs @@ -0,0 +1,43 @@ +using UnityEngine; +using System.Collections; + +public class MovingStringNotes : MonoBehaviour +{ + + public Transform point1; + Vector3 start; + Vector3 end; + public float speed = .05f; + bool x = true; + int counter = 0; + + + void Update() + { + + if (counter == 0) + { + start = new Vector3(point1.position.x, point1.position.y - 6.5f, point1.position.z); + end = new Vector3(point1.position.x, point1.position.y + 6.5f, point1.position.z); + } + + if (point1.position == end) + { + x = false; + } + else if (point1.position == start) + { + x = true; + } + if (point1.position == end || x == false) + { + transform.position = Vector3.MoveTowards(point1.position, start, speed); + counter += 1; + } + else if (point1.position != end) + { + transform.position = Vector3.MoveTowards(point1.position, end, speed); + counter += 1; + } + } +} diff --git a/Assets/MovingStringNotes.cs.meta b/Assets/MovingStringNotes.cs.meta new file mode 100644 index 0000000..34bfafa --- /dev/null +++ b/Assets/MovingStringNotes.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8056171297414354485d2e59d7e1fa53 +timeCreated: 1461103035 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/NoteSwitch.cs b/Assets/NoteSwitch.cs new file mode 100644 index 0000000..55ac090 --- /dev/null +++ b/Assets/NoteSwitch.cs @@ -0,0 +1,43 @@ +using UnityEngine; +using System.Collections; + +public class NoteSwitch : MonoBehaviour { + + public bool stepped; + int state = 0; + public bool pressed; + + void Start() + { + + stepped = false; + pressed = false; + + } + + void Update() + { + // If the player is colliding with the button and E is pressed, advance the state. + // This check should be placed in Update() instead of one of the below functions + // since Update() executes more frequently and is less likely to cause missed checks. + if (stepped && Input.GetKeyDown(KeyCode.E)) + { + Debug.Log("ON"); + pressed = true; + } + } + + // NOTE: Set the Player object's RigidBody2D -> Sleeping Mode to Never Sleep, otherwise + // the collision check will eventually stop due to the player object going to sleep. + void OnTriggerStay2D(Collider2D other) + { + if (other.gameObject.tag == "Player") + stepped = true; + } + + void OnTriggerExit2D(Collider2D other) + { + if (other.gameObject.tag == "Player") + stepped = false; + } +} diff --git a/Assets/NoteSwitch.cs.meta b/Assets/NoteSwitch.cs.meta new file mode 100644 index 0000000..3951e08 --- /dev/null +++ b/Assets/NoteSwitch.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 8bcbb6245683035429fbd3e2346df5b5 +timeCreated: 1460086893 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/NotesButton.cs b/Assets/NotesButton.cs new file mode 100644 index 0000000..a6d4f61 --- /dev/null +++ b/Assets/NotesButton.cs @@ -0,0 +1,47 @@ +using UnityEngine; +using System.Collections; + +public class NotesButton : MonoBehaviour { + public GameObject button; + + public bool pressed = false; + public bool collide = false; + int count = 0; + //GameObject pressureplate1 = GameObject.FindGameObjectWithTag("pressureplate1"); + void Start() + { + + + } + void Update() + { + if (collide) + { + if (count == 0) + { + pressed = true; + Debug.Log("ON"); + count++; + } + + } + } + + void OnTriggerEnter2D(Collider2D col) + { + + Debug.Log("Enter"); + + collide = true; + Debug.Log(collide); + + + } + void OnTriggerExit2D(Collider2D col) + { + collide = false; + pressed = false; + Debug.Log("Exit"); + count = 0; + } +} diff --git a/Assets/NotesButton.cs.meta b/Assets/NotesButton.cs.meta new file mode 100644 index 0000000..e2dbf09 --- /dev/null +++ b/Assets/NotesButton.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 82a79b195e274c847a3147e07296885e +timeCreated: 1460086369 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/PlaceholderObj/HorizontalCorridorPuzzle.prefab.meta b/Assets/Prefabs/PlaceholderObj/HorizontalCorridorPuzzle.prefab.meta index 892aec2..49ebd24 100644 --- a/Assets/Prefabs/PlaceholderObj/HorizontalCorridorPuzzle.prefab.meta +++ b/Assets/Prefabs/PlaceholderObj/HorizontalCorridorPuzzle.prefab.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8226cc434bbc0c34495c88b56205f186 +guid: 089582538120f2d4cb41b6f18cc668ce timeCreated: 1457603059 licenseType: Free NativeFormatImporter: