Esempio n. 1
0
 public Form1()
 {
     InitializeComponent();
     rainDrop = new RainDrop(randomRain);
     rainStorm.Add(rainDrop);
     livesLabel.Text = Convert.ToString(lives);
 }
Esempio n. 2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            scoreLabel.Text = Convert.ToString(runningScore);

            if (left)
            {
                    player.moveLeft();
                    left = false;
            }

            if (right)
            {
                    player.moveRight();
                    right = false;
            }

            if (timerCounter % 40 == 0)
            {
                rainDrop = new RainDrop(randomRain);
                rainStorm.Add(rainDrop);
            }

            //move raindrops down here
            foreach(RainDrop r in rainStorm)
            {
                r.falling(timerCounter);
            }

            //collision detection here
            collision();

            timerCounter = timerCounter + 1;
            this.Invalidate();
        }