Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
gstuitje
RingMaster
Commits
9a677b18
Commit
9a677b18
authored
Jan 24, 2019
by
mmaluschnig
Browse files
player can only play during their turn, simon plays fair at start of his turn
parent
082e83a1
Changes
6
Hide whitespace changes
Inline
Side-by-side
RingMaster/RingMaster/.vs/RingMaster/xs/UserPrefs.xml
View file @
9a677b18
<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"
/>
...
...
RingMaster/RingMaster/.vs/RingMaster/xs/sqlite3/storage.ide-shm
deleted
100644 → 0
View file @
082e83a1
File deleted
RingMaster/RingMaster/.vs/RingMaster/xs/sqlite3/storage.ide-wal
deleted
100644 → 0
View file @
082e83a1
File deleted
RingMaster/RingMaster/Assets/Scripts/SimonScripts/Note.cs
View file @
9a677b18
...
...
@@ -5,7 +5,7 @@ using UnityEngine;
public
class
Note
:
MonoBehaviour
{
public
float
speed
=
0.6f
;
public
float
persistTime
=
1
0
;
public
float
persistTime
=
4
0
;
public
float
bobRate
=
5
;
public
float
bobScale
=
0.5f
;
...
...
RingMaster/RingMaster/Assets/Scripts/SimonScripts/NoteManager.cs
View file @
9a677b18
...
...
@@ -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
);
}
}
}
RingMaster/RingMaster/Assets/Scripts/SimonScripts/SimonScript.cs
View file @
9a677b18
...
...
@@ -54,6 +54,8 @@ public class SimonScript : MonoBehaviour
public
void
setSimonsturn
(
bool
turn
){
simonsTurn
=
turn
;
playTime
=
Time
.
time
;
noteManager
.
playerTurn
=
!
turn
;
nextNotePlay
=
Time
.
time
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment