Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- public class Brick {
- //add instance variables for the Brick class here
- Rectangle brickRect;
- int x;
- int y;
- boolean exists;
- public Brick(int x, int y, boolean exists) {
- brickRect = new Rectangle(x, y, BreakOutConstants.BRICK_WIDTH, BreakOutConstants.BRICK_HEIGHT);
- this.x = x;
- this.y = y;
- this.exists = exists;
- }
- //-------------------------------------------------------------------
- //-------- DRAW THE BRICK OBJECT ------------------------------------
- //-------------------------------------------------------------------
- public void drawBrick(Graphics g) {
- Graphics2D g2d = (Graphics2D)g;
- g2d.setStroke(new BasicStroke(2.0f));
- g2d.draw(brickRect);
- g2d.setPaint(Color.blue);
- g2d.fill(brickRect);
- }
- public void makeDisappear() {
- exists = false;
- }
- public boolean getExists() {
- return exists;
- }
- public void changeBrickColor() {
- }
- }
Add Comment
Please, Sign In to add comment