示例#1
0
 public TwentyGame()
 {
     grid = new TwentyGrid ();
     renderer = new TwentyRenderer ();
     rand = new Random();
     score = 0;
 }
示例#2
0
 public TwentyGame()
 {
     grid     = new TwentyGrid();
     renderer = new TwentyRenderer();
     rand     = new Random();
     score    = 0;
 }
示例#3
0
 public void render(TwentyGrid grid, int score)
 {
     byte[] newBuffer = new byte[280];
     for (int row = 0; row < 4; row++) {
         Array rowVals = grid.getRow (row);
         for (int col = 0; col < 4; col++) {
             int offset = row * 20 + col * 5;
             GetBytes (rowVals.GetValue (col)).CopyTo(newBuffer, offset);
         }
     }
     buf.Write (newBuffer, 0, 260);
 }
示例#4
0
 public void render(TwentyGrid grid, int score)
 {
     byte[] newBuffer = new byte[280];
     for (int row = 0; row < 4; row++)
     {
         Array rowVals = grid.getRow(row);
         for (int col = 0; col < 4; col++)
         {
             int offset = row * 20 + col * 5;
             GetBytes(rowVals.GetValue(col)).CopyTo(newBuffer, offset);
         }
     }
     buf.Write(newBuffer, 0, 260);
 }