Esempio n. 1
0
 public TwentyGame()
 {
     grid = new TwentyGrid ();
     renderer = new TwentyRenderer ();
     rand = new Random();
     score = 0;
 }
Esempio n. 2
0
 public TwentyGame()
 {
     grid     = new TwentyGrid();
     renderer = new TwentyRenderer();
     rand     = new Random();
     score    = 0;
 }
Esempio n. 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);
 }
Esempio n. 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);
 }