Ejemplo n.º 1
0
        private void OnTimedEvent(Object source, System.Timers.ElapsedEventArgs e)
        {
            if (g.stopGame > 0)
            {
                // Start game again
                g.stopGame      = 0;
                aTimer.Interval = 10;
                g.resetBall();
            }

            g.update_pos_b();
            g.update_pos_b2(); // Update player and ball positions



            if (g.stopGame > 0)
            {
                // Stop the game and display the score
                aTimer.Enabled  = false;
                aTimer.Interval = 2000;
                aTimer.Enabled  = true;
            }

            this.Invalidate();
        }