Good evening,
I am a beginner with SFML, and need help with some basic things.
My intention is to keep the sprite inside the window. I tried a lot and this is my result:
float maxheight = App.GetHeight() + Sprite.GetSize().x;
if(Sprite.GetPosition().x > maxheight)
Sprite.SetPosition(App.GetWidth() - Sprite.GetSize().x, Sprite.GetPosition().y);
It works pretty well, but there is one thing I don't agree with. If the Sprite is going to move right outside, it's pushed back a little. How can I remove that "push back"?