Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void run() {
- addBricks();
- }
- //=============
- private void addBricks() {
- for (int i = 0; i<NBRICK_ROWS; i++) {
- //Color color = getColorForRow(i);
- addRow(BRICK_SEP/2,BRICK_Y_OFFSET + i*(BRICK_HEIGHT + BRICK_SEP), new Color(255,0,0)) ;
- }
- }
- private void addRow(int rowX, int rowY, Color color) {
- for(int i= 0; i< NBRICKS_PER_ROW; i++ ) {
- int brickX = rowX + (i* BRICK_SEP) + (i* BRICK_WIDTH);
- GRect rect = new GRect (brickX, rowY, BRICK_WIDTH, BRICK_HEIGHT);
- rect.setFilled(true) ;
- rect.setColor(color);
- rect.setFillColor(color);
- add(rect);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement