Ejemplo n.º 1
0
 //刷新形状
 public void Refresh(ref BaseShape bs, ref BaseShape newbs)
 {
     bs    = newbs;
     newbs = ShapeMgr.GetShape();
     x     = 1;
     y     = 6;
 }
Ejemplo n.º 2
0
 public void StartGame()
 {
     //初始化键盘监听线程
     keyDownThread = new Thread(new ThreadStart(KeyDownThread));
     //注册键盘触发事件对应的函数
     KeyDown += new KeyDownEventHander(KeyDownEvent);
     score    = 0;
     mgr      = ShapeMgr.GetShape();
     newmgr   = ShapeMgr.GetShape();
     //启动线程
     keyDownThread.Start();
     Getboard();
     //计时器
     System.Timers.Timer timer;
     timer          = new System.Timers.Timer(1000);
     timer.Elapsed += new ElapsedEventHandler(Timer_Elapsed);
     timer.Start();
 }