Commit c080bc8a authored by mmaluschnig's avatar mmaluschnig
Browse files

fixed a couple bugs

parent 6ede53a8
......@@ -84,7 +84,10 @@ public class CharacterInteractions : MonoBehaviour {
interacting = true;
setText(speechBox, characterScript.GreetingMessage(), Mathf.Infinity, characterScript.getResponses());
interactButton.gameObject.SetActive(false);
GameManager.setLeveledUp(characterScript.getName(), false);
if (GameManager.HasTalkedToAhava)
{
GameManager.setLeveledUp(characterScript.getName(), false);
}
LevelUpImage.gameObject.SetActive(false);
}
//generate speech every so often while the player is nearby
......
......@@ -14,21 +14,26 @@ public class DaytimeManager : MonoBehaviour {
public static bool enteringName;
void Start() {
float newLevel = 1
+ GameManager.JohnLevel - 1
+ GameManager.SilasLevel - 1
+ GameManager.SimonLevel - 1;
float diffinLevels = newLevel - GameManager.AhavaLevel;
print("diff" + diffinLevels);
print("start" + GameManager.AhavaLevel % 1);
if ((GameManager.AhavaLevel % 1) + diffinLevels > 1) {
GameManager.AhavaLevelUp = true;
if (Ahava!= null && Ahava.activeSelf)
{
float newLevel = 1
+ GameManager.JohnLevel - 1
+ GameManager.SilasLevel - 1
+ GameManager.SimonLevel - 1;
float diffinLevels = newLevel - GameManager.AhavaLevel;
print("diff" + diffinLevels);
print("start" + GameManager.AhavaLevel % 1);
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() {
......
......@@ -34,6 +34,8 @@ public class GameManager : MonoBehaviour {
public static bool HasTalkedToAhava;
public static bool HasCompleatedIntro;
public static void addToLevel(string name, float points) {
if(name == "Simon") {
if((SimonLevel % 1) + points > 1) {
......@@ -114,5 +116,31 @@ public class GameManager : MonoBehaviour {
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;
public class MainMenu : MonoBehaviour {
public void StartGame() {
SceneManager.LoadScene("Daytime");
if (GameManager.HasCompleatedIntro)
{
SceneManager.LoadScene("Daytime");
}else{
SceneManager.LoadScene("IntroScene");
}
}
public void ExitGame() {
Application.Quit();
}
public void StartOver() {
//reset stuff
GameManager.reset();
SceneManager.LoadScene("Daytime");
}
......
......@@ -63,7 +63,7 @@ public class PauseMenu : MonoBehaviour {
setPauseMenu(false);
}
public void ExitGame() {
Application.Quit();
}
public void ExitToMainMenu() {
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