Example #1
0
        public void timer_Tick(object sender, EventArgs e)
        {
            ++_countOfTicks;
            if (_countOfTicks % 60 == 0)
            {
                GameTime          = GameTime.AddSeconds(1);
                LabelTime.Content = GameTime.ToLongTimeString();
            }
            if (_countOfTicks >= 500)
            {
                GameObject ball1 = getRandomBall(0, (int)SizeX, (int)SizeX, (int)SizeY);
                _playfield.AddGameObject(ball1);
                _countOfTicks = 0;
            }

            UpdatePlayfield();
        }