You have to get to the exit, but it will not open until you collect all the green gems first. However, it will depend on which path is chosen so that it collapses under your feet, so you will have to calculate your movements well. Eventually a double of yours will appear that will help or annoy you, depending on what you do.