public void draw(Canvas canvas) { for (int i = 0; i < this.nRows * this.nCols; ++i) { GameObject item = currentLayout[i]; if (item != null && !drawn.contains(item)) { int row = i / this.nCols; int col = i % this.nCols; // draw Object canvas.drawBitmap( item.getImage(), this.cellWidth * col, this.cellHeight * row, this.drawingPaint); drawn.add(item); } } drawn.clear(); }