diff --git a/lib/game/Game.dart b/lib/game/Game.dart index f9851c0..7291f59 100644 --- a/lib/game/Game.dart +++ b/lib/game/Game.dart @@ -1,5 +1,7 @@ import 'dart:html'; +typedef void gridIterator(int x, int y); + class Game { List> grid; CanvasElement canvas; @@ -19,28 +21,29 @@ class Game { int brickW = (canvas.width ~/ grid[0].length); int brickH = (canvas.height ~/ grid.length); - ctx.setFillColorRgb(255, 0,0); ctx.clearRect(0, 0, canvas.width, canvas.height); - for(int y=0;y> buildGrid(int w, int h, Color col) { List> grid = new List(h); - - - for(int y = 0; y< h; y++) { + for (int y = 0; y < h; y++) { grid[y] = new List(w); - for(int x = 0; x< w; x++) { + for (int x = 0; x < w; x++) { grid[y][x] = col; } } @@ -54,10 +57,9 @@ class Color { final int b; const Color(this.r, this.g, this.b); - } // Create 2d array // fill with random colors // cycle colors -// set one color to random new one \ No newline at end of file +// set one color to random new one