Create a background that flashes between two colors

bedouin86

Member
Hi everybody,
I would like to create a short animation of the background that flashes between a color and its inverse. I would like to trigger this animation when the player takes a power up. Among the threads found in the forum I tried to change the background color with this code:

Code:
lay_id = layer_get_id ("Background");
back_id = layer_background_get_id (lay_id);
layer_background_blend (back_id, c_red);
I inserted these lines in the step event of the object that triggers the player's power-up but nothing happens.
How can i change the code to make it work?
Thanks
 

Yal

🐧 *penguin noises*
GMC Elder
I don't have photosensitive epilepsy but I still find the aLttP title flash to be painful to watch. Basically, flashing the entire screen is a Bad ThingTM and you shouldn't do it. If you do it, try to not flash between too extreme colors (in particular a color and its reverse). Black to white and red to blue are the two most notorious.
 

bedouin86

Member
I don't have photosensitive epilepsy but I still find the aLttP title flash to be painful to watch. Basically, flashing the entire screen is a Bad ThingTM and you shouldn't do it. If you do it, try to not flash between too extreme colors (in particular a color and its reverse). Black to white and red to blue are the two most notorious.
Thanks for the advice. I thought about flashing the background but if you suggest me to avoid it I will use another one. Do you have any other effect in mind that you recommend me to use?
 

TsukaYuriko

🌠
Forum Staff
Moderator
Being negatively affected by this sort of stuff myself, I can safely tell you that a full-screen invert flash is at the very least painful with a high chance of causing trailing pain for me, depending on the frequency of the flashing, exposure time and how much of my field of vision is occupied by it. This could be potentially lethal for those suffering from severe cases of photosensitive epilepsy, so please don't do this.

Common resolutions for this sort of stuff is to either have an option to turn these effects off or to use less intense effects. Things to keep in mind with the latter is to limit the aforementioned factors - contrast between one frame and the next (no inverting), frequency of changing colors (especially no inverting every frame), occupation of the viewer's field of vision (no full screen flashing) and time of exposure (no flashing for long periods of time - though keep in mind that even just a second can be long enough to cause damage). In general, gradual changes are less likely to cause harm than instant ones.

Changing the player's colors (rather than the whole background) a couple of times per second (say, 3 times back and forth) could be one option - maybe by cycling its color palette, not necessarily inverting it, as that might still cause issues for some.
 

bedouin86

Member
Well, I would say that I would reject the idea that came to my mind. I hadn't considered that there are people with this problem. What do you think if I make a little zoom in on the player when he takes the power-up? Do you think it's cool?
 

TsukaYuriko

🌠
Forum Staff
Moderator
It certainly adds emphasis to the moment - although this is more of a game design question than a programming one now.
 

kburkhart84

Firehammer Games
A little zoom in isn't a bad idea. A nice sound effect and some particle effects would also be in good taste. Check out how other similar games do it and you should get some good ideas.
 

EvanSki

King of Raccoons
you could make the player flash like Mario for the transformation, being that the player isnt huge and takes up most of the screen at the same time
 

bedouin86

Member
you could make the player flash like Mario for the transformation, being that the player isnt huge and takes up most of the screen at the same time
I followed your advice and tried to create an animation by alternating frames with the original coloring and frames with the inverted coloring. I really like the end result! Thank you for the tip )
 
Top