How do I freeze health while player is flashing?

Get help using Construct 2

Post » Tue Dec 12, 2017 6:26 am

I know this topic has to exist but I can't find anything through numerous searches...

I'm attempting a Zelda-style game, but noticed when my player runs into an enemy, the enemy hits multiple times and takes huge chunks out of the player health. I'm wondering if there's a way to tell C2 when the player is flashing (indicating they've been hit) to freeze the health variable until the flash has finished? That kind of half-second immunity you get after taking damage in virtually any game.
B
8
S
1
Posts: 10
Reputation: 407

Post » Tue Dec 12, 2017 7:30 am

There are many ways to do this.
Since you are using Flash, simply add condition "Is NOT flashing" to the event where you subtract health.
(add "Is flashing", then right-click and invert)

Code: Select all
Enemy->Is overlapping Player    Player subtract 10 from Health
Player->Is NOT flashing
Image

Did I help to fix a problem in your game? You can buy me a cup of coffee :) If you'd like to hire me, please see this post
B
17
S
9
G
100
Posts: 1,426
Reputation: 53,919

Post » Wed Dec 13, 2017 1:36 am

Thank you!
B
8
S
1
Posts: 10
Reputation: 407


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 13 guests