Ejemplo n.º 1
0
//  // Called every frame. 'delta' is the elapsed time since the previous frame.
    public override void _Process(float delta)
    {
        if (subwave < MaxSubWaves)//note that the counter will go above 'maxsubwaves' by one before resetting to the en
        {
            if (time >= spawnRate)
            {
                if (subwave == 0 && wave > 1)
                {
                    announcer.SetStream(an_go);
                    announcer.Play();
                }
                EnemySpawn();
                maestro.SetStreamPaused(false);
                subwave++;
                UpdateScore(0);
                time = 0;
            }
            else
            {
                time += delta;
            }
        }
        else if (!GetTree().HasGroup("Enemies"))
        {
            maestro.SetStreamPaused(true);
            announcer.SetStream(an_waveComplete);
            announcer.Play();
            crowd.Play();
            score += wave * 100;
            wave++;
            subwave = 0;
            time    = 0;
            UpdateScore(0);
            ItemSpawn();
        }
    }