public void draw(Graphics g){
        requestFocus();
        if(b.getNumberOfLifes() != 0) {
            g.setColor(Color.decode("#666666"));
            g.fillOval(b.getBall().x, b.getBall().y, b.getBall().width, b.getBall().height);
            drawPaddle(g, b.getP1().getId(), b.getP1().getPaddle());
            if(b.getPowerCreator().isIntersection()) {
                g.drawImage(b.getPower(),b.getPowerCreator().getPower().x, b.getPowerCreator().getPower().y, null);
            }
            if (!b.isSinglePlayer()) {
                drawPaddle(g, b.getP2().getId(), b.getP2().getPaddle());
            }
            if(b.getShooterCreator() != null){
                g.setColor(Color.decode("#43ABDC"));
                g.fillRect(b.getShooterCreator().getShooter().x, b.getShooterCreator().getShooter().y, b.getShooterCreator().getShooter().width, b.getShooterCreator().getShooter().height);
            }
            if(screenCreate.getNumberOfBrokenBlocks() == screenCreate.getBlockCreatorList().size()){
                levelNumber += 1;
                screenCreate = new ScreenCreate(singleplayer,levelNumber,getNumberOfBlocks(difficulty));
                b.setScreenCreate(screenCreate);
                b.setSpeed(Database.DatabaseInstance.fillLevels().get(levelNumber).getBallSpeed());
                b.getP1().setWidth(Database.DatabaseInstance.fillLevels().get(levelNumber).getPaddleLength());
                b.getP2().setWidth(Database.DatabaseInstance.fillLevels().get(levelNumber).getPaddleLength());
                b.getBall().x = b.getP1().getPaddle().x + b.getP1().getPaddle().width/2;
                b.setStartSpeed(Database.DatabaseInstance.fillLevels().get(levelNumber).getBallSpeed());
                b.setBreakBlocks(false);
            }
            for(BlockCreator blockCreator: screenCreate.getBlockCreatorList()) {
                if (blockCreator.getNumberOfHitsLeft() != 0) {
                    g.setColor(blockCreator.getColor());
                    g.fillRect(blockCreator.getBlock().x, blockCreator.getBlock().y, blockCreator.getBlock().width, blockCreator.getBlock().height);
                    g.setColor(Color.black);
                    g.drawRect(blockCreator.getBlock().x, blockCreator.getBlock().y, blockCreator.getBlock().width, blockCreator.getBlock().height);
                }
            }
        }
        else{
            centerPanel.addHighScoreAddPanel(b.getP1Score());
        }
        repaint();
    }