Simple 2D lantern effect for stealth-based game
#1
Posted 26 May 2012 - 02:02 AM
#2
Posted 26 May 2012 - 02:08 AM
People have made engines that do lighting, see http://gmc.yoyogames...pic=405212&st=0
#3
Posted 26 May 2012 - 03:26 AM
I think you would use surfaces to do something like this.
People have made engines that do lighting, see http://gmc.yoyogames...pic=405212&st=0
Not relevant to the topic, sorry. Just wanted to say thanks for posting that, I would have never known of this.
#4
Posted 26 May 2012 - 08:03 AM
I'm trying to make a stealth-based game, so obviously lighting is a major component. Unfortunately, I'm having trouble making it work how I want. Basically, what I need is an object that makes a circle of "light" that makes every pixel within it appear lighter. It would be fantastic if this effect could get weaker as is radiated out from the center. Most importantly, there need to be a few of these per room, so it can't be too laggy. I don't need anything fancy; it can pass through walls and such. Could someone give me a bit of guidance as to how to achieve the desired effect? Thanks.
If you make a white circle as a sprite with the desired dimensions and the origin at its centre, then make sure your lantern has its centre as its origin, you can get the lantern to draw it with alpha=0.5 (half as opaque as normal objects.)
Good luck with your game
#5
Posted 26 May 2012 - 01:39 PM
Yeah, this is the simplest solution. Except you're better off using the drawing functions to draw a filled white circle rather than a sprite that looks like a white circle. A sprite would increase the file size and if the sprite is not the correct size then it would need to be scaled (usually made larger)... resulting in blocky / pixelated edges rather than a curved line.
I'm trying to make a stealth-based game, so obviously lighting is a major component. Unfortunately, I'm having trouble making it work how I want. Basically, what I need is an object that makes a circle of "light" that makes every pixel within it appear lighter. It would be fantastic if this effect could get weaker as is radiated out from the center. Most importantly, there need to be a few of these per room, so it can't be too laggy. I don't need anything fancy; it can pass through walls and such. Could someone give me a bit of guidance as to how to achieve the desired effect? Thanks.
If you make a white circle as a sprite with the desired dimensions and the origin at its centre, then make sure your lantern has its centre as its origin, you can get the lantern to draw it with alpha=0.5 (half as opaque as normal objects.)
Good luck with your game.
Never used alpha drawing functions before... they might not be available in Lite (if that's what's being used).
Anyway, that will get you everything "lighter"... but it will be sort of washed out / milky / dull. Reds will look pink, blacks will look gray, etc. Ad everything will look as if it is covered by a white veil or like, you're looking through a dirty window. Still, it's the simplest solution but it may not look the best.
Edited by dannyjenn, 26 May 2012 - 01:41 PM.
#7
Posted 26 May 2012 - 02:08 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











