示例#1
0
 //SpeedBoostTimer
 private void Powerup01Timer_Tick(object sender, EventArgs e)
 {
     //Waiting for 10 seconds
     wait--;
     SpeedBoostCounter.Text = wait + " sec";
     if (wait == 0)
     {
         //deactivating Powerup
         PlayerSpeed = 3;
         SpeedBoostCounter.Visible = false;
         wait = 10;
         SpeedBoostCounter.Text = wait + " sec";
         Powerup01Timer.Stop();
     }
 }
示例#2
0
        public Form1()
        {
            InitializeComponent();

            //Stop Movement Timers
            MoveTimersStop();

            //Stop Powerup Timers
            Powerup01Timer.Stop();
            Powerup02Timer.Stop();

            //Random Food Placement
            Food01.Location = new Point(random.Next(67, 908), random.Next(67, 908));
            Food02.Location = new Point(random.Next(67, 908), random.Next(67, 908));
            Food03.Location = new Point(random.Next(67, 908), random.Next(67, 908));
            Food04.Location = new Point(random.Next(67, 908), random.Next(67, 908));
            Food05.Location = new Point(random.Next(67, 908), random.Next(67, 908));
            Food06.Location = new Point(random.Next(67, 908), random.Next(67, 908));
        }