//won the level public void WonGame() { Time.timeScale = 0.0f; //Pause game gameState = BreakoutGameState.won; gamestate.Instance.currentLevelComplete = true; gamestate.Instance.setActiveLevel(gamestate.Instance.getActiveLevel() + 1); Application.LoadLevel("Level" + gamestate.Instance.getActiveLevel() + "CompleteMenu"); }
void Awake() { SP = this; blocksHit = 0; gameState = BreakoutGameState.playing; totalBlocks = GameObject.FindGameObjectsWithTag("Pickup").Length; Time.timeScale = 1.0f; SpawnBall(); }
void Awake() { SP = this; blocksHit = 0; gameState = BreakoutGameState.playing; totalBlocks = GameObject.FindGameObjectsWithTag("Pickup").Length; Time.timeScale = 1.0f; Invoke("SpawnBall", 1); }
public void SetGameOver() { Time.timeScale = 0.0f; //Pause game gameState = BreakoutGameState.lost; gamestate.Instance.currentLevelComplete = false; gamestate.Instance.IsGameWon = false; Application.LoadLevel("Level" + gamestate.Instance.getActiveLevel() + "CompleteMenu"); }
private void Start() { State = new GameplayState(this); CreateUiScreens(); ResetLives(); GenerateCurrentLevel(); ResetGame(); StartIntroSequence(); }
public void SetGameOver() { Time.timeScale = 0.0f; //Pause game gameState = BreakoutGameState.lost; }
public void WonGame() { Time.timeScale = 0.0f; //Pause game gameState = BreakoutGameState.won; }
/// <summary> /// 游戏胜利 /// </summary> public void WinGame() { Time.timeScale = 0.0f; //设置游戏暂停. gameState = BreakoutGameState.win; }
/// <summary> /// 游戏失败 /// </summary> public void SetGameOver() { Time.timeScale = 0.0f; //设置游戏暂停. gameState = BreakoutGameState.lost; }
void OnGUI() { GUILayout.Space(10); GUILayout.Label(" Hit: " + blocksHit + "/" + totalBlocks); if (gameState == BreakoutGameState.lost) { GUILayout.Label("You Lost!"); if (GUILayout.Button("Try again")) { Application.LoadLevel(Application.loadedLevel); } } else if (gameState == BreakoutGameState.won) { GUILayout.Label("You won!"); if (GUILayout.Button("Play again")) { Application.LoadLevel(Application.loadedLevel); } } else { float curCount = maxTime - (Time.time - startTime), minutes = curCount / 60, seconds = curCount % 60, miliseconds = (curCount * 100) % 100; if (curCount <= 0) { gameState = BreakoutGameState.lost; paused = true; } string countText = string.Format("{0:00}:{1:00}:{2:000}", minutes, seconds, miliseconds); GUILayout.Label(countText); paused = GUILayout.Toggle(paused, "Pause"); } }