Browse Source

MVP loop

combinedRaceAndNameDropper
Josh 2 years ago
parent
commit
bb459731fa
  1. 1
      namedropper/Assets/Scripts/Game.cs
  2. 1
      namedropper/Assets/Scripts/GameManager.cs
  3. 6
      namedropper/Assets/Scripts/GameOverScreen.cs
  4. 37
      namedropper/Assets/Scripts/TopicSelect.cs

1
namedropper/Assets/Scripts/Game.cs

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

1
namedropper/Assets/Scripts/GameManager.cs

@ -21,6 +21,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 MAX_PLAYER_SKIN = 5;
public static int MVP = -1;
bool _doubleBlueScores = false;
bool _doubleRedScores = false;

6
namedropper/Assets/Scripts/GameOverScreen.cs

@ -38,7 +38,11 @@ public class GameOverScreen : MonoBehaviour
_gameOverMessage.text += "<color=white>TIE!</color>";
}
_gameOverMessage.text += "<color=white>\n\nPlay again?</color>";
if (Game.USE_MVP)
{
_gameOverMessage.text += "<color=white>\nMVP: Player 3!\nEarned unlock token for next game\n\nPlay again?</color>";
GameManager.MVP = 3;
}
}
Invoke("Restart", 10);

37
namedropper/Assets/Scripts/TopicSelect.cs

@ -88,9 +88,31 @@ public class TopicSelect : Level
if (blueScoreStack.Score + redScoreStack.Score == 0)
{
//first round
if (GameManager.MVP > -1)
{
titleText = "MVP may unlock a new topic";
// text = "It will be added to the mix until tomorrow";
if (GameManager.MVP == 0 || GameManager.MVP == 1)
{
_players[0].GetComponent<Player>().SetName("MVP");
_players[1].GetComponent<Player>().SetName("MVP");
bluePicks = true;
}
else
{
_players[2].GetComponent<Player>().SetName("MVP");
_players[3].GetComponent<Player>().SetName("MVP");
bluePicks = false;
}
}
else
{
titleText = "Welcome to ICON";
first = "first ";
}
}
else
{
text += "<color=white>TIE!</color>\n";
@ -103,6 +125,7 @@ public class TopicSelect : Level
text2 = "<color=blue>Blue team picks the " + first + "topic</color>";
if (GameManager.Instance.PlayerJoined[0])
{
if (GameManager.MVP == -1)
_players[0].GetComponent<Player>().SetName("blue team");
_players[1].GetComponent<Player>().BecomeInvisible();
@ -110,6 +133,7 @@ public class TopicSelect : Level
}
else
{
if (GameManager.MVP == -1)
_players[1].GetComponent<Player>().SetName("blue team");
}
@ -121,17 +145,23 @@ public class TopicSelect : Level
text2 = "<color=red>Red team picks the " + first + "topic</color>";
if (GameManager.Instance.PlayerJoined[2])
{
if (GameManager.MVP == -1)
_players[2].GetComponent<Player>().SetName("red team");
_players[3].GetComponent<Player>().BecomeInvisible();
_players[3].GetComponent<Player>().PassInputOnto = _players[2].GetComponent<Player>();
}
else
{
if (GameManager.MVP == -1)
_players[3].GetComponent<Player>().SetName("red team");
}
_players[0].SetActive(false);
_players[1].SetActive(false);
}
if (GameManager.MVP > -1)
text2 = "";
_title.text = titleText;
_subTitle.text = text;
_subTitle2.text = text2;
@ -272,6 +302,13 @@ public class TopicSelect : Level
_subTitle.text = "";
_subTitle2.text = "";
if (GameManager.MVP > -1)
{
_subTitle2.text = "added to the mix\nuntil tomorrow!";
}
GameManager.MVP = -1;
}
public static void PickTopic(TopicBox topicBox)

Loading…
Cancel
Save