How to create a lightning effect?
butterbean
Member Posts: 4,315
Toby might be good at this since your game looked professional and amazing!
How can you create the illusion of lightning in the background?
For example, I want the entire level to light up and flicker for a few seconds or the backdrop....
How can you create the illusion of lightning in the background?
For example, I want the entire level to light up and flicker for a few seconds or the backdrop....
Comments
I literally made an actor that's 512x512 to cover the whole screen. Colour is white with an alpha of .5
Rule is simply a timer that says 'after .2 seconds, destroy this actor'
Now all you need is a spawner that will spawn this actor whenever you want and you get a momentary flash on the screen.
Added to the rain in my game, it actually works well in my context - might now work well for your game, but only you can decide that
Hope that helps,
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
Thanks Quantum! That sounds like a great idea! I'll try that.
If you want it to flash, say 3 times for about a couple of seconds each, how would you set up a rule to do that?
I wanted to have the lightning in the background for one level flash every couple of seconds or so, so I guess I could just set up a timer rule for that...
The obvious way to have multiple flashes, Butterbean, is to just add timers to the spawner.
Have a timer that says spawn flash after 1 second
Then another timer that says spawn flash after 2 seconds
and a third etc etc
Hope that helps!
QS
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
I may go with Quantum's idea for now for ease of use, but if it doesn't work for my game, I will try it
I finally have about 2 games that are looking pretty good, hopefully when I've fixed some other elements, I'll be able to show one of them
How did you set up your rule again? I created an actor for the lightning and sized it to the dimensions of my scene, did you place the actor over the scene. or are you spawning it?
If so, how did you create the coordinates? Just wanted to see how you did yours, in the meantime I'm gonna try a few things
Might help to have it a little bigger than the scene, just to make sure you get it all.
I've been using it all to good effect
Dr. Sam Beckett never returned home...
Twitter: https://twitter.com/Quantum_Sheep
Web: https://quantumsheep.itch.io
I used the same coordinates too, but yes I agree, making the actor bigger than the scene to ensure coverage is great
Did you use various different timers in the spawner or one timer?