コード例 #1
0
ファイル: WaveManager.cs プロジェクト: evinus/XNA
 public void Update(GameTime gameTime)
 {
     CurrentWave.Update(gameTime);
     if (CurrentWave.RoundOver)
     {
         waveFinished = true;
     }
     if (waveFinished)
     {
         timeSinceLastWave += (float)gameTime.ElapsedGameTime.TotalSeconds;
     }
     if (timeSinceLastWave > 20.0f)
     {
         waves.Dequeue();
         StartNextWave();
     }
 }
コード例 #2
0
 public void Update(GameTime gameTime)//Update method
 {
     CurrentWave.Update(gameTime);//Updates the current wave
     if(CurrentWave.waveOver)//if the wave is over
     {
         waveFinished = true;//the Local waveFinished variable is set to true
     }
     if(waveFinished)//If the wave is finished the time the wave has been elapsed is incremented
     {
         elapsedWave += (float)gameTime.ElapsedGameTime.TotalSeconds;
     }
     if(elapsedWave > 1.0f)//If the time wave has been elapsed is more than 1 second the next wave is removed from the list 
     {                      //and the next wave is started
         waves.Dequeue();
         nextWave();
     }
 }
コード例 #3
0
        /// <summary>
        /// Method to update the waveManager, it will update the current wave
        /// </summary>
        /// <param name="gameTime">Instance of the gametime</param>
        public void Update(GameTime gameTime)
        {
            // Update the current wave
            CurrentWave.Update(gameTime);

            // If the wave is finished, trigger the chrono for the next wave
            if (CurrentWave.RoundOver)
            {
                _timeSinceLastWave += (float)gameTime.ElapsedGameTime.TotalSeconds;
                if (_timeSinceLastWave >= 10.0f)
                {
                    // Start the new wave
                    _wavesQueue.Dequeue();
                    StartNextWave();
                }
            }
        }
コード例 #4
0
        // update function
        public void Update(GameTime gameTime)
        {
            CurrentWave.Update(gameTime);

            if (CurrentWave.RoundOver) // update
            {
                waveFinished = true;
            }
            if (waveFinished)
            {
                timeSinceLastWave += (float)gameTime.ElapsedGameTime.TotalSeconds; // Start the timer
            }
            if (timeSinceLastWave > 30.0f)                                         // if 30 seconds has passed
            {
                waves.Dequeue();                                                   // remove finished wave
                StartNextWave();                                                   // start the next wave
            }
        }
コード例 #5
0
        public void Update(GameTime gameTime)
        {
            CurrentWave.Update(gameTime); // Update the wave

            if (CurrentWave.RoundOver)    // Check if it has finished
            {
                waveFinished = true;
            }

            if (waveFinished)                                                      // If it has finished
            {
                timeSinceLastWave += (float)gameTime.ElapsedGameTime.TotalSeconds; // Start the timer
            }

            if (timeSinceLastWave > 2.0f) // If 30 seconds has passed
            {
                waves.Dequeue();          // Remove the finished wave
                StartNextWave();          // Start the next wave
            }
        }
コード例 #6
0
ファイル: WaveManager.cs プロジェクト: MrOG22/TD-Test-Projekt
        public void Update(GameTime gameTime)
        {
            CurrentWave.Update(gameTime);
            //for at opdaterer den nuværende bølge af studerende.
            if (CurrentWave.RoundDone)
            {
                finishedWave = true;
            }

            if (finishedWave)
            {
                timeSinceLastWave += (float)gameTime.ElapsedGameTime.TotalSeconds;
            }

            if (timeSinceLastWave > 30.0f)
            {
                waves.Dequeue();
                StartNextWave();
            }
        }
コード例 #7
0
ファイル: WaveManager.cs プロジェクト: JasonPenguin/Portfolio
        public void Update(GameTime gameTime)
        {
            if (GameManager.TimetillStart > 10)
            {
                CurrentWave.Update(gameTime);
            }

            if (WavesDone)
            {
                waveFinished = true;
            }

            if (waveFinished)
            {
                timeSinceLastWave += (float)gameTime.ElapsedGameTime.TotalSeconds;
            }

            if (timeSinceLastWave >= 7.0f)
            {
                waves.Dequeue();
                StartNextWave();
            }
        }
コード例 #8
0
 public void Update(GameTime gameTime)
 {
     if (canUpdate == false)
     {
         if (seconds >= timeBetweenWave)
         {
             canUpdate = true;
             NextWave();
             seconds = 0;
         }
     }
     else
     {
         seconds = 0;
     }
     if (canUpdate == true)
     {
         CurrentWave.Update(gameTime, enemyPath);
     }
     if (CurrentWave.IsOver)
     {
         canUpdate = false;
     }
 }