class Block { int blockSize; int x, y, col, row, timer; //timer for prolonging special weapons displays boolean missile, shield, hit; //for variables missile and shield, true when the block contains any of the special weapons //for variable hit, true when the block gets hit Block(int i, boolean m, boolean s) { blockSize = 50; row = i%14; col = i/14; x = col*50+430; y = row*50+25; timer = 0; missile = m; shield = s; hit = false; } void drawBlock() { if (hit) { if (missile) { //if the block contains a missile image(missileImg, x-25, y-25, 50, 50); } if (shield) { //if the block contains a shield image(shieldImg, x-25, y-25, 50, 50); } } else { //if the block is empty fill(128); strokeWeight(2); stroke(0, 0, 200, 50); rectMode(CENTER); rect(x, y, blockSize, blockSize); } } //Removing the block void destroy(ArrayList b) { b.remove(this); } }