예제 #1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            ScoreList.Text = Score.ToString();
            if (CanFall())
            {
                figure.step();
            }
            else
            {
                if (figure.location.Y == 0)
                {
                    timer1.Enabled = false;
                    MessageBox.Show("Вы проиграли!!");

                    this.Close();
                }
                Fallist.AddRange(figure.FillPoints);
                //label2.Text = Convert.ToString(panel1.Height) + " " + Convert.ToString(figure.location.Y) + " " + Convert.ToString(Fallist[2].Y);
                figure = new Line();
                if (defaultLoc < 320)
                {
                    defaultLoc += 40;
                }
                else
                {
                    defaultLoc = 0;
                }
                figure.location = new Point(defaultLoc, 320);
                CheckLine();
            }
            panel1.Invalidate();
        }
예제 #2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            ScoreList.Text = Score.ToString();
            if (CanFall())
            {
                figure.step();
            }
            else
            {
                if (figure.location.Y == 0)
                {
                    timer1.Enabled = false;
                    MessageBox.Show("Вы проиграли!!");
                    this.Close();
                }
                Fallist.AddRange(figure.FillPoints);
                //List<OverPoint> TempList = new List<OverPoint>();
                ColorList.Add(new OverPoint(figure.FillPoints[0].X, figure.FillPoints[0].Y, figure.c));
                ColorList.Add(new OverPoint(figure.FillPoints[1].X, figure.FillPoints[1].Y, figure.c));
                ColorList.Add(new OverPoint(figure.FillPoints[2].X, figure.FillPoints[2].Y, figure.c));
                ColorList.Add(new OverPoint(figure.FillPoints[3].X, figure.FillPoints[3].Y, figure.c));
                //label2.Text = Convert.ToString(panel1.Height) + " " + Convert.ToString(figure.location.Y) + " " + Convert.ToString(Fallist[2].Y);
                figure = new Square();
                Randomize();

                /*if(defaultLoc < 320) defaultLoc += 40;
                 * else defaultLoc = 0;
                 * figure.location = new Point(defaultLoc, 320);*/
                CheckLine();
            }
            panel1.Invalidate();
        }