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. 15
      namedropper/Assets/Scripts/GameOverScreen.cs
  4. 10
      namedropper/Assets/Scripts/Player.cs
  5. 46
      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;

15
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,7 +59,8 @@ public class GameOverScreen : Level
} }
GameManager.MVP = mvpPlayer; GameManager.MVP = mvpPlayer;
_gameOverMessage.text += "<color=white>\n\nPlay again?</color>"; if (Game.USE_UNLOCK == false)
_gameOverMessage.text += "<color=white>\n\nPlay again?</color>";
} }
} }
@ -103,7 +104,15 @@ public class GameOverScreen : Level
} }
private void Restart() private void Restart()
{ {
GameManager.Instance.RestartGame(); if (Game.USE_UNLOCK)
{
GameManager.AllowUnlock = true;
SceneManager.LoadScene("TopicSelect");
}
else
{
GameManager.Instance.RestartGame();
}
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()

10
namedropper/Assets/Scripts/Player.cs

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

46
namedropper/Assets/Scripts/TopicSelect.cs

@ -117,9 +117,12 @@ 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;
@ -218,12 +229,22 @@ public class TopicSelect : Level
} }
else else
{ {
_title.text = ""; if (GameManager.AllowUnlock)
_subTitle.text = "Pick a topic!"; {
_subTitle2.text = ""; _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 = "";
_subTitle.text = "Pick a topic!";
_subTitle2.text = "";
}
}
_topic1Box.TopicData = GameDataManager.Instance.GetRandomTopicData(); _topic1Box.TopicData = GameDataManager.Instance.GetRandomTopicData();
_topic2Box.TopicData = GameDataManager.Instance.GetRandomTopicData(); _topic2Box.TopicData = GameDataManager.Instance.GetRandomTopicData();
_topic3Box.TopicData = GameDataManager.Instance.GetRandomTopicData(); _topic3Box.TopicData = GameDataManager.Instance.GetRandomTopicData();
_topic1Box.Name = _topic1Box.TopicData.Topic; _topic1Box.Name = _topic1Box.TopicData.Topic;
@ -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;
SceneManager.LoadScene("Game");
if (GameManager.AllowUnlock)
{
GameManager.Instance.RestartGame();
}
else
{
SceneManager.LoadScene("Game");
}
} }
} }

Loading…
Cancel
Save