How do I Make my player flash a certain color?

Get help using Construct 2

Post » Fri Mar 24, 2017 1:41 am

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:
B
22
S
7
Posts: 99
Reputation: 1,582

Post » Fri Mar 24, 2017 2:38 am

if you add the effect 'set color' to your sprite you can toggle that on and off.
B
25
S
16
G
26
Posts: 125
Reputation: 16,093

Post » Fri Mar 24, 2017 3:58 am

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:
B
22
S
7
Posts: 99
Reputation: 1,582

Post » Fri Mar 24, 2017 8:21 am

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.
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,521

Post » Sat Mar 25, 2017 1:14 am

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
B
25
S
16
G
26
Posts: 125
Reputation: 16,093

Post » Sat Mar 25, 2017 2:56 am

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.
B
70
S
20
G
67
Posts: 1,311
Reputation: 42,284

Post » Sat Mar 25, 2017 4:39 am

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:
B
22
S
7
Posts: 99
Reputation: 1,582


Return to How do I....?

Who is online

Users browsing this forum: Justin64, VulcanSpawnWolf and 2 guests