public void paint(Graphics g) { //function for painting and displaying
        super.paint(g);

        if (ingame) { //paints/repaints if the game is in process (refer to "in game")
        	g.drawImage(bg.getImage(), bg.getX(), bg.getY(), //draws the paddle
                    bg.getWidth(), bg.getHeight(), this);         

        	for (int i = 0; i < 68; i++) { //for each of the 30 bricks
                if (!bricks[i].isDestroyed()){ 
                	if (!bricks[i].isCracked() && !bricks[i].isDestroyed()){
                		bricks[i].draw(g,  this);
                	}
                	else{
                		bricks[i].draw1(g, this);
                	}
                }       	
            }
        
            for (int i = 0; i < bonusList.size(); i++) {
				isDeath = false;
            	if( i % 3 == 0 ){
            	
					bonusList.get(i).draw(g, this);
					isDeath = false;
            	}
				else{
			
					isDeath = true;
					bonusList.get(i).draw1(g, this);
				}
			}
            for (Bullet bul : bulletList)
                bul.draw(g,  this);
			
            	
			
            
        	paddle.draw(g, this);
        	ball.draw(g, this);
        	String scorestring ="Score: " + Integer.toString(score);
        	Font font = new Font("Verdana", Font.BOLD, 14); //declares the fond
            FontMetrics metr = this.getFontMetrics(font); //sets the fond
        	g.setColor(Color.RED);
            g.setFont(font);
            g.drawString(scorestring,
                         (Commons.WIDTH - this.getFontMetrics(font).stringWidth(scorestring)) - 500, //game over message
                         Commons.HEIGTH - 30);
        } else { //if the game has ended

        	Font font1 = new Font("Verdana", Font.BOLD, 18); //declares the fond
            FontMetrics metr1 = this.getFontMetrics(font1); //sets the fond
        	g.setColor(Color.BLACK);
            g.setFont(font1);
            g.drawString(message,
                         (Commons.WIDTH - metr1.stringWidth(message)) / 2, //game over message
                         Commons.WIDTH / 2);
        }

        Toolkit.getDefaultToolkit().sync();
        g.dispose(); //toolkit no fucking idea 
    }