Beispiel #1
0
        public void Update(GameTime pGameTime)
        {
            if(m_pCurrentWave != null)
                m_pCurrentWave.Update(pGameTime);

            if (m_bDisplayingWave)
            {
                m_fWaveDisplayTime += (float)pGameTime.ElapsedGameTime.TotalMilliseconds;
                //Console.WriteLine("NEXT WAVE IN: " + (m_fMaxWaveDisplayTime - m_fWaveDisplayTime) + " sec");
                if (m_fWaveDisplayTime > m_fMaxWaveDisplayTime)
                {
                    m_bDisplayingWave = false;

                    m_fWaveDisplayTime = 0;
                }
            }
            else
            {
                if (m_pCurrentWave != null)
                {
                    // Hit kommer vi om nedräkningen för nästa våg är AVKLARAD och vi ska säga till att spawna den.
                    if (m_pCurrentWave.SpawnNext)
                    {
                        m_bDisplayingWave = true;
                        m_nCurrentWave++;
                        this.SpawnWaveDisplay(m_nCurrentWave);
                        m_pCurrentWave = null;

                    }
                }
                else
                {
                    m_pCurrentWave = m_rgWaves[m_nCurrentWave];
                    m_pCurrentWave.Start();

                }

            }
        }
Beispiel #2
0
 public void Start()
 {
     m_pCurrentWave = m_rgWaves[m_nCurrentWave];
     m_pCurrentWave.Start();
 }