The goal is to remove all the balls. You can erase balls which are connected vertically or horizontally by clicking on them.