Jump to content
  • Advertisement
Sign in to follow this  
mrpingwin

Sprites appear thinner when moving

This topic is 4083 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm working on a 2D space invaders type game using LPD3DXSPRITE to draw sprites. So far I am just drawing one sprite on the screen and moving it left and right by 1 pixel at a time with the cursor keys. When the sprite is stationary, it looks fine but when it is moving the sprite appears to be thinner as though DirectX is scaling it to fit into a rectangle that is a few pixels too small. As soon as I stop moving it, the sprite reverts back to full size. Does this problem sound familiar to anyone? Thanks in advance for any assistance.

Share this post


Link to post
Share on other sites
Advertisement
I've never heard of this, but are you aware that you can use floats (and not just integers) as sprite coordinates? I would be interested to see if this still happens if you update by say 0.1 pixels instead of 1 pixel, or, even better, use time based movement and not just a simple increment. Using floating point values (which I failed to do at first) helps smooth things out considerably, especially because you should be working with some sort of resolution-independent units and not 'pixels' per se. Of course, this could be entirely unrelated to your problem since what you are describing SHOULD still work...

Share this post


Link to post
Share on other sites
Your sprite isn't moving at relativistic speeds (i.e. close to the speed of light), is it? Sorry, couldn't resist...

This might sound dumb, but you should try taking a screenshot while the sprite is in motion and zoom in with a pixel editor to see if it's actually smaller or not. Maybe it's just a trick of the eye?

Share this post


Link to post
Share on other sites
I don't suppose there's any chance you're using an older LCD screen? Ghosting can cause effects like this while objects are moving, but that seems pretty simplistic so I'd guess you've thought of that. :P

Other than that, try the screenshot idea or even just reset your sprite's position every frame (to see if it's a real effect - it should move by one pixel when you press/release your left/right buttons, and shrinkage and growage should show up if they're actually occurring. :)

Share this post


Link to post
Share on other sites
Quote:
Original post by fractoid
I don't suppose there's any chance you're using an older LCD screen? Ghosting can cause effects like this while objects are moving, but that seems pretty simplistic so I'd guess you've thought of that. :P


erm... no, ghosting hadn't occured to me at all.

I am using an LCD screen (a Dell UltraSharp monitor that is at least 4 years old) so perhaps it is some sort of issue with the monitor. I shall see if I can run it on a different PC with a better monitor and see if the problem goes away.






Share this post


Link to post
Share on other sites
The easiest thing to do to see if it is just a thing with ghosting or something is to do as strtok said. Take a screenshot (press the Prnt Scrn button, right above 'Insert' on most keyboard, just in case you didn't know), and voom in on it in, say, paint. Is the sprite _actually_ any smaller? Probably not.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!