   C++ collision detection and boundry detection
  I am making a game where the player uses the arrow keys to control a submarine to avoid obstacles. However I am unsure of to detect collisions between the 2 objects...Using c++ and SFML I have declared the Submarine sprite like thispublic: void Submarine::Init(const std::string& ImageFile){ cout&lt;&lt;"Sub loaded"; submarine.LoadFromFile(ImageFile); cout&lt;&lt;"Sub stored"&lt;&lt;endl; subSprite.SetImage(submarine); subSprite.SetPosition(150,300); subSprite.Scale(2.0,2.0);}and the obstacle sprites are declared like thisclass ObstacleSprite : public Sprite{public: ObstacleSprite(); ObstacleSprite(const Image &Img, const Vector2f &Position=Vector2f(0, 0), const Vector2f &Scale=Vector2f(1, 1), float Rotation=0.f, const Color &Col=Color(255, 255, 255, 255),float scrollPos=0.0); void setScrollPos(float scrollPos); void setVertPos(float vertPos); float getVertPos(void); float getScrollPos(void);}My best guess is a bounding box, but as i've never written one before I am unsure how to go about it. In the SFML documentation there may be somthing like 'get sub rect' but again I am unsure how to implement these...   
  SFML doesn't have any physics capabilities, so you'll have to do it yourself.  If you're looking for something simple, just have a PhysicsSimulator check for collisions between circle shapes.  (Circle shapes are the easiest to calculate since two circles are colliding if the distance between the centers of the two circles are less than the sum of their radii.)  If you're looking for something more complicated than simple collision detection, go for Box2D.   