Page 1 of 1

How do I Make my player flash a certain color?

PostPosted: Fri Mar 24, 2017 1:41 am
by Aquanex2
Is there a way to make the player flash white or red for taking damage as an example? I know there's already a flash behaviour, but I would really like to do it this way instead. Any help or a link to a tutorial (as I could not find one) would be nice! :mrgreen: :mrgreen: :mrgreen:

Re: How do I Make my player flash a certain color?

PostPosted: Fri Mar 24, 2017 2:38 am
by celstrider
if you add the effect 'set color' to your sprite you can toggle that on and off.

Re: How do I Make my player flash a certain color?

PostPosted: Fri Mar 24, 2017 3:58 am
by Aquanex2
celstrider wrote:if you add the effect 'set color' to your sprite you can toggle that on and off.

Not exactly what I was looking for, but it's really close and I'll probably end up using it instead! :D What I initially wanted and should have said was my player to "fade" or "glow" a certain color, not to flash...

I've never used effects before, because I'm not really sure how most of them work, but this works perfectly! :mrgreen:

Re: How do I Make my player flash a certain color?

PostPosted: Fri Mar 24, 2017 8:21 am
by lamar
Lots of effects already built into C2 and you can change the parameters of most effects to suit your needs. You can also find special effects in the effects section of the forum.

Re: How do I Make my player flash a certain color?

PostPosted: Sat Mar 25, 2017 1:14 am
by celstrider
you can add a bluring effect to simulate a glow, and you could fade in and fade out a red color by using something like this:

while variable =1
every tick
set red to red +1'

while variable =0
every tick
set red to red -1

when red greater 50
set variable to 0

when red is less than 0
set variable to 1

Re: How do I Make my player flash a certain color?

PostPosted: Sat Mar 25, 2017 2:56 am
by gamecorpstudio
try using adjusthsl effect but then your game will require webgl support for it to work. i dont recommend it on iphones. but you can also get same results with multiple frames.

Re: How do I Make my player flash a certain color?

PostPosted: Sat Mar 25, 2017 4:39 am
by Aquanex2
celstrider wrote:you can add a bluring effect to simulate a glow, and you could fade in and fade out a red color by using something like this:

while variable =1
every tick
set red to red +1'

while variable =0
every tick
set red to red -1

when red greater 50
set variable to 0

when red is less than 0
set variable to 1

That's a great idea, thanks!!! :mrgreen: