示例#1
0
文件: Form1.cs 项目: koutcha/bo
 private void checkKeysForTitle()
 {
     if (keymanage.getKeysDownFrame(Keys.Enter) > 0)
     {
         onGameState = StatusOnGame.Preparation;
     }
 }
示例#2
0
文件: Form1.cs 项目: koutcha/bo
 public MainGame(KeyManager keymanager)
 {
     this.keymanager = keymanager;
     this.title      = new Title(Resources.IMG_0013);
     onGameState     = StatusOnGame.Title;
     reset();
 }
示例#3
0
文件: Form1.cs 项目: koutcha/bo
 private void checkKeyForGameClear()
 {
     if (keymanager.OnEnter)
     {
         onGameState = StatusOnGame.Preparation;
         reset();
     }
     if (keymanager.OnSpace)
     {
         onGameState = StatusOnGame.Title;
         reset();
     }
 }
示例#4
0
文件: Form1.cs 项目: koutcha/bo
        private void GameclearCheck()
        {
            int lifesum = 0;

            for (int i = 0; i < blocks.GetLength(0); i++)
            {
                for (int j = 0; j < blocks.GetLength(1); j++)
                {
                    lifesum += blocks[i, j].Life;
                }
            }

            if (lifesum == 0)
            {
                onGameState = StatusOnGame.GameClear;
            }
        }
示例#5
0
文件: Form1.cs 项目: koutcha/bo
        private void GameOverCheck()
        {
            if ((ball.Y + ball.Height) > bg.Y + bg.Height)
            {
                plife       = plife - 1;
                ball.Dx     = Ballspeed;
                ball.Dy     = Ballspeed;
                onGameState = StatusOnGame.Preparation;
                if (plife < 0)
                {
                    plife       = 0;
                    onGameState = StatusOnGame.GameOver;

                    bar.stop();
                }
            }
        }
示例#6
0
文件: Form1.cs 项目: koutcha/bo
 private void checkeyForPreparation()
 {
     if (keymanager.OnLeft && keymanager.OnRight)
     {
         bar.stop();
     }
     else if (keymanager.OnLeft)
     {
         bar.moveL();
     }
     else if (keymanager.OnRight)
     {
         bar.moveR();
     }
     else
     {
         bar.stop();
     }
     if (keymanager.OnUp)
     {
         ball.StickingBarMotion(bar);
         onGameState = StatusOnGame.Playing;
     }
 }