Flash behavior & Inmmunity

Get help using Construct 2

Post » Thu Oct 18, 2012 7:53 am

Hello guys, here again with another question.

In the game I am making, I have that whenever the Player is hit by an enemy it flashes during 1 second. The issue with this is that it happens easily with the flash behavior, but during the flash action, the Player can be hit again!

Any ideas of how to implement somehow an inmmunity during the flash duration (in this case 1second)?

I have the idea of using the event "Player | Is flashing" but I have no idea of how to implement this inmmunity....

Thanks in advance!
B
9
S
1
Posts: 19
Reputation: 700

Post » Thu Oct 18, 2012 9:55 am

okay, here we go.

enemy hit player >> Player is " flash" in 1 second and can't be hit again during this time.

Just write a code like this:

Enemy overlapping Player
Player is "flashing" (right click on "player is flashing" and click (invert))

Invert mean the event only active when player isn't flashing :D, it'll solve your problem .

Flash_hit

I'm added some "Health number" for player, so you can see, when flashing player never lose his health, but when flash ended, he will be hit again.farsmile902012-10-18 10:04:39
B
50
S
12
G
7
Posts: 259
Reputation: 10,371

Post » Fri Oct 19, 2012 1:38 am

Dude, I am starting to think you are stalking me, thanks a lot for the help you have given me! :D

Just a question, whats the difference with overlapping and collision? In a way, you are using it in your example for the same, as I see it.Ruvier2012-10-19 01:44:14
B
9
S
1
Posts: 19
Reputation: 700

Post » Fri Oct 19, 2012 7:30 am

:)) No i'm not stalking you, if you in love with C2 and Community in here, i bet you will do the same, bro.

And about the difference, you can find it's here :

http://www.scirra.com/forum/better-to-use-collision-or-overlap_topic49659.html
farsmile902012-10-19 07:31:05
B
50
S
12
G
7
Posts: 259
Reputation: 10,371

Post » Sat Oct 20, 2012 1:13 am

I see....thanks for the link! It clear some doubts.
B
9
S
1
Posts: 19
Reputation: 700


Return to How do I....?

Who is online

Users browsing this forum: WhosWho and 19 guests