TheKill Posted April 25, 2008 Posted April 25, 2008 Hello! im new here so be nice. lol anyway, im working on a game in C#, scrolled RPG based (like golden axe style, screenshot added), with DX9. now i got a question.. this game is in 2D, and i want to add some lightnning effects (like when its night everything will be darker but there will be light source). i need some directions, how would you do that?? i could just make everything darker and draw half visible sprites of half visible white light circles, but than things will "loss" colors and its a louzy effect. i also thought about making things darker relevantly to their distance from light sources, but my terrain sprites are too big (256x128) and it will look too sharp. and i really rather not break my sprites. so anyone got any ideas of how can i make some neat light sources effects in 2D? thanks in advance Quote
EFileTahi-A Posted June 14, 2008 Posted June 14, 2008 (edited) Well to simulate the dark night is easy, u simply use the sprite.render method with customized color palette: sprite.Draw(..., Color.FromArgb(255,60,60,80) This will darken all ur sprites as well make them slightly blue (to better simulate the night light). As for the light, like a torch in player's hand, well I think you would need two images, one rendered as night and another as day light, then you could mix them with some kind of mask applyed to the night rendered picture, which would be transparent in the middle to reveal a bit of day light... I really can't tell you how though... and I really don't know if it would work, but.. just a thought... The effect can be shown bellow It would be nice also to have a separate sky layer so u could change the day clouds with some night stars, and also add some flickering to the light. I hope this helps in any way. Edited June 14, 2008 by EFileTahi-A Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.