MyGame.FirstAidManager.Update C# (CSharp) Method

Update() public method

Allows the component to run logic.
public Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime The gametime.
return void
        public override void Update(GameTime gameTime)
        {
            if (myGame.paused)
                return;

            reaminingTimeToNextSpawn -= gameTime.ElapsedGameTime.Milliseconds;
            if (reaminingTimeToNextSpawn < 0 && firstAidKits.Count < myGame.difficultyConstants.NUM_MEDKITS_IN_FIELD)
            {
                reaminingTimeToNextSpawn = spawnTime;
                addFirstAidKit();
            }
            for (int j = 0; j < firstAidKits.Count; j++)// Monster monster in monsters)
            {
                firstAidKits[j].Update(gameTime);

                if (myGame.player.unit.collideWith(firstAidKits[j].unit))
                {
                    addHealth(j);
                    j--;
                }
            }

            base.Update(gameTime);
        }