コード例 #1
0
        private void LoseFormCalling()
        {
            if ((DoodlJumper.Lose == true) && (_lose < ApplicationSettings.LoseNumber))
            {
                DoodlJumper.Top += 1;
                _lose++;
                _step = _game.AutoScrollPosition.Y;
                _game.AutoScrollPosition = new Point(_game.AutoScrollPosition.X, (-1) * _step + ApplicationSettings.ScrollNumber);
                System.Threading.Thread.Sleep(ApplicationSettings.Sleep);

                if (_lose == ApplicationSettings.LoseNumber)
                {
                    Lose loseform = new Lose(_score, _menu);
                    loseform.Show();
                    _game.Close();
                }
            }
        }
コード例 #2
0
 private void LoseFormCalling()
 {
     if ((_DoodlJumper.Lose == true) && (_lose < ApplicationSettings.LoseNumber))
     {
         DoodleJumper.Top += 1;
         if (DoodleJumper.Top < 0)
         {
             DoodleJumper.Visible = false;
         }
         System.Threading.Thread.Sleep(ApplicationSettings.Sleep);
         _step = this.AutoScrollPosition.Y;
         this.AutoScrollPosition = new Point(this.AutoScrollPosition.X, (-1) * _step + ApplicationSettings.ScrollNumber);
         DoodleJumper.Refresh();
         _lose++;
         if (_lose == ApplicationSettings.LoseNumber)
         {
             Lose loseform = new Lose(_score, _menu);
             loseform.Show();
             this.Close();
         }
     }
 }
コード例 #3
0
ファイル: ListTetradi.cs プロジェクト: taler0n/Students
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            if ((DoodlJumper1.lose == true) && (lose < 100))
            {
                DoodleJumper.Top += 1;
                if (DoodleJumper.Top < 0)
                {
                    DoodleJumper.Visible = false;
                }
                System.Threading.Thread.Sleep(4);
                step = this.AutoScrollPosition.Y;
                this.AutoScrollPosition = new Point(this.AutoScrollPosition.X, (-1) * step + 7);
                DoodleJumper.Refresh();
                lose++;
                if (lose == 100)
                {
                    Lose l = new Lose(score, menu);
                    l.Show();
                    this.Close();
                }
            }
            #region FlayDownFaza
            if (DoodlJumper1.FlyFaza == false)
            {
                hightjump         = 0;
                DoodleJumper.Top += 2;
                if ((DoodleJumper.Location.Y - 36 > 290) && (DoodlJumper1.lose != true))
                {
                    foreach (Control p in Controls)
                    {
                        if ((p.Name != DoodleJumper.Name) && (p.GetType() == typeof(Label)) && (p.Location.Y > DoodleJumper.Location.Y - 100))
                        {
                            p.Visible = false;
                        }
                    }
                    DoodlJumper1.lose = true;
                }
                System.Threading.Thread.Sleep(4);
            }
            #endregion

            #region OnStep
            if (!DoodlJumper1.lose)
            {
                foreach (Step s in steps[(DoodleJumper.Top + (-1) * this.AutoScrollPosition.Y + 36) / 250])
                {
                    if (((DoodleJumper.Top + (-1) * this.AutoScrollPosition.Y + 36) == s.y) && (DoodleJumper.Location.X < s.x2) && (DoodleJumper.Location.X + 26 > s.x1))
                    {
                        DoodlJumper1.FlyFaza = true;
                    }
                    if (((DoodleJumper.Top + (-1) * this.AutoScrollPosition.Y + 37) == s.y) && (DoodleJumper.Location.X < s.x2) && (DoodleJumper.Location.X + 26 > s.x1) && (DoodlJumper1.FlyFaza == false))
                    {
                        s.label.Visible = false;
                    }
                }
            }
            #endregion

            #region FlyUpFaza
            if ((DoodlJumper1.FlyFaza == true) && (DoodlJumper1.lose != true))
            {
                DoodleJumper.Top -= 2;
                System.Threading.Thread.Sleep(4);
                hightjump++;
                step = this.AutoScrollPosition.Y;
                if (DoodleJumper.Top < 200)
                {
                    this.AutoScrollPosition = new Point(this.AutoScrollPosition.X, (-1) * step - 3);
                }
                if (hightjump == 45)
                {
                    DoodlJumper1.FlyFaza = false;
                }
            }
            #endregion
            if (DoodlJumper1.lose != true)
            #region Role
            {
                foreach (Step p in steps[(DoodleJumper.Top + (-1) * this.AutoScrollPosition.Y + 51) / 250])
                {
                    if ((p.role == true) && (p.left == true))
                    {
                        p.label.Left++;
                        p.x1++;
                        p.x2++;
                        if (p.label.Left > 200)
                        {
                            p.left = false;
                        }
                    }
                    if ((p.role == true) && (p.left == false))
                    {
                        p.label.Left--;
                        p.x1--;
                        p.x2--;
                        if (p.label.Left < 30)
                        {
                            p.left = true;
                        }
                    }
                }
            }
            foreach (Step p in steps[(DoodleJumper.Top + (-1) * this.AutoScrollPosition.Y - 200) / 250])
            {
                if ((p.role == true) && (p.left == true))
                {
                    p.label.Left++;
                    p.x1++;
                    p.x2++;
                    if (p.label.Left > 200)
                    {
                        p.left = false;
                    }
                }
                if ((p.role == true) && (p.left == false))
                {
                    p.label.Left--;
                    p.x1--;
                    p.x2--;
                    if (p.label.Left < 30)
                    {
                        p.left = true;
                    }
                }
            }

            #endregion

            #region Refreah
            DoodleJumper.Refresh();
            if (DoodlJumper1.lose != true)
            {
                foreach (Step p in steps[(DoodleJumper.Top + (-1) * this.AutoScrollPosition.Y + 36) / 250])
                {
                    p.label.Refresh();
                }
                foreach (Step p in steps[(DoodleJumper.Top + (-1) * this.AutoScrollPosition.Y - 214) / 250])
                {
                    p.label.Refresh();
                }
            }
            #endregion

            #region Score
            if (DoodlJumper1.lose != true)
            {
                g.DrawString("Score:" + (4672 + this.AutoScrollPosition.Y).ToString(), new Font("Arial", 10), Brushes.Black, new RectangleF(0, 0, 100, 18));
                score = (4672 + this.AutoScrollPosition.Y);
            }
            #endregion


            this.Invalidate();

            base.OnPaint(e);
        }
