2D Collision Detection in C++
const bool Game::isColliding(...

This indicates that the returned type is const, and should not be modified by any part of your code. But it's not a reference, so it doesn't make sense. It should compile, but it's a little confusing. Removing that const is clearer.

see this SO question for more information on that.



Your parameters to isColliding should be const references:

bool Game::isColliding(const sf::RectangleShape&amp; player, const sf::RectangleShape&amp; enemy) const


because you don't modify them, and references will prevent each object form being copied.



You never use the player parameter that you pass to the isColliding function. this-&gt;player is not the same as player in this context. It seems like you want to check the Game's current player object against collisions with arbitrary objects. You either


Make the function static (so it doesn't rely on a particular Game state) and pass two arbitrary objects to be checked for collision, or
Change the function name to something that indicates it will only be used with the player object.


One of:

static bool Game::isColliding(const sf::RectangleShape&amp; a, const sf::RectangleShape&amp; b)


or

bool Game::isPlayerColliding(const sf::RectangleShape&amp; other) const




These Vector2d assignments can be made into const references to prevent copy construction.

    const sf::Vector2f&amp; playerPosition = this-&gt;player.getPosition();
    const sf::Vector2f&amp; enemyPosition = this-&gt;enemy.getPosition();