Пример #1
1
    public void Drop(Game game)
    {
      // get coordinates
      float[] x = new float[4];
      float[] y = new float[4];

      ToCoordinates(ref x, ref y);

      for (int i = 0; i < 4; i++)
      {
        if ((x[i] < Game.Width) && (y[i] < Game.Height))
        {
          game.Block[(int)x[i], (int)(y[i])] = m_nColor;
        }
      }

      game.Score += ((24 + (3 * game.Level)) - m_nFreefalls);
      game.CheckLines();
    }
Пример #2
0
        public void Drop(Game game)
        {
            // get coordinates
            float[] x = new float[4];
            float[] y = new float[4];

            ToCoordinates(ref x, ref y);

            for (int i = 0; i < 4; i++)
            {
                if ((x[i] < Game.Width) && (y[i] < Game.Height))
                {
                    game.Block[(int)x[i], (int)(y[i])] = m_nColor;
                }
            }

            game.Score += ((24 + (3 * game.Level)) - m_nFreefalls);
            game.CheckLines();
        }
Пример #3
0
 private static void TimerCallback(Object o)
 {
     if (play.isCurrentPieceFallen())
     {
         int lines = play.CheckLines();
         if (lines > 0)
         {
             play.SetScore(lines);
         }
         play.GetCurrentPiece();
     }
     else
     {
         play.Down();
         Show();
     }
     // Display the date/time when this method got called.
     Console.WriteLine("In TimerCallback: " + DateTime.Now);
     // Force a garbage collection to occur for this demo.
     GC.Collect();
 }