Example #1
0
 //移动按键,并且创建按键0X2008
 public void keyMove()
 {
     try
     {
         //创建key
         while (Math.Abs(_currentTime + _speedCustom - _keyTime) <= 0.05)
         {
             for (int i = 0; i < 9; i++)
             {
                 if (myKey.Key[i] == true)
                 {
                     DrKey keys = new DrKey();
                     keys.Position = new Point((int)(155 * _zoomRate) + (int)(i * 80 * _zoomRate), (int)(120 * _zoomRate));
                     keys.KeyName  = keyChar[i].ToString();
                     _listDrKey.Add(keys);
                 }
             }
             _cursor++;
             if (_cursor >= KeyCount1)
             {
                 _cursor  = -1;
                 _keyTime = -1;
             }
             if (_cursor != -1)
             {
                 myKey    = _listKey[_cursor];
                 _keyTime = myKey.Min * 60 + myKey.Sec + myKey.Ms / 1000.0;
             }
         }
         //移动key
         for (int i = 0; i < _listDrKey.Count; i++)
         {
             drKey           = _listDrKey[i];
             drKey.MoveSpeed = (int)(_keySpeed * _zoomRate);
             drKey.Move();
             if (drKey.Position.Y >= 740 * _zoomRate)
             {
                 _combo = 0;
                 _listDrKey.RemoveAt(i);
                 drKey.Dispose();
                 i--;
             }
         }
     }
     catch (Exception exc)
     {
         showError("出现错误,ErrorCode:0X2008,ErrorInfo:" + exc);
     }
 }
Example #2
0
 //销毁0X2999
 public void Dispose()
 {
     try
     {
         drKey.Dispose();
         backgroundImg.Dispose();
         EndLine.Dispose();
         PointEasy.Dispose();
         PointNormal.Dispose();
         PointHard.Dispose();
         MusicIcon_Open.Dispose();
         Pause_Setting.Dispose();
         TimeLine.Dispose();
         nameLine.Dispose();
         Rescue.Dispose();
         Restart.Dispose();
         CloseForm.Dispose();
         Key2.Dispose();
     }
     catch (Exception exc)
     {
         showError("出现错误,ErrorCode:0X2999,ErrorInfo:" + exc);
     }
 }