Browse Source

version played at the office

combinedRaceAndNameDropper
Josh 2 years ago
parent
commit
39a4a3eccd
  1. 2
      namedropper/Assets/RaceGame.cs
  2. 24
      namedropper/Assets/Scenes/RaceGame.unity
  3. 6
      namedropper/Assets/Scenes/Wheel Scene.unity
  4. 21
      namedropper/Assets/Scripts/Game.cs
  5. 6
      namedropper/Assets/Scripts/GameManager.cs
  6. 28
      namedropper/Assets/Scripts/JoinPlayer.cs
  7. 40
      namedropper/Assets/Scripts/Level.cs
  8. 11
      namedropper/Assets/Scripts/Player.cs
  9. 4
      namedropper/Assets/Scripts/TopicSelect.cs
  10. 3
      namedropper/Assets/Scripts/TrackballInputManager.cs
  11. 6
      namedropper/Assets/_FortuneWheel/Scripts/FortuneWheel.cs
  12. 6
      namedropper/ProjectSettings/EditorBuildSettings.asset

2
namedropper/Assets/RaceGame.cs

@ -19,6 +19,6 @@ public class RaceGame : Level
// Update is called once per frame
void Update()
{
base.Update();
}
}

24
namedropper/Assets/Scenes/RaceGame.unity

