moved thread to MainFrame instead of MainPanel
construct Obstacle class