コード例 #4
0
ファイル: GameMainWindow.cs プロジェクト: Confirmit/Students
        private void LoseFormCalling()
        {
            if ((_DoodlJumper.Lose == true) && (_lose < ApplicationSettings.LoseNumber))
            {
                DoodleJumper.Top += 1;
                if (DoodleJumper.Top < 0)
                    DoodleJumper.Visible = false;
                System.Threading.Thread.Sleep(ApplicationSettings.Sleep);
                _step = this.AutoScrollPosition.Y;
                this.AutoScrollPosition = new Point(this.AutoScrollPosition.X, (-1) * _step + ApplicationSettings.ScrollNumber);
                DoodleJumper.Refresh();
                _lose++;
                if (_lose == ApplicationSettings.LoseNumber)
                {

                    Lose loseform = new Lose(_score, _menu);
                    loseform.Show();
                    this.Close();
                }
            }
        }
コード例 #5
0
ファイル: ListTetradi.cs プロジェクト: Confirmit/Students
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            if ((DoodlJumper1.lose == true) && (lose < 100))
            {
                DoodleJumper.Top += 1;
                if (DoodleJumper.Top < 0)
                    DoodleJumper.Visible = false;
                System.Threading.Thread.Sleep(4);
                step = this.AutoScrollPosition.Y;
                this.AutoScrollPosition = new Point(this.AutoScrollPosition.X, (-1) * step + 7);
                DoodleJumper.Refresh();
                lose++;
                if (lose == 100)
                {

                    Lose l = new Lose(score,menu);
                    l.Show();
                    this.Close();
                }
            }
            #region FlayDownFaza
            if (DoodlJumper1.FlyFaza == false)
            {
                hightjump = 0;
                DoodleJumper.Top+=2;
                if ((DoodleJumper.Location.Y - 36 > 290)&&(DoodlJumper1.lose != true))
                {
                    foreach (Control p in Controls)
                    {
                        if ((p.Name != DoodleJumper.Name) && (p.GetType() == typeof(Label)) && (p.Location.Y > DoodleJumper.Location.Y - 100))
                        {
                            p.Visible = false;
                        }
                    }
                    DoodlJumper1.lose = true;

                }
                System.Threading.Thread.Sleep(4);
            }
            #endregion

            #region OnStep
            if (!DoodlJumper1.lose )
            {
                foreach (Step s in steps[(DoodleJumper.Top + (-1) * this.AutoScrollPosition.Y + 36) / 250])
                {

                    if (((DoodleJumper.Top + (-1) * this.AutoScrollPosition.Y + 36) == s.y) && (DoodleJumper.Location.X < s.x2) && (DoodleJumper.Location.X + 26 > s.x1))
                    {
                        DoodlJumper1.FlyFaza = true;
                    }
                    if (((DoodleJumper.Top + (-1) * this.AutoScrollPosition.Y + 37) == s.y) && (DoodleJumper.Location.X < s.x2) && (DoodleJumper.Location.X + 26 > s.x1) && (DoodlJumper1.FlyFaza == false))
                    {
                        s.label.Visible = false;
                    }
                }
            }
            #endregion

            #region FlyUpFaza
            if ((DoodlJumper1.FlyFaza == true)&&(DoodlJumper1.lose != true))
            {
                DoodleJumper.Top-=2;
                System.Threading.Thread.Sleep(4);
                hightjump++;
                step = this.AutoScrollPosition.Y;
                if (DoodleJumper.Top < 200)
                {
                    this.AutoScrollPosition = new Point(this.AutoScrollPosition.X, (-1) * step - 3);
                }
                if (hightjump == 45)
                {
                    DoodlJumper1.FlyFaza = false;
                }
            }
            #endregion
            if(DoodlJumper1.lose != true)
            #region Role
            foreach (Step p in steps[(DoodleJumper.Top + (-1) * this.AutoScrollPosition.Y + 51) / 250])
            {
                if ((p.role == true)&&(p.left==true))
                {
                    p.label.Left++;
                    p.x1++;
                    p.x2++;
                    if(p.label.Left>200)
                    {
                        p.left = false;
                    }
                }
                if ((p.role == true) && (p.left == false))
                {
                    p.label.Left--;
                    p.x1--;
                    p.x2--;
                    if (p.label.Left < 30)
                    {
                        p.left = true;
                    }
                }
            }
            foreach (Step p in steps[(DoodleJumper.Top + (-1) * this.AutoScrollPosition.Y - 200) / 250])
            {
                if ((p.role == true) && (p.left == true))
                {
                    p.label.Left++;
                    p.x1++;
                    p.x2++;
                    if (p.label.Left > 200)
                    {
                        p.left = false;
                    }
                }
                if ((p.role == true) && (p.left == false))
                {
                    p.label.Left--;
                    p.x1--;
                    p.x2--;
                    if (p.label.Left < 30)
                    {
                        p.left = true;
                    }
                }
            }

            #endregion

            #region Refreah
            DoodleJumper.Refresh();
            if (DoodlJumper1.lose != true)
            {
                foreach (Step p in steps[(DoodleJumper.Top + (-1) * this.AutoScrollPosition.Y + 36) / 250])
                {
                    p.label.Refresh();

                }
                foreach (Step p in steps[(DoodleJumper.Top + (-1) * this.AutoScrollPosition.Y - 214) / 250])
                {
                    p.label.Refresh();

                }
            }
            #endregion

            #region Score
            if (DoodlJumper1.lose != true)
            {
                g.DrawString("Score:" + (4672 + this.AutoScrollPosition.Y).ToString(), new Font("Arial", 10), Brushes.Black, new RectangleF(0, 0, 100, 18));
                score = (4672 + this.AutoScrollPosition.Y);
            }
            #endregion

            this.Invalidate();

            base.OnPaint(e);
        }
コード例 #6
0
ファイル: Calculator.cs プロジェクト: Confirmit/Students
        private void LoseFormCalling()
        {
            if ((DoodlJumper.Lose == true) && (_lose < ApplicationSettings.LoseNumber))
            {
                DoodlJumper.Top += 1;
                _lose++;
                _step = _game.AutoScrollPosition.Y;
                _game.AutoScrollPosition = new Point(_game.AutoScrollPosition.X, (-1) * _step + ApplicationSettings.ScrollNumber);
                System.Threading.Thread.Sleep(ApplicationSettings.Sleep);

                if (_lose == ApplicationSettings.LoseNumber)
                {
                    Lose loseform = new Lose(_score, _menu);
                    loseform.Show();
                    _game.Close();
                }
            }
        }