How do I make a sprite flash a certain color?

Get help using Construct 2

Post » Mon Jul 09, 2012 3:53 am

I'm trying to make an enemy flash bright red when it is shot at by the player, but I'm not sure how to do this.

Can anyone tell me how?
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Mon Jul 09, 2012 3:59 am

ok there is a simple way to do this is making animation called : damaged
and this damaged will have the red frames with normal frames
red,normal,red,normal,red,normal .. so the red frame and normal will be created in any program like photoshop and so on...

also put these condtion on hitting event :
player is NOT playing "damaged" so while he is damaged he can't get hit
B
45
S
15
G
6
Posts: 795
Reputation: 11,935

Post » Mon Jul 09, 2012 4:01 am

Is there a way I can do this without recoloring sprites in photoshop?
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Mon Jul 09, 2012 5:06 am

The flash behavior could have a color option.
B
38
S
8
G
3
Posts: 438
Reputation: 6,869

Post » Mon Jul 09, 2012 5:17 am

I don't see anything in the flash behavior. Did I miss something?
B
13
S
4
Posts: 117
Reputation: 2,242

Post » Mon Jul 09, 2012 5:20 am

[QUOTE=Zero6] Is there a way I can do this without recoloring sprites in photoshop?[/QUOTE]


No, you can't until they release shaders
B
96
S
25
G
20
Posts: 3,052
Reputation: 22,638

Post » Mon Jul 09, 2012 6:23 am

Actually, there is a way to do this without adding a complete copy of the player sprite.

Add a new sprite to your game. Make it a red box large enough to cover your entire player sprite no matter what animation is playing and set its effect to "Destination Over". Add events to center it on the player sprite and make it follow it. Also make sure to have it be in front of the player sprite.

Now, when you want to make the player sprite red do this.

+ Whatever conditions you need to make it red
- Player Sprite: Set effect: Destination Out
- Red Box: Set Visible
+ Else
- Player Sprite: Set effect: None
- Red Box: Set InvisibleinkBot2012-07-09 07:51:12
B
73
S
20
G
10
Posts: 524
Reputation: 9,896


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests