private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) { SingleObject.GetSingle().SingleBird.Move(); SingleObject.GetSingle().SingleBird.speed = 10f; } }
public static SingleObject GetSingle() { if (_singleobject == null) { _singleobject = new SingleObject(); } return(_singleobject); }
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; }
private void Form1_MouseClick(object sender, MouseEventArgs e) { SingleObject.GetSingle().SingleBird.Move(); SingleObject.GetSingle().SingleBird.speed = 10f; }
private void Form1_Paint(object sender, PaintEventArgs e) { SingleObject.GetSingle().BirdDraw(e.Graphics); gdup.DrawGD(e.Graphics); gddown.DrawGD(e.Graphics); }
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); }