// Update is called once per frame void FixedUpdate() { // When the Sparken reaches the left side of the stage, load scene 1 if (sparken.transform.position.x < -15f) { GameControllerScript.gameController.setWalkedOrDied(true); GameControllerScript.gameController.setSparkenPlace(new Vector3(14, 0.3f, 0)); GameControllerScript.gameController.setCurrentHealth(); SceneManager.LoadScene("scene 1"); } // When the Sparken reaches the right side of the stage, load scene 2 if (sparken.transform.position.x > 15.3f && sparken.transform.position.y > 0) { GameControllerScript.gameController.setWalkedOrDied(true); GameControllerScript.gameController.setSparkenPlace(new Vector3(-14.8f, 5.3f, 0)); GameControllerScript.gameController.setCurrentHealth(); SceneManager.LoadScene("scene 3"); } // When the Sparken reaches the right side of the platform, trigger the cutscene if (sparken.transform.position.x > -8.5f && GameControllerScript.gameController.getCutsceneTrigger(2) == 0) { GameControllerScript.gameController.setCutsceneTrigger(2, 1); dialogueManager.startCutsceneDialogue(cutsceneDialogue.getCutsceneRemarks(2), 2); } }
// Update is called once per frame void FixedUpdate() { // Starts the first cutscene when the player falls onto the screen if (sparken.GetComponent <Animator>().GetInteger("Action") == 0 && GameControllerScript.gameController.getCutsceneTrigger(0) == 0) { GameControllerScript.gameController.setCutsceneTrigger(0, 1); dialogueManager.startCutsceneDialogue(cutsceneDialogue.getCutsceneRemarks(0), 0); } // Starts the second cutscene when the player reaches the right side of the stage if (sparken.transform.position.x > 10.5 && GameControllerScript.gameController.getCutsceneTrigger(1) == 0) { GameControllerScript.gameController.setCutsceneTrigger(1, 1); dialogueManager.startCutsceneDialogue(cutsceneDialogue.getCutsceneRemarks(1), 1); rocklet.GetComponent <RockletController>().hostile = false; } // Sets the Rocklet to hostile when the player finishes the dialogue else if (GameControllerScript.gameController.getCutsceneTrigger(1) == 2) { rocklet.GetComponent <RockletController>().hostile = true; GameControllerScript.gameController.setCutsceneTrigger(1, 3); } // Updates the cutscene when the player kills the rocklet else if (GameControllerScript.gameController.getCutsceneTrigger(1) == 3 && GameObject.Find("Rocklet") == null) { GameControllerScript.gameController.setCutsceneTrigger(1, 4); } // Moves the player to the next map if (sparken.transform.position.x > 15f && GameControllerScript.gameController.getCutsceneTrigger(1) == 4) { GameControllerScript.gameController.setWalkedOrDied(true); GameControllerScript.gameController.setSparkenPlace(new Vector3(-14.5f, 1.6f, 0)); GameControllerScript.gameController.setCurrentHealth(); SceneManager.LoadScene("scene 2"); } }
// Update is called once per frame void FixedUpdate() { // When the Sparken reaches the left side of the stage, load scene 1 if (sparken.transform.position.x < -15f) { GameControllerScript.gameController.setWalkedOrDied(true); GameControllerScript.gameController.setSparkenPlace(new Vector3(15.2f, 0.45f, 0)); GameControllerScript.gameController.setCurrentHealth(); SceneManager.LoadScene("scene 2"); } // If the Rockin Conversation part 1 has ended if (GameControllerScript.gameController.getCutsceneTrigger(6) == 2) { //Set the walls to the raised position foreach (StoneWallControllerScript i in stonewallcontrollers) { i.setDesiredYPosition(-0.4f, 0.2f, 1); } // Update cutscene GameControllerScript.gameController.setCutsceneTrigger(6, 3); // Begin Rockin Conversation part 2 dialogueManager.startCutsceneDialogue(cutsceneDialogue.getCutsceneRemarks(7), 6); } // If Rockin conversation has ended else if (GameControllerScript.gameController.getCutsceneTrigger(6) == 4) { rockin.GetComponent <RockinControllerScript>().hostile = true; // Set rockin to hostile GameControllerScript.gameController.setCutsceneTrigger(6, 5); // Set the cutscene to the fight } // If the Rockin was defeated else if (GameControllerScript.gameController.getCutsceneTrigger(6) == 5 && GameObject.Find("Rockin") == null) { GameControllerScript.gameController.setCutsceneTrigger(6, 6); // Update cutscene dialogueManager.startCutsceneDialogue(cutsceneDialogue.getCutsceneRemarks(8), 6); // Set end of battle dialogue //Lower the walls foreach (StoneWallControllerScript i in stonewallcontrollers) { i.setDesiredYPosition(-12f, 0.2f, 1); } } // If the fight is still triggered, but the player hasn't entered the arena yet else if (GameControllerScript.gameController.getCutsceneTrigger(6) == 5 && sparken.transform.position.x > -2.3f) { rockin.GetComponent <RockinControllerScript>().hostile = true; //Raise the walls foreach (StoneWallControllerScript i in stonewallcontrollers) { i.setDesiredYPosition(-0.4f, 0.2f, 1); } } }