@Override
    public void initResources() {
        playfield = new PlayField();
        // Создание спрайт групп
        firstBallGroup = new SpriteGroup("firstBalls");
        secondBallGroup = new SpriteGroup("secondBalls");
        thirdBallGroup = new SpriteGroup("thirdBalls");
        
        playfield.addGroup(firstBallGroup);
        playfield.addGroup(secondBallGroup);
        playfield.addGroup(thirdBallGroup);
        // Создание спрайтов
        BufferedImage ballImage = getImage("img/ball.png");
        Sprite ball1 = new Sprite(ballImage, firstPoint.x, firstPoint.y);
        Sprite ball2 = new Sprite(ballImage, secondPoint.x, secondPoint.y);
        Sprite ball3 = null;
        if (thirdPoint != null) {
            ball3 = new Sprite(ballImage, thirdPoint.x, thirdPoint.y);
        }
        //Заполняем буфер
        Ball ballElement1 = new Ball(table);
        ballElement1.setWeight(firstWeigt);
        Ball ballElement2 = new Ball(table);
        ballElement2.setWeight(secondWeigt);
        Ball ballElement3 = new Ball(table);
        ballElement3.setWeight(thirdWeigt);
        table.addPair(ballElement1, ball1);
        table.addPair(ballElement2, ball2);
        if (thirdPoint != null) {
            table.addPair(ballElement3, ball3);
        }
        ballElement1.addCollisionHandleEndListener(this);
        ball1.setSpeed(firstVector.x(), firstVector.y());
        ball2.setSpeed(secondVector.x(), secondVector.y());
        if (thirdPoint != null) {
            ball3.setSpeed(thirdVector.x(), thirdVector.y());
        }
        // Добавление в спрайт группу и установка коллизии
        firstBallGroup.add(ball1);
        secondBallGroup.add(ball2);
        if (thirdPoint != null) {
            thirdBallGroup.add(ball3);
        }
        CollisionHandler handler = new CollisionHandler(table);
        handler.addHandleEndListener(this);
        collision = new CollisionObjectWithObject();
        collision.addSpritesCollidedListener(handler);
        playfield.addCollisionGroup(firstBallGroup, secondBallGroup, collision);
        clone1 = ballElement1.clone();
        clone2 = ballElement2.clone();
        
        if (thirdPoint != null) {
            playfield.addCollisionGroup(firstBallGroup, thirdBallGroup, collision);
            playfield.addCollisionGroup(thirdBallGroup, secondBallGroup, collision);
            clone3 = ballElement3.clone();
        }
    }