コード例 #1
0
ファイル: Form1.cs プロジェクト: geotrieu/shapestd
 /*****************************************************
  * Name: George Trieu
  * Date: 2018-06-08
  * Title: timer1_Tick
  * Purpose: This function is called with every tick from
  *          the timer.
  * Inputs: object sender
  *         EventArgs e
  * Returns: nothing
  ****************************************************/
 private void timer1_Tick(object sender, EventArgs e)
 {
     Pathfinding.MovePath();
     GameConditions.CheckEnemies();
     GameConditions.CheckHealth();
     //Sort Enemies every sortEnemiesInterval Seconds
     if (currentTick == sortEnemiesInterval)
     {
         SortEnemies.ReorderEnemies();
         currentTick = 0;
     }
     else
     {
         currentTick++;
     }
     WaveHandler.WaveTick();
     GameConditions.CheckWin();
     DrawGraphics.DrawEveryTick();
     if (MessageBox.messageActive)
     {
         timer1.Enabled = false;
     }
 }