You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dfd3021
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/star-seek.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,17 @@ The star seek mini-game uses gaze + head position to collect stars that appear a
5
5
## Main objects / values to edit during play testing
6
6
7
7
-**StarSeekManager**: values related to the overall win condition of the game
8
-
- Game time limit
8
+
- Minimum game time limit (seconds)
9
+
- Maximum game time limit (seconds)
10
+
- How many seconds to increase the time limit, if the upgrade rate is met
11
+
- Upgrade rate: (number of stars collected / game time limit) i.e. average stars collected per second, must be above this value to increase the time limit of future games.
12
+
- Number of games in a row that must meet the upgrade rate
13
+
14
+
-**StarGenerator**: values related to spawning stars
15
+
- Min distance between stars and the edge of the screen
16
+
- Number of rows + columns in star spawn grid
17
+
- Grid positions to exclude from star spawning (e.g. those that overlap with UI elements)
18
+
- Min distance between spawned stars
9
19
10
20
-**Prefabs/StarSeekStar**: values related to 'locking on' to a star
11
21
- Time required to collect a star (with both gaze + head pose crosshair aligned)
[SerializeField,Tooltip("Min distance between stars and the edge of the screen.")]
13
+
privateintedgeOffset=1;
14
+
15
+
[SerializeField,Tooltip("Number of rows in star spawn grid")]
16
+
privateintnRows=4;
17
+
18
+
[SerializeField,Tooltip("Number of columns in star spawn grid")]
19
+
privateintnColumns=6;
20
+
21
+
[
22
+
SerializeField,
23
+
Tooltip(
24
+
"Positions in the spawn grid to exclude (e.g. overlapping with UI elements). (0, 0) is the bottom left star and (nColumns - 1, nRows - 1) is the top right star."
Copy file name to clipboardExpand all lines: projects/AstroBalance/Assets/Scripts/StarSeek/StarSeekManager.cs
+93-2Lines changed: 93 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
usingSystem.Collections.Generic;
2
+
usingSystem.Linq;
1
3
usingTMPro;
2
4
usingUnityEngine;
3
5
@@ -12,10 +14,33 @@ public class StarSeekManager : MonoBehaviour
12
14
[SerializeField,Tooltip("Screen shown upon winning the game")]
13
15
privateGameObjectwinScreen;
14
16
15
-
[SerializeField,Tooltip("Game time limit in seconds")]
16
-
privateinttimeLimit=120;
17
+
[SerializeField,Tooltip("Minimum game time limit in seconds")]
18
+
privateintminTimeLimit=60;
19
+
20
+
[SerializeField,Tooltip("Maximum game time limit in seconds")]
21
+
privateintmaxTimeLimit=180;
22
+
23
+
[SerializeField,Tooltip("Time limit increase if timeLimitUpgradeRate is met")]
24
+
privateinttimeLimitIncrement=60;
25
+
26
+
[
27
+
SerializeField,
28
+
Tooltip(
29
+
"(number of stars collected / game time limit) i.e. average stars collected per second - must be above this value to increase the time limit of future games."
30
+
)
31
+
]
32
+
privatefloattimeLimitUpgradeRate=0.3f;
33
+
34
+
[
35
+
SerializeField,
36
+
Tooltip(
37
+
"Number of games in a row that must meet timeLimitUpgradeRate to increase the time limit"
38
+
)
39
+
]
40
+
privateintnGamesToUpgrade=3;
17
41
18
42
privateintscore;
43
+
privateinttimeLimit;
19
44
privateTextMeshProUGUIwinText;
20
45
privateboolgameActive=true;
21
46
privateStarSeekDatagameData;
@@ -25,12 +50,62 @@ public class StarSeekManager : MonoBehaviour
0 commit comments