public bool IsGameEnded() { if (JumpsGT.GetJumpsLeft() < 0) { gameOverPanel.Display(); EndGame(); return(true); } return(false); }
//Makes the ship disappear, decreases the jump amount and starts the jump coroutine void Jump() { JumpsGT.DecrementJumpsLeft(); if (!AODSG.IsGameEnded()) { JumpsGT.Display(); this.transform.SetPositionAndRotation(new Vector3(50f, 0f, 0f), this.transform.rotation);//Teleports the ship outside of borders StartCoroutine(WaitAndJump()); } }