Exemplo n.º 1
0
        protected override void OnPaint(PaintEventArgs e)
        {
            if (DoodlJumper2.FlyFaza == false)
            {
                Doodle2.Top += 2;
                System.Threading.Thread.Sleep(4);
            }
            if ((Doodle2.Top + 36 == 294) && (DoodlJumper2.FlyFaza == false))
            {
                DoodlJumper2.FlyFaza = true;
            }
            if (DoodlJumper2.FlyFaza == true)
            {
                Doodle2.Top -= 2;
                System.Threading.Thread.Sleep(4);
                hight++;
            }
            if (hight == 45)
            {
                DoodlJumper2.FlyFaza = false;
                hight = 0;
            }
            Graphics g = e.Graphics;

            g.DrawString("Records:", new Font("Segoe Script", 20), Brushes.Magenta, new RectangleF(20, 20, 200, 50));

            Doodle2.Refresh();
        }
Exemplo n.º 2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            if (DoodlJumper2.FlyFaza == false)
            {
                Doodle2.Top += 2;
                System.Threading.Thread.Sleep(4);
            }
            if ((Doodle2.Top + 36 == 294) && (DoodlJumper2.FlyFaza == false))
            {
                DoodlJumper2.FlyFaza = true;
            }
            if (DoodlJumper2.FlyFaza == true)
            {
                Doodle2.Top -= 2;
                System.Threading.Thread.Sleep(4);
                hight++;
            }
            if (hight == 45)
            {
                DoodlJumper2.FlyFaza = false;
                hight = 0;
            }
            Graphics g = e.Graphics;

            g.DrawString("Game Over!", new Font("Segoe Script", 20), Brushes.Gold, new RectangleF(40, 20, 200, 50));
            g.DrawString("You score: " + (score).ToString(), new Font("Segoe Script", 20), Brushes.Indigo, new RectangleF(10, 60, 400, 100));
            g.DrawString("Hightscore: " + hightscore.ToString(), new Font("Segoe Script", 15), Brushes.Indigo, new RectangleF(10, 100, 400, 100));
            g.DrawString("You name: ", new Font("Segoe Script", 15), Brushes.Indigo, new RectangleF(10, 130, 400, 100));
            Doodle2.Refresh();
        }
Exemplo n.º 3
0
        protected override void OnPaint(PaintEventArgs e)
        {
            if (DoodlJumper2.FlyFaza == false)
            {
                Doodle2.Top += 2;
                System.Threading.Thread.Sleep(4);
                if (Doodle2.Top + 36 > 350)
                {
                    Doodle2.Top = 0;
                }
            }
            if ((Doodle2.Top + 36 == 294) && (DoodlJumper2.FlyFaza == false) && (Doodle2.Location.X < 73) && (Doodle2.Location.X + 35 > 28))
            {
                DoodlJumper2.FlyFaza = true;
            }
            if ((Doodle2.Top + 36 == 295) && (DoodlJumper2.FlyFaza == false) && (Doodle2.Location.X < 73) && (Doodle2.Location.X + 35 > 28))
            {
                DoodlJumper2.FlyFaza = true;
            }
            if (DoodlJumper2.FlyFaza == true)
            {
                Doodle2.Top -= 2;
                System.Threading.Thread.Sleep(4);
                hight++;
            }
            if (hight == 45)
            {
                DoodlJumper2.FlyFaza = false;
                hight = 0;
            }
            Graphics g = e.Graphics;

            g.DrawString("DoodleJump!", new Font("Segoe Script", 20), Brushes.Magenta, new RectangleF(20, 20, 200, 50));
            Invalidate();
            Doodle2.Refresh();
            label5.Refresh();
        }