Browse Source

option for explicit unlocking

combinedRaceAndNameDropper
Josh 2 years ago
parent
commit
3a313944b1
  1. 1
      namedropper/Assets/Scripts/Game.cs
  2. 1
      namedropper/Assets/Scripts/GameManager.cs
  3. 11
      namedropper/Assets/Scripts/GameOverScreen.cs
  4. 8
      namedropper/Assets/Scripts/Player.cs
  5. 34
      namedropper/Assets/Scripts/TopicSelect.cs

1
namedropper/Assets/Scripts/Game.cs

@ -7,6 +7,7 @@ using UnityEngine.SceneManagement;
public class Game : Level public class Game : Level
{ {
public const bool USE_MVP = true; public const bool USE_MVP = true;
public const bool USE_UNLOCK = false;
const bool HIDE_SCORES = true; const bool HIDE_SCORES = true;
int _seconds = 70; int _seconds = 70;

1
namedropper/Assets/Scripts/GameManager.cs

@ -22,6 +22,7 @@ public class GameManager
public static int PLAYER_SKIN = 5; //0 == puck, 1 == pancake, 2 == gummybear, 3==pig, 4==ball w/ bear, 5==pop public static int PLAYER_SKIN = 5; //0 == puck, 1 == pancake, 2 == gummybear, 3==pig, 4==ball w/ bear, 5==pop
public static int MAX_PLAYER_SKIN = 5; public static int MAX_PLAYER_SKIN = 5;
public static int MVP = -1; public static int MVP = -1;
public static bool AllowUnlock = false;
bool _doubleBlueScores = false; bool _doubleBlueScores = false;
bool _doubleRedScores = false; bool _doubleRedScores = false;

11
namedropper/Assets/Scripts/GameOverScreen.cs

@ -10,7 +10,7 @@ public class GameOverScreen : Level
void Start() void Start()
{ {
if (GameManager.Instance.NumTeams == 1 && false) { if (GameManager.Instance.NumTeams == 1) {
int score = GameManager.Instance.Score1 + GameManager.Instance.Score2 + GameManager.Instance.Score3 + GameManager.Instance.Score4; int score = GameManager.Instance.Score1 + GameManager.Instance.Score2 + GameManager.Instance.Score3 + GameManager.Instance.Score4;
if (score > GameManager.Instance.HighScore) if (score > GameManager.Instance.HighScore)
@ -59,6 +59,7 @@ public class GameOverScreen : Level
} }
GameManager.MVP = mvpPlayer; GameManager.MVP = mvpPlayer;
if (Game.USE_UNLOCK == false)
_gameOverMessage.text += "<color=white>\n\nPlay again?</color>"; _gameOverMessage.text += "<color=white>\n\nPlay again?</color>";
} }
@ -102,9 +103,17 @@ public class GameOverScreen : Level
return bestPlayerNumber; return bestPlayerNumber;
} }
private void Restart() private void Restart()
{
if (Game.USE_UNLOCK)
{
GameManager.AllowUnlock = true;
SceneManager.LoadScene("TopicSelect");
}
else
{ {
GameManager.Instance.RestartGame(); GameManager.Instance.RestartGame();
} }
}
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {

8
namedropper/Assets/Scripts/Player.cs

@ -348,9 +348,17 @@ public class Player : MonoBehaviour
} }
void LoadGame() void LoadGame()
{
if (GameManager.AllowUnlock)
{
GameManager.AllowUnlock = false;
GameManager.Instance.RestartGame();
}
else
{ {
SceneManager.LoadScene("Game"); SceneManager.LoadScene("Game");
} }
}
void LoadTopicSelect() void LoadTopicSelect()
{ {

34
namedropper/Assets/Scripts/TopicSelect.cs

@ -118,8 +118,11 @@ public class TopicSelect : Level
text += "<color=white>TIE!</color>\n"; text += "<color=white>TIE!</color>\n";
} }
} }
if (bluePicks) if (bluePicks)
{ {
text2 = "<color=blue>Blue team picks the " + first + "topic</color>"; text2 = "<color=blue>Blue team picks the " + first + "topic</color>";
@ -164,6 +167,14 @@ public class TopicSelect : Level
text2 = "MVP picks the first topic"; text2 = "MVP picks the first topic";
} }
if (GameManager.AllowUnlock)
{
titleText = "As a reward, MVP may\nunlock a new topic";
text = "";
text2 = "";
//text = "It will be added to the mix until tomorrow";
}
_title.text = titleText; _title.text = titleText;
_subTitle.text = text; _subTitle.text = text;
_subTitle2.text = text2; _subTitle2.text = text2;
@ -217,11 +228,21 @@ public class TopicSelect : Level
_subTitle.text = "Cast your votes!"; _subTitle.text = "Cast your votes!";
} }
else else
{
if (GameManager.AllowUnlock)
{
_title.text = "As a reward, MVP may\nunlock a new topic";
_subTitle.text = "";
_subTitle2.text = "";
//text = "It will be added to the mix until tomorrow";
}
else
{ {
_title.text = ""; _title.text = "";
_subTitle.text = "Pick a topic!"; _subTitle.text = "Pick a topic!";
_subTitle2.text = ""; _subTitle2.text = "";
} }
}
_topic1Box.TopicData = GameDataManager.Instance.GetRandomTopicData(); _topic1Box.TopicData = GameDataManager.Instance.GetRandomTopicData();
_topic2Box.TopicData = GameDataManager.Instance.GetRandomTopicData(); _topic2Box.TopicData = GameDataManager.Instance.GetRandomTopicData();
@ -304,12 +325,11 @@ public class TopicSelect : Level
_subTitle.text = ""; _subTitle.text = "";
_subTitle2.text = ""; _subTitle2.text = "";
/*
if (GameManager.MVP > -1) if (GameManager.AllowUnlock)
{ {
_subTitle2.text = "added to the mix\nuntil tomorrow!"; _subTitle2.text = "added to the mix\nuntil tomorrow!";
} }
*/
GameManager.MVP = -1; GameManager.MVP = -1;
@ -318,6 +338,14 @@ public class TopicSelect : Level
public static void PickTopic(TopicBox topicBox) public static void PickTopic(TopicBox topicBox)
{ {
GameDataManager.Instance.CurrentTopic = topicBox.TopicData; GameDataManager.Instance.CurrentTopic = topicBox.TopicData;
if (GameManager.AllowUnlock)
{
GameManager.Instance.RestartGame();
}
else
{
SceneManager.LoadScene("Game"); SceneManager.LoadScene("Game");
} }
}
} }

Loading…
Cancel
Save