The game you are thinking of is likely JezzBall. In it, players build walls to trap moving balls and clear each level.