I have a house sprite and a character sprite. I do not want my character to "go through" the house sprite and all future house sprites. So how do I add the house sprite to a list and then make it so that for every house in house\_sprites, character sprite cannot pass through? Or if there is any other way to make my character not "go through" multiple sprites without programming the collisions for them 1 by 1. I am using c++ and sfml with xcode. I dont want to write the following code for every "solid" sprite in the game. So how do I make it so that I can add a sprite to a list if I want it to be "solid"?
` 

```
   if(sprite.getGlobalBounds().intersects(EnterHouse.getGlobalBounds()))
    {

        if (GoingLeft == true)
        {
            x_pos = x_pos + speed;
            x = x + speed;
        }
        if(GoingDown == true)
        {
            y_pos = y_pos - speed;
            y = y - speed;
        }
        if(GoingRight == true)
        {

            x_pos = x_pos - speed;
            x = x - speed;
        }
        if(GoingUp == true and y > 2530)
        {
            y_pos = y_pos + speed;
            y = y + speed;
        }
        if(GoingUp == true and x_pos < 20230)
        {
            x_pos = x_pos - speed;
            x = x - speed;
        }
        if(GoingUp == true and x_pos > 20230)
        {
            x_pos = x_pos + speed;
            x = x + speed;
        }
        if(GoingDown == true and x_pos < 20230)
        {
            x_pos = x_pos - speed;
            x = x - speed;
        }
        if(GoingDown == true and x_pos > 20230)
        {
            x_pos = x_pos + speed;
            x = x + speed;
        }`

```