예제 #1
0
    void Start()
    {
        display.NewScreen();  //TEST
        FirstTimePlaying();
        bat.batteries = pref.GetInt("CurrentBatteries");

        if (StartingFromInterupted())
        {
            LoadState();
            display.PlayerMove(_state.playerPos);
            emptyWave = Repeat("0", _state.enemiesArray[0].Length);
            display.Enemies(_state.enemiesArray);
            startingTime = CurrentTime();
            display.CurrentScore(Distance());
            scoreForNextLevel = levelScore[_state.level];
        }
        else
        {
            //prepare for new game
            emptyWave = Repeat("0", rowLength);
            _state    = new State(columnLength, emptyWave);
            display.ShowSplashScreen();
            display.PlayerMove(_state.playerPos);
            display.Eights(true);
            display.InitAnimation(false);
            oneSecondAnim = CurrentTime() + 1;
            _state.name   = "init";
        }
        newEnemiesWave = emptyWave;
        if (bat.Get() != bat.maxBatteries)
        {
            RemainingCharge();
        }
        display.UI();
        //display.MainMenu (bat.Get(),lives.Get());
        timeToMainMenu = CurrentTime() + initAnimWait;
        SetState(_state.name);
        if (_state.name != "init")
        {
            display.Battery(bat.Get());
        }
    }