Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

BeanDog

2d shadows using DDraw - reverse color keys?

This topic is 6938 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 am making a RTS game (real time strategy) and I want my flying creatures to have shadows. So I figure, they''re little, at most 36x36 pixels, so I''ll just draw shadows where they would be on the ground (alpha blending) and then move ''em up 8 pixels (maybe 16) and put ''em down. Only problem is, how do I do the shadows? I was thinking I would use the same sprite picture, just use all grey where color would be, and not draw at all where the sprite is transparent (black). Makes sense, right? I have absolutely no idea in all of Hades, so help me Ghandi. Could some really imaginative person come up with an idea? BTW, I do not know ANY ASSEMBLER AT ALL!!! So please do not tell me to write a cute little routine to do it. I can''t do assembler and C++ would crawl with just a few dozen onscreen at a time. However, if you would in all your kindness and mercy write an assembler routine FOR me, that might be different. Of course, the only assembler I have is Borland TASM from the 80''s... ~BenDilts( void ); Bean Dog

Share this post


Link to post
Share on other sites
Advertisement
Your method of drawing grey where there is a non-transparent colour in the original sprite would be fine most of the time, I''m sure. Although I might not alpha blend it myself, rather I might just only draw every 2nd pixel of the shadow so that the background shows through that way.

Share this post


Link to post
Share on other sites
Any implementation ideas? I can''t think of any built-in DDraw commands for what I''m thinking of, and it would seem that looping through and drawing every other pixel would be really slow.

Share this post


Link to post
Share on other sites
You could create a shadow surface with every other pixel set to transparent. Then just blit the shadow first at the right coordinates and then blit the flying creature a bit above that place.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!