public void Lose() //Lose condition because of fuel { if (fuel <= 0) { PauseManager.Get().Crushed(); } }
public void AddTime() //If not paused, adds time { if (PauseManager.Get().GetPause() == false && PauseManager.Get().GetHasLanded() == false && PauseManager.Get().GetHasCrushed() == false) { time = time + 1 * Time.deltaTime; } }
void Update() { LevelManager.Get().GetVVel(rig.velocity.y); LevelManager.Get().GetHVel(rig.velocity.x); LevelManager.Get().GetAltitude(this.transform.position.y); CameraZoom.Get().GetPlayerPos(this.transform.position); //Player movement and conditions when to move if (PauseManager.Get().GetPause() == true || PauseManager.Get().GetHasLanded() == true || PauseManager.Get().GetHasCrushed() == true || ScreenLevel.Get().GetOnLoadingScreen() == true) { rig.simulated = false; } else { rig.simulated = true; if (Input.GetKey(KeyCode.Space)) { rig.AddForce(transform.up * thrust * Time.deltaTime); if (Time.timeScale == 1) { LevelManager.Get().LoseFuel(); } } if (Input.GetKey(KeyCode.LeftArrow)) { transform.Rotate(Vector3.forward * rotationSpeed * Time.deltaTime); } if (Input.GetKey(KeyCode.RightArrow)) { transform.Rotate(Vector3.back * rotationSpeed * Time.deltaTime); } } }
public void NextLevel() //Sets up loading screen { level++; ScreenLevel.Get().LoadingScreenOnOff(); ScreenLevel.Get().GetLevelNumber(level); ScreenLevel.Get().InLoadingScreen(); PauseManager.Get().TurnOffLanded(); StartCoroutine(LoadLevelAfterTime(3)); }
void Start() { PauseManager.Get().ExitPause(); }
public void CrushedScreen() //Plays crushed screen { PauseManager.Get().Crushed(); SetHighScore(); }
public void LandedScreen() //Plays landed screen { PauseManager.Get().Landed(); SetHighScore(); }