Esempio n. 1
0
    /* Calls OnGameOverConfirmed which resets the game objects
     * - resets the default values for difficulty
     * - cleans up leftover game objects
     */
    public void ConfirmGameOver()
    {
        // activated when replay button is hit
        OnGameOverConfirmed(); //event sent to controller
        theScoreManager.scoreCount = 0;

        // Default values, but can be changed in unity
        theLevel.ySpawnTrigger      = -2f; // -2f
        theLevel.yDeSpawnTrigger    = 23f; // 23f
        theLevel.yDifficultyTrigger = 60f; // 30f
        theLevel.numberOfRocks      = 21;  // 20

        coinSpawn.ySpawnTrigger   = -2f;
        coinSpawn.yDeSpawnTrigger = 23f;
        //coinSpawn.yDifficultyTrigger = 60f;
        //coinSpawn.numberOfCoins = 2;

        Time.timeScale = 1f;

        SetPageState(PageState.Start);
        theLevel.DestroyAllGameObjects();
        coinSpawn.DestroyAllGameObjects();
    }