@ -371,9 +371,13 @@ PrefabInstance:
propertyPath: m_LocalPosition.z
value: -3.63
objectReference: {fileID: 0}
- target: {fileID: 5117799249883694698, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_text
value:
objectReference: {fileID: 0}
- target: {fileID: 5117799249883694698, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_fontSize
value: 43.55
value: 46.9
objectReference: {fileID: 0}
- target: {fileID: 5117799249883694698, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_fontAsset
@ -2386,9 +2390,13 @@ PrefabInstance:
propertyPath: m_LocalPosition.z
value: -3.63
objectReference: {fileID: 0}
- target: {fileID: 5117799249883694698, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_text
value:
objectReference: {fileID: 0}
- target: {fileID: 5117799249883694698, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_fontSize
value: 43.55
value: 46.9
objectReference: {fileID: 0}
- target: {fileID: 5117799249883694698, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_fontAsset
@ -7013,9 +7021,13 @@ PrefabInstance:
propertyPath: m_LocalPosition.z
value: -3.63
objectReference: {fileID: 0}
- target: {fileID: 5117799249883694698, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_text
value:
objectReference: {fileID: 0}
- target: {fileID: 5117799249883694698, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_fontSize
value: 43.55
value: 46.9
objectReference: {fileID: 0}
- target: {fileID: 5117799249883694698, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_fontAsset
@ -7502,9 +7514,13 @@ PrefabInstance:
propertyPath: m_LocalPosition.z
value: -3.63
objectReference: {fileID: 0}
- target: {fileID: 5117799249883694698, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_text
value:
objectReference: {fileID: 0}
- target: {fileID: 5117799249883694698, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_fontSize
value: 43.55
value: 46.9
objectReference: {fileID: 0}
- target: {fileID: 5117799249883694698, guid: 56b5ab1b6ee02794ab9664e282d1930a, type: 3}
propertyPath: m_fontAsset

6
namedropper/Assets/Scenes/Wheel Scene.unity

@ -3280,10 +3280,10 @@ MonoBehaviour:
m_EditorClassIdentifier:
prizes:
- Name Dropper
- Indie 500
- Bumper Budz
- Name Dropper
- Indie 500
- Sumo
- Bumper Budz
- Bumper Budz
tingSound: {fileID: 8300000, guid: a4094b6328f12884d8f174a320bff865, type: 3}
speedMultiplier: 4
duration: 6

21
namedropper/Assets/Scripts/Game.cs

@ -7,7 +7,7 @@ using UnityEngine.SceneManagement;
public class Game : Level
{
public const bool USE_MVP = true;
public const bool USE_UNLOCK = true;
public const bool USE_UNLOCK = false;
const bool HIDE_SCORES = true;
@ -15,7 +15,6 @@ public class Game : Level
[SerializeField] Text Score2;
[SerializeField] Text Score3;
[SerializeField] Text Score4;
[SerializeField] Text Topic;
[SerializeField] GameObject CategoriesRound1;
[SerializeField] GameObject CategoriesRound2;
@ -34,7 +33,7 @@ public class Game : Level
// Start is called before the first frame update
void Awake()
{
Physics2D.gravity = new Vector2(0f, -4f);
GameManager.TurnOnGravity();
base.Awake();
if (GameManager.Instance.Round == 1)
@ -110,23 +109,9 @@ public class Game : Level
Topic.text = GameDataManager.Instance.CurrentTopic.Topic;
StartCoroutine("StartupProcess");
}
IEnumerator StartupProcess()
{
ActivatePlayers(false);
Topic.gameObject.SetActive(false);
yield return new WaitForSeconds(1f);
Topic.gameObject.SetActive(true);
yield return new WaitForSeconds(2f);
RoundNumber.text = "";
Topic.text = "GO!";
ActivatePlayers(true);
yield return new WaitForSeconds(1f);
Topic.gameObject.SetActive(false);
Invoke("SpawnPowerup", Random.Range(8f, 12f));
}
void SpawnPowerup()
{

6
namedropper/Assets/Scripts/GameManager.cs

@ -19,6 +19,7 @@ public class GameManager
int _round = 1;
public bool[] PlayerJoined = new bool[4];
public static bool MINIGAMES = true;
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;
@ -27,6 +28,11 @@ public class GameManager
bool _doubleBlueScores = false;
bool _doubleRedScores = false;
public static void TurnOnGravity()
{
Physics2D.gravity = new Vector2(0f, -4f);
}
public string GetRoundName()
{
if (Round == 3)

28
namedropper/Assets/Scripts/JoinPlayer.cs

@ -16,6 +16,7 @@ public class JoinPlayer : MonoBehaviour
// Start is called before the first frame update
void Start()
{
GameManager.TurnOnGravity();
UpdateTitle();
}
@ -32,7 +33,7 @@ public class JoinPlayer : MonoBehaviour
if (_NumPlayersJoined >= 4)
{
Invoke("LoadTopicSelect", 2f);
Invoke("GotoFirstScene", 2f);
}
}
@ -51,7 +52,7 @@ public class JoinPlayer : MonoBehaviour
if (_timer == 1)
{
Invoke("LoadTopicSelect", 1f);
Invoke("LoadFirstScene", 1f);
}
else
{
@ -59,7 +60,7 @@ public class JoinPlayer : MonoBehaviour
}
}
void LoadTopicSelect()
void LoadFirstScene()
{
if (GameManager.Instance.NumPlayers == 0)
{
@ -89,17 +90,20 @@ public class JoinPlayer : MonoBehaviour
}
_title.text = "Uneven teams!\n\n" + color + " team earns 2x points";
Invoke("GotoTopicSelect", 2f);
Invoke("GotoFirstScene", 2f);
}
else
{
GotoTopicSelect();
GotoFirstScene();
}
}
void GotoTopicSelect()
void GotoFirstScene()
{
SceneManager.LoadScene("TopicSelect");
if (GameManager.MINIGAMES)
SceneManager.LoadScene("Wheel Scene");
else
SceneManager.LoadScene("TopicSelect");
}
void Redo()
@ -139,7 +143,7 @@ public class JoinPlayer : MonoBehaviour
/*
if (Input.GetMouseButtonDown(0))
{
LoadTopicSelect();
LoadFirstScene();
}
*/
@ -149,7 +153,7 @@ public class JoinPlayer : MonoBehaviour
GameManager.Instance.PlayerJoined[0] = true;
UpdateTitle();
LoadTopicSelect();
LoadFirstScene();
}
if (Input.GetKeyDown(KeyCode.Alpha2))
@ -158,7 +162,7 @@ public class JoinPlayer : MonoBehaviour
GameManager.Instance.PlayerJoined[0] = true;
GameManager.Instance.PlayerJoined[3] = true;
UpdateTitle();
LoadTopicSelect();
LoadFirstScene();
}
if (Input.GetKeyDown(KeyCode.Alpha3))
{
@ -167,7 +171,7 @@ public class JoinPlayer : MonoBehaviour
GameManager.Instance.PlayerJoined[1] = true;
GameManager.Instance.PlayerJoined[3] = true;
UpdateTitle();
LoadTopicSelect();
LoadFirstScene();
}
if (Input.GetKeyDown(KeyCode.Alpha4))
{
@ -177,7 +181,7 @@ public class JoinPlayer : MonoBehaviour
GameManager.Instance.PlayerJoined[2] = true;
GameManager.Instance.PlayerJoined[3] = true;
UpdateTitle();
LoadTopicSelect();
LoadFirstScene();
}
}
}

40
namedropper/Assets/Scripts/Level.cs

@ -9,8 +9,10 @@ public class Level : MonoBehaviour
public List<GameObject> _players;
ScoreStack _blueScoreStack;
ScoreStack _redScoreStack;
[SerializeField] protected Text Timer;
[SerializeField] protected Text RoundNumber;
[SerializeField] protected Text Timer;
[SerializeField] protected Text RoundNumber;
[SerializeField] protected Text Topic;
int _originalFontSize;
int _seconds = 70;
static bool _paused = false;
@ -25,10 +27,13 @@ public class Level : MonoBehaviour
public void Awake()
{
RoundNumber.text = GameManager.Instance.GetRoundName();
if (RoundNumber != null)
RoundNumber.text = GameManager.Instance.GetRoundName();
_blueScoreStack = GameObject.Find("/ScoreStackBlue")?.GetComponent<ScoreStack>();
_redScoreStack = GameObject.Find("/ScoreStackRed")?.GetComponent<ScoreStack>();
_originalFontSize = Timer.fontSize;
if (Timer != null)
_originalFontSize = Timer.fontSize;
if (GameManager.Instance.Round == 1)
{
@ -44,7 +49,27 @@ public class Level : MonoBehaviour
}
StartCoroutine(Countdown());
StartCoroutine(StartupProcess());
}
IEnumerator StartupProcess()
{
ActivatePlayers(false);
if (Topic != null)
Topic.gameObject.SetActive(false);
yield return new WaitForSeconds(1f);
if (Topic != null)
Topic.gameObject.SetActive(true);
yield return new WaitForSeconds(2f);
RoundNumber.text = "";
if (Topic != null)
Topic.text = "GO!";
ActivatePlayers(true);
yield return new WaitForSeconds(1f);
if (Topic != null)
Topic.gameObject.SetActive(false);
//Invoke("SpawnPowerup", Random.Range(8f, 12f));
}
// Update is called once per frame
@ -152,13 +177,16 @@ public class Level : MonoBehaviour
{
SceneManager.LoadScene("GameOver");
}
else if (GameManager.Instance.Round == 3)
else if (GameManager.Instance.Round == 3 && GameManager.MINIGAMES == false)
{
SceneManager.LoadScene("ChallengingStage");
}
else
{
SceneManager.LoadScene("TopicSelect");
if (GameManager.MINIGAMES)
SceneManager.LoadScene("Wheel Scene");
else
SceneManager.LoadScene("TopicSelect");
}
}
}

11
namedropper/Assets/Scripts/Player.cs

@ -39,6 +39,7 @@ public class Player : MonoBehaviour
bool _poweredUp = false;
float _powerupTimeLeft = 0f;
public Player PassInputOnto = null;
int _laps = 0;
public enum Team
{
@ -362,7 +363,15 @@ public class Player : MonoBehaviour
if (_touchedMidpoint)
{
Debug.Log("scored!");
_raceGame.AddScore(1, _playerNumber);
int score = 10;
if (GameManager.Instance.Round == 3)
score *= 2;
_raceGame.AddScore(score, _playerNumber);
_laps++;
_text.text = _laps + " lap";
if (_laps > 1)
_text.text += "s";
}
_touchedMidpoint = false;
}

4
namedropper/Assets/Scripts/TopicSelect.cs

@ -25,10 +25,10 @@ public class TopicSelect : Level
void Awake()
{
StartCoroutine("StartupProcess");
StartCoroutine("StartupProcessTopicSelect");
}
IEnumerator StartupProcess()
IEnumerator StartupProcessTopicSelect()
{
ActivatePlayers(false);
ActivatePlayers(true);

3
namedropper/Assets/Scripts/TrackballInputManager.cs

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using UnityEngine.UI;
using UnityEditor;
using UnityEngine.SceneManagement;
public class TrackballInputManager : MonoBehaviour
{
@ -164,7 +165,7 @@ public class TrackballInputManager : MonoBehaviour
dy *= accelerationMultiplier;
}
if (dy < 0)
if (dy < 0 && SceneManager.GetActiveScene().name == "Game")
dy *= upMultiplier;
//use this method to move using position

6
namedropper/Assets/_FortuneWheel/Scripts/FortuneWheel.cs

@ -152,15 +152,15 @@
if (_gameName == "Name Dropper")
{
sceneName = "RoundIntro";
sceneName = "TopicSelect";
}
else if (_gameName == "Indie 500")
else if (_gameName == "Indie 500" || _gameName == "Bumper Budz")
{
sceneName = "RaceGame";
}
else if (_gameName == "Sumo")
{
sceneName = "RoundIntro";
sceneName = "RaceGame";
}
else
{

6
namedropper/ProjectSettings/EditorBuildSettings.asset

@ -29,9 +29,15 @@ EditorBuildSettings:
- enabled: 0
path:
guid: 00000000000000000000000000000000
- enabled: 1
path: Assets/Scenes/Wheel Scene.unity
guid: 6ca8f0d3b0498db4cb867d37d1589231
- enabled: 1
path: Assets/Scenes/RoundIntro.unity
guid: b0725f8c0f4a77b4cb681eccd438a4c2
- enabled: 1
path: Assets/Scenes/RaceGame.unity
guid: 4b27426029785474c988419c9328a8ba
- enabled: 1
path: Assets/Scenes/Game.unity
guid: fc389e04780671f498562f1d56f81afb

Loading…
Cancel
Save