Hi all,
I have noticed that if we draw a sprite and we move it slowly outside the screen, instead of disappearing smoothly, it disappears at once. I mean, as soon as a pixel is going to be outside the screen, the whole sprite will be hidden.
This is ok for small sprites, but if we have a big one, the effect is very bad.
Is there an easy way of avoiding this?
If you want to see this effect, open the example program MFC, and comment out the following lines, so the sprites will not bounce once they reach the end of the screen.
Thanks
I have noticed that if we draw a sprite and we move it slowly outside the screen, instead of disappearing smoothly, it disappears at once. I mean, as soon as a pixel is going to be outside the screen, the whole sprite will be hidden.
This is ok for small sprites, but if we have a big one, the effect is very bad.
Is there an easy way of avoiding this?
If you want to see this effect, open the example program MFC, and comment out the following lines, so the sprites will not bounce once they reach the end of the screen.
- Code:
// Update direction X
if (koord.x < 2)
dir.x = 2;
else if (koord.x > (long)(dwScreenWidth - m_dwSpriteWidth - 2))
dir.x = -2;
// Update direction Y
if (koord.y < 2)
dir.y = 2;
else if (koord.y > (long)(dwScreenHeight - m_dwSpriteHeight - 2))
dir.y = -2;
Thanks