public void Draw(SpriteBatch spriteBatch) { if (CurrentWave != null) { CurrentWave.Draw(spriteBatch); } }
// Use this for initialization /* * I Need THESE FOR INJECTION * int maxWave; * timeBetweenWaves -- watch for slider breaking--Maybe have the enemy instantiation come from a reference that is updated each iteration * number of enemy prefabs for an iteration? * enemy prefabs * */ void Start() { EnemyAliveList.Clear(); level = FindObjectOfType <CurrentWave>(); slider.maxValue = timeBetweenWaves; win.enabled = false; enemyList = Singleton.Instance.GetEnemyList(); //GetComponent<Singleton>().GetEnemyList(); }
private void PrepareNextWave() { CurrentWave = PopCurrentMonsterWave(); if (CurrentWave != null) { CurrentWave.Prepare(); } }
private void SetEnemiesLeft() { if (aliveEnemies.value > 0) { aliveEnemies.value += CurrentWave.GetEnemiesCount(); } else { aliveEnemies.value = CurrentWave.GetEnemiesCount(); } }
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(); } }
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(); } }
/// <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(); } } }
// 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 } }
public void ProcessPlayerMove(IGamePlayer i_player, List <IGamePiece> i_move) { ProcessPlayerMoveOnCurrentWave(i_player, i_move); if (CurrentWave.IsCleared()) { if (AreAllWavesCleared()) { SendAllMonstersDeadMessage(); } else { PrepareNextWave(); GameManager.PrepareForNextWave(); SendNewWaveEvent(); Audio.PlayOneShot(CombatAudioKeys.START_NEXT_WAVE); } } }
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 } }
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(); } }
private IEnumerator WaveRoutine(Wave wave) { WaveInProgress = true; _aliveEnemies.Clear(); EnemiesOut = 0; EnemiesKilled = 0; EnemiesInThisWave = CurrentWave.TotalNumberOfEnemies(SpawnPoints.Count); Debug.LogFormat("Wave {0}/{1} started!", WaveNumber, Waves.Count); foreach (var spawnEntry in wave.Items) { if (spawnEntry.EnemyPrefab == null || spawnEntry.NumberOfThisType == 0) { continue; } for (var i = 0; i < spawnEntry.NumberOfThisType; i++) { SpawnEnemy(spawnEntry.SpawnIndex, spawnEntry.EnemyPrefab, ref spawnEntry.InitialBuffs); yield return(new WaitForSeconds(spawnEntry.DelayBetween)); } yield return(new WaitForSeconds(spawnEntry.DelayBeforeNext)); } while (true) { if (_aliveEnemies.Count == 0) { WaveInProgress = false; Debug.LogFormat("Wave {0}/{1} ended!", WaveNumber, Waves.Count); TimeToNextWave = this.TimeBetweenWaves; EnemiesInThisWave = 0; yield break; } yield return(new WaitForSeconds(1f)); } }
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(); } }
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; } }
public void Draw(SpriteBatch spriteBatch) { CurrentWave.Draw(spriteBatch); }
public void Draw(SpriteBatch spriteBatch)//Draw method, draws the current wave { CurrentWave.Draw(spriteBatch); }
public void Draw(SpriteBatch spriteBatch) { //trapmenu.Draw(spriteBatch); CurrentWave.Draw(spriteBatch); }
public void ProcessPlayerMoveOnCurrentWave(IGamePlayer i_player, List <IGamePiece> i_move) { CurrentWave.ProcessPlayerMove(i_player, i_move); }
public List <List <int> > GetCurrentMonsterCombos() { return(CurrentWave.GetCurrentMonsterCombos()); }
public int GetLongestComboFromCurrentWave() { return(CurrentWave.GetLongestCombo()); }
public bool DoesMoveMatchAnyCurrentMonsters(List <IGamePiece> i_move) { return(CurrentWave.DoesMoveMatchAnyCurrentMonsters(i_move)); }
public void Tick(long i_time) { CurrentWave.Tick(i_time); }
// Update is called once per frame void Update() { if (readyWave && itemTime != true) { readyWave = false; switch (curWave) { case CurrentWave.p1: StartWave(waves[0]); break; case CurrentWave.p2: StartWave(waves[1]); break; case CurrentWave.p3: StartWave(waves[2]); break; case CurrentWave.p4: StartWave(waves[3]); break; case CurrentWave.p5: StartWave(waves[4]); break; case CurrentWave.p6: StartWave(waves[5]); break; case CurrentWave.p7: StartWave(waves[6]); break; case CurrentWave.p8: StartWave(waves[7]); break; case CurrentWave.p9: StartWave(waves[8]); break; case CurrentWave.p10: StartWave(waves[9]); break; } startWave = false; } if (monsters.Count == 0 && startWave == false && readyWave == false) { startWave = true; switch (curWave) { case CurrentWave.p0: curWave = CurrentWave.p1; WaveUIText("Wave 1"); break; case CurrentWave.p1: curWave = CurrentWave.p2; WaveUIText("Wave 2"); DropBox(); break; case CurrentWave.p2: curWave = CurrentWave.p3; WaveUIText("Wave 3"); DropBox(); break; case CurrentWave.p3: curWave = CurrentWave.p4; WaveUIText("Wave 4"); DropBox(); break; case CurrentWave.p4: curWave = CurrentWave.p5; WaveUIText("Wave 5"); DropBox(); break; case CurrentWave.p5: curWave = CurrentWave.p6; WaveUIText("Wave 6"); DropBox(); break; case CurrentWave.p6: curWave = CurrentWave.p7; WaveUIText("Wave 7"); break; case CurrentWave.p7: curWave = CurrentWave.p8; WaveUIText("Wave 8"); DropBox(); break; case CurrentWave.p8: curWave = CurrentWave.p9; WaveUIText("Wave 9"); DropBox(); break; case CurrentWave.p9: curWave = CurrentWave.p10; WaveUIText("Wave 10"); DropBox(); break; case CurrentWave.p10: break; } readyWave = true; } }
public List <Enemy> GetSpawnedList() { return(CurrentWave.GetEnemies().Where(enemy => enemy.IsAlive == true).ToList()); }