Adding collisioncheck to obstacle.cpp