You have to collect the gems in order to go to the next room. Every zone is divided in 3 levels in which you have to collect 1, 2, and 3 gems respectively. If you were still having troubles, it may be solved by restarting the level or returning to the menu.