Esempio n. 1
0
 private void Form1_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Space)
     {
         SingleObject.GetSingle().SingleBird.Move();
         SingleObject.GetSingle().SingleBird.speed = 10f;
     }
 }
Esempio n. 2
0
 public static SingleObject GetSingle()
 {
     if (_singleobject == null)
     {
         _singleobject = new SingleObject();
     }
     return(_singleobject);
 }
Esempio n. 3
0
        private void timer2_Tick(object sender, EventArgs e)
        {
            var height = ZhongLi.GetHeight(SingleObject.GetSingle().SingleBird.speed, SingleObject.GetSingle().SingleBird.DurationTime *0.001f);
            int y      = SingleObject.GetSingle().SingleBird.Y + (int)height;

            y = y < 0 ? 0 : y;
            y = y > this.Size.Height - pictureBox1.Height - 60 ? this.Size.Height - pictureBox1.Height - 60 : y;
            SingleObject.GetSingle().SingleBird.Y = y;
            SingleObject.GetSingle().SingleBird.speed = SingleObject.GetSingle().SingleBird.speed + ZhongLi.G * SingleObject.GetSingle().SingleBird.DurationTime * 0.001f;
        }
Esempio n. 4
0
 private void Form1_MouseClick(object sender, MouseEventArgs e)
 {
     SingleObject.GetSingle().SingleBird.Move();
     SingleObject.GetSingle().SingleBird.speed = 10f;
 }
Esempio n. 5
0
 private void Form1_Paint(object sender, PaintEventArgs e)
 {
     SingleObject.GetSingle().BirdDraw(e.Graphics);
     gdup.DrawGD(e.Graphics);
     gddown.DrawGD(e.Graphics);
 }
Esempio n. 6
0
 public void InitailGame()
 {
     SingleObject.GetSingle().AddGameObject(new Bird(50, 200, 0));
     gdup   = new GuangDao(100, -600, GuangDao.GDDiration.up);
     gddown = new GuangDao(100, 400, GuangDao.GDDiration.down);
 }