コード例 #1
0
 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);
     }
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: judgeou/Hannota
 public Form1()
 {
     han = new Hannota(layers);
     dh = new DrawHan(han);
     dh.Update();
     InitializeComponent();
 }
コード例 #3
0
 public Form1()
 {
     han = new Hannota(layers);
     dh  = new DrawHan(han);
     dh.Update();
     InitializeComponent();
 }
コード例 #4
0
 private void Start(object sender, EventArgs e)
 {
     dh.Dispose();
     han = new Hannota(layers);
     dh  = new DrawHan(han);
     dh.Update();
     draw(null, null);
 }
コード例 #5
0
ファイル: Form1.cs プロジェクト: judgeou/Hannota
 private void Start(object sender, EventArgs e)
 {
     dh.Dispose();
     han = new Hannota(layers);
     dh = new DrawHan(han);
     dh.Update();
     draw(null,null);
 }