Skip to main content
gamedev.net
🔒 Locked

Simple Lightning Flash

Started by Jinroh Mar 19, 2009 at 3:14 PM 2 replies 750+ views
Original Post
Jinroh
Jinroh
Hi all this has been something I've just never been able to get right. A simple lightning flash. Say you have a screen. The bottom half is solid green, your ground. The top half is solid black (your night sky) and you want to make the black part flash like lightning. I've tried this a couple times. My idea was basically two random numbers: One for how many flashes. One for how long until we start the lightning this current time. Then a third random number that is random between flashes. Does this sound reasonable or am I making it too simple/complicated? It's just something that's bugged me. Anyway, to cite examples play Hugo's House of Horrors or Catacombs: Abyss (the better example) to see what I'm talking about. Thanks, Jinroh
The wolf and his mate howl, taking solace in the silver moon. Pressing ever foreward to see what the future holds.
jpventoso
jpventoso
Just thinking, could you add a fourth pseudo-random number for intensity? Your lightnings will look more realistic if the intensity varies a certain amount between every single flash...
nb
nb
maybe also a value to store how much the sky is glowing and then fade that out to black after each strike. this would just be a copy of the lightning strike 'intensity', and only set if the current strike intensity is greater than the current sky glow intensity. this way you have two separate things happening... your sky constantly fading itself to black no matter what, and a random generator that creates the lightning flashes which the sky either takes the value from or ignores if it is already brighter than the lightning strike that was just generated.
Jinroh
Jinroh
Hmm...very good I'll try and put these into practice and get back to you. ^_^

I appreciate the feedback.
The wolf and his mate howl, taking solace in the silver moon. Pressing ever foreward to see what the future holds.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.