Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Lafer

Pages: [1]
1
Graphics / [Sprite Movement] Question
« on: April 14, 2011, 07:27:24 pm »
Thank you very much!
It works now correctly.

2
Graphics / [Sprite Movement] Question
« on: April 14, 2011, 05:36:38 pm »
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:
Code: [Select]
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"?

Pages: [1]
anything