示例#1
0
    //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    //                                                                                                                        GameOver()
    //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    public void GameOver()
    {
        if (level1IsActive == true)
        {
            _level1.Destroy();
            _level1.Remove();
        }

        if (level2IsActive == true)
        {
            _level2.Destroy();
            _level2.Remove();
        }

        if (Globals.levelBossIsActive == true)
        {
            _levelBoss.Destroy();
            _levelBoss.Remove();
        }

        stopMusic();

        _gameover = new GameOver();
        AddChild(_gameover);
    }