示例#1
0
 public void LookUp(bool active, GameTime gameTime, Player player)
 {
     if (active)
     {
         showTimer += gameTime.ElapsedGameTime.Milliseconds;
         if (showTimer > 1000)
         {
             if (showCount < showMax)
             {
                 showCount++;
                 foreach (Blocks block in Blocks.BlockList)
                 {
                     block.IncreaseCoordBlockY(1);
                 }
                 foreach (Camera cam in Camera.CamerasBlockList)
                 {
                     cam.IncreaseSpotCoordBlockY(1);
                 }
                 foreach (MovableEnnemyBlock block in MovableEnnemyBlock.MovableEnnemyList)
                 {
                     block.IncreaseCoordBlockX(1);
                 }
             }
         }
     }
     else
     {
         showTimer = 0;
         int speedShow = 5;
         showCount -= speedShow;
         if (showCount < 0)
         {
             showCount += speedShow;
             speedShow = 1;
             showCount -= speedShow;
         }
         if (showCount >= 0)
         {
             foreach (Blocks block in Blocks.BlockList)
             {
                 block.DecreaseCoordBlockY(speedShow);
             }
             foreach (Camera cam in Camera.CamerasBlockList)
             {
                 cam.DecreaseSpotCoordBlockY(speedShow);
             }
             foreach (MovableEnnemyBlock block in MovableEnnemyBlock.MovableEnnemyList)
             {
                 block.DecreaseCoordBlockX(1);
             }
             player.CheckGravity();
         }
     }
 }