Commit c080bc8a authored by mmaluschnig's avatar mmaluschnig
Browse files

fixed a couple bugs

parent 6ede53a8
...@@ -84,7 +84,10 @@ public class CharacterInteractions : MonoBehaviour { ...@@ -84,7 +84,10 @@ public class CharacterInteractions : MonoBehaviour {
interacting = true; interacting = true;
setText(speechBox, characterScript.GreetingMessage(), Mathf.Infinity, characterScript.getResponses()); setText(speechBox, characterScript.GreetingMessage(), Mathf.Infinity, characterScript.getResponses());
interactButton.gameObject.SetActive(false); interactButton.gameObject.SetActive(false);
GameManager.setLeveledUp(characterScript.getName(), false); if (GameManager.HasTalkedToAhava)
{
GameManager.setLeveledUp(characterScript.getName(), false);
}
LevelUpImage.gameObject.SetActive(false); LevelUpImage.gameObject.SetActive(false);
} }
//generate speech every so often while the player is nearby //generate speech every so often while the player is nearby
......
...@@ -14,21 +14,26 @@ public class DaytimeManager : MonoBehaviour { ...@@ -14,21 +14,26 @@ public class DaytimeManager : MonoBehaviour {
public static bool enteringName; public static bool enteringName;
void Start() { void Start() {
if (Ahava!= null && Ahava.activeSelf)
float newLevel = 1 {
+ GameManager.JohnLevel - 1 float newLevel = 1
+ GameManager.SilasLevel - 1 + GameManager.JohnLevel - 1
+ GameManager.SimonLevel - 1; + GameManager.SilasLevel - 1
float diffinLevels = newLevel - GameManager.AhavaLevel; + GameManager.SimonLevel - 1;
print("diff" + diffinLevels); float diffinLevels = newLevel - GameManager.AhavaLevel;
print("start" + GameManager.AhavaLevel % 1); print("diff" + diffinLevels);
if ((GameManager.AhavaLevel % 1) + diffinLevels > 1) { print("start" + GameManager.AhavaLevel % 1);
GameManager.AhavaLevelUp = true; if ((GameManager.AhavaLevel % 1) + diffinLevels > 1)
{
GameManager.AhavaLevelUp = true;
}
GameManager.AhavaLevel = newLevel;
GameManager.ConversationStage = (int)GameManager.AhavaLevel;
print("ahava Lvl" + GameManager.AhavaLevel);
} }
GameManager.AhavaLevel = newLevel;
GameManager.ConversationStage = (int)GameManager.AhavaLevel;
print("ahava Lvl" + GameManager.AhavaLevel);
} }
void Update() { void Update() {
......
...@@ -34,6 +34,8 @@ public class GameManager : MonoBehaviour { ...@@ -34,6 +34,8 @@ public class GameManager : MonoBehaviour {
public static bool HasTalkedToAhava; public static bool HasTalkedToAhava;
public static bool HasCompleatedIntro;
public static void addToLevel(string name, float points) { public static void addToLevel(string name, float points) {
if(name == "Simon") { if(name == "Simon") {
if((SimonLevel % 1) + points > 1) { if((SimonLevel % 1) + points > 1) {
...@@ -114,5 +116,31 @@ public class GameManager : MonoBehaviour { ...@@ -114,5 +116,31 @@ public class GameManager : MonoBehaviour {
void Update () { void Update () {
} }
public static void reset(){
SilasLevel = 1.1f;
SimonLevel = 1f;
JohnLevel = 1f;
SilasLevelUp = true;
SimonLevelUp = true;
JohnLevelUp = true;
playerName = "Dennis";
FirstTimePie = true;
FirstTimeMime = true;
FirstTimeTrapeze = true;
SimonTutorial = false;
JohnTutorial = false;
SilasTutorial = false;
SilasNoteInPlace = false;
PlayerCanDance = true;
HasTalkedToAhava = false;
HasCompleatedIntro = false;
}
} }
...@@ -6,13 +6,20 @@ using UnityEngine.SceneManagement; ...@@ -6,13 +6,20 @@ using UnityEngine.SceneManagement;
public class MainMenu : MonoBehaviour { public class MainMenu : MonoBehaviour {
public void StartGame() { public void StartGame() {
SceneManager.LoadScene("Daytime"); if (GameManager.HasCompleatedIntro)
{
SceneManager.LoadScene("Daytime");
}else{
SceneManager.LoadScene("IntroScene");
}
} }
public void ExitGame() { public void ExitGame() {
Application.Quit();
} }
public void StartOver() { public void StartOver() {
//reset stuff //reset stuff
GameManager.reset();
SceneManager.LoadScene("Daytime"); SceneManager.LoadScene("Daytime");
} }
......
...@@ -63,7 +63,7 @@ public class PauseMenu : MonoBehaviour { ...@@ -63,7 +63,7 @@ public class PauseMenu : MonoBehaviour {
setPauseMenu(false); setPauseMenu(false);
} }
public void ExitGame() { public void ExitGame() {
Application.Quit();
} }
public void ExitToMainMenu() { public void ExitToMainMenu() {
Time.timeScale = 1; Time.timeScale = 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment