Esempio n. 1
0
        private void timerPlay_Tick(object sender, EventArgs e)
        {
            statusStrip1.Visible = true;
            comboLabel.Visible   = true;
            livesLabel.Visible   = true;
            timerPlay.Interval   = decrease;
            timerSpeedLabel.Text = string.Format("Timer Speed: " + decrease + "ms");
            if (decrease >= 1000)
            {
                decrease -= 50;
            }
            else if (decrease < 1000)
            {
                decrease -= 20;
            }
            timerPlay.Interval = decrease;
            int     y = r.Next(2 * Circles.radius, Height - (Circles.radius * 2));  //random loc
            int     x = r.Next(2 * Circles.radius, Width - (Circles.radius * 2));
            Circles c = new Circles(new Point(x, y));

            scene.addC(c);
            comboLabel.Text = string.Format("Combo: " + scene.Combo);

            if (scene.threeLives >= 0)
            {
                livesLabel.Text = string.Format("♥ x " + scene.threeLives);
            }
            else
            {
                //scene.removeAllC();
                timerPlay.Stop();
                this.BackColor        = Color.DarkGray;
                gameOverLabel.Enabled = true;
                gameOverLabel.Visible = true;
                gameOverLabel.Text    = string.Format(lose + scene.flagMax);
                restartBtn.Visible    = true;
                restartBtn.Enabled    = true;
                inGameQ1.BackColor    = Color.DarkGray;
                inGameQ2.BackColor    = Color.DarkGray;
                scene.removeAllC();
                flag = 1;
            }
            if (timerPlay.Interval < 500)
            {
                scene.removeAllC();                             //*   treba dvapati da ja ima ovaa funkcija za da raboti
                timerPlay.Stop();
                this.BackColor        = Color.DarkGray;
                gameOverLabel.Enabled = true;
                gameOverLabel.Visible = true;
                gameOverLabel.Text    = string.Format(win + scene.flagMax);
                restartBtn.Visible    = true;
                restartBtn.Enabled    = true;
                inGameQ1.BackColor    = Color.DarkGray;
                inGameQ2.BackColor    = Color.DarkGray;
                scene.removeAllC();                              //*
                flag = 1;
            }
            this.checkQuests(); //proveruva dali se postignati samite quests
            scene.removeC();
            Invalidate(true);
        }
Esempio n. 2
0
 public void addC(Circles c)
 {
     circles.Add(c);
 }