@Override
    public void initResources() {
        
        playfield = new PlayField();
        // Создание спрайт групп
        ballGroup = new SpriteGroup("Balls");
        brickGroup = new SpriteGroup("Bricks");
        
        playfield.addGroup(ballGroup);
        playfield.addGroup(brickGroup);
        
        // Создание спрайтов
        BufferedImage ballImage = getImage("img/ball.png");
        BufferedImage brickImage = getImage("img/brick.png");
        Sprite ball = new Sprite(ballImage, firstPoint.x, firstPoint.y);
        Sprite brick1 = new Sprite(brickImage, secondPoint.x, secondPoint.y);
        Sprite brick2 = null;
        if (thirdPoint != null) {
            brick2 = new Sprite(brickImage, thirdPoint.x, thirdPoint.y);
        }
        //Заполняем буфер
        Ball ballElement = new Ball(table);
        DestroyableBrick brickElement1 = new DestroyableBrick(table);
        DestroyableBrick brickElement2 = new DestroyableBrick(table);
        table.addPair(ballElement, ball);
        table.addPair(brickElement1, brick1);
        if (thirdPoint != null) {
            table.addPair(brickElement2, brick2);
        }
        // Добавление в игровое поле
        field.addElement(ballElement);
        field.addElement(brickElement1);
        if (thirdPoint != null) {
            field.addElement(brickElement2);
        }
        ballElement.addCollisionHandleEndListener(this);
        ball.setSpeed(speedVector.x(), speedVector.y());
        // Добавление в спрайт группу и установка коллизии
        ballGroup.add(ball);
        brickGroup.add(brick1);
        if (thirdPoint != null) {
            brickGroup.add(brick2);
        }
        CollisionHandler handler = new CollisionHandler(table);
        handler.addHandleEndListener(this);
        collision = new CollisionObjectWithObject();
        collision.addSpritesCollidedListener(handler);
        playfield.addCollisionGroup(ballGroup, brickGroup, collision);
        cloneBall = ballElement.clone();
        cloneBrick1 = brickElement1.clone();
        if (thirdPoint != null) {
            cloneBrick2 = brickElement2.clone();
        }
    }