Ejemplo n.º 1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            var gameController = new GameController();
            bool crashed = gameController.MonitorCrashes(this.fallingObjects, this.dodgingGameObject, pictureBox1);
            if (crashed)
            {
                foreach (var fallingobject in fallingObjects)
                {
                    this.Controls.RemoveByKey(fallingobject.Name);
                }
                this.Controls.RemoveByKey(this.dodgingGameObject.Name);
                fallingObjects.Clear();
                MessageBox.Show("Game Over, try again");

            }
        }