private void control(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Up) { han.TakeUp(); } if (e.KeyCode == Keys.Down) { han.PutDown(); } if (e.KeyCode == Keys.Left) { han.MoveLeft(); } if (e.KeyCode == Keys.Right) { han.MoveRight(); } dh.Update(); draw(null, null); if (han.Win()) { MessageBox.Show(string.Format("游戏完成! 您移动了 {0} 次", han.times), "胜利"); Start(null, null); } }
public Form1() { han = new Hannota(layers); dh = new DrawHan(han); dh.Update(); InitializeComponent(); }
public Form1() { han = new Hannota(layers); dh = new DrawHan(han); dh.Update(); InitializeComponent(); }
private void Start(object sender, EventArgs e) { dh.Dispose(); han = new Hannota(layers); dh = new DrawHan(han); dh.Update(); draw(null, null); }
private void Start(object sender, EventArgs e) { dh.Dispose(); han = new Hannota(layers); dh = new DrawHan(han); dh.Update(); draw(null,null); }