Hi
I have another question about sf::View. It is center to my Player and follow him. But if the Player collide with a wall and stop the view still moves if the move button is pressed. So here is my code when the Player collide:
...
void player::plrBounce(Vector2f &wallBounce){
wallBounce = plrSprite.getPosition();
plrSprite.setPosition(wallBounce.x, wallBounce.y +5);
}
...
if(plr.plrSprite.getGlobalBounds().intersects(WallRect.getGlobalBounds())){
plr.plrBounce(wallBounce);
and here is my view setting:
View plrview( FloatRect(0, 0, 1300, 2600));
plrview.setCenter(plr.plrSprite.getPosition());
So what could i do that the playerview is parenting to the player and stops when he stops??