Commit 9a677b18 authored by mmaluschnig's avatar mmaluschnig
Browse files

player can only play during their turn, simon plays fair at start of his turn

parent 082e83a1
<Properties StartupConfiguration="{67A4F128-F6AC-CD88-DA35-F29416A0792A}|">
<MonoDevelop.Ide.ItemProperties.Assembly-CSharp PreferredExecutionTarget="Unity.Editor" />
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/TextFiles/Bavaria.txt">
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/Scripts/SimonScripts/Note.cs">
<Files>
<File FileName="Assets/TextFiles/TestMultiples.txt" Line="1" Column="1" />
<File FileName="Assets/Scripts/SpawnKeys.cs" Line="98" Column="112" />
<File FileName="Assets/Scripts/SpawnKeys.cs" Line="98" Column="33" />
<File FileName="Assets/Scripts/Key.cs" Line="17" Column="41" />
<File FileName="Assets/Scripts/TriggerManager.cs" Line="1" Column="1" />
<File FileName="Assets/TextFiles/Bavaria.txt" Line="5" Column="9" />
<File FileName="Assets/Scripts/SimonScripts/SimonScript.cs" Line="58" Column="34" />
<File FileName="Assets/Scripts/SimonScripts/NoteManager.cs" Line="31" Column="10" />
<File FileName="Assets/Scripts/SimonScripts/SimonGameManager.cs" Line="20" Column="57" />
<File FileName="Assets/Scripts/SimonScripts/Note.cs" Line="8" Column="33" />
</Files>
</MonoDevelop.Ide.Workbench>
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
......
......@@ -5,7 +5,7 @@ using UnityEngine;
public class Note : MonoBehaviour {
public float speed = 0.6f;
public float persistTime = 10;
public float persistTime = 40;
public float bobRate = 5;
public float bobScale = 0.5f;
......
......@@ -7,6 +7,7 @@ public class NoteManager : MonoBehaviour {
public Transform playerNoteSpawn;
public Transform simonNoteSpawn;
public bool playerTurn = false;
public GameObject note;
static Dictionary<string, Color> keytoColor = new Dictionary<string, Color>() {
......@@ -20,18 +21,24 @@ public class NoteManager : MonoBehaviour {
public void spawnNote(string noteVal)
{
GameObject thisNote = Instantiate(note, playerNoteSpawn);
thisNote.GetComponent<SpriteRenderer>().color = keytoColor[noteVal];
thisNote.GetComponent<Note>().type = noteVal;
SimonGameManager.PlayerPlayed(thisNote);
if (playerTurn)
{
GameObject thisNote = Instantiate(note, playerNoteSpawn);
thisNote.GetComponent<SpriteRenderer>().color = keytoColor[noteVal];
thisNote.GetComponent<Note>().type = noteVal;
SimonGameManager.PlayerPlayed(thisNote);
}
}
public void spawnSimonNote(string noteVal){
//maybe change to int val for simon
GameObject thisNote = Instantiate(note, simonNoteSpawn);
thisNote.GetComponent<SpriteRenderer>().color = keytoColor[noteVal];
thisNote.GetComponent<Note>().type = noteVal;
SimonGameManager.SimonPlayed(thisNote);
if (!playerTurn)
{
GameObject thisNote = Instantiate(note, simonNoteSpawn);
thisNote.GetComponent<SpriteRenderer>().color = keytoColor[noteVal];
thisNote.GetComponent<Note>().type = noteVal;
SimonGameManager.SimonPlayed(thisNote);
}
}
}
......@@ -54,6 +54,8 @@ public class SimonScript : MonoBehaviour
public void setSimonsturn(bool turn){
simonsTurn = turn;
playTime = Time.time;
noteManager.playerTurn = !turn;
nextNotePlay = Time.time;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment