How do I combine 'spikes' & 'invulerability frames'?

Get help using Construct 2

Post » Tue Apr 07, 2015 7:09 pm

For my grid/tile game, I set up a 'spikes' obstacle/tile that the player can walk onto.

The player-sprite gets damaged if it moves on that square, receives a short period of 'invulnerable frames', then takes damage again, repeating until dead or it moves off the spikes. Similar to how spikes work in Binding of Isaac.

The problem is that my 'invulnerability frame' code doesn't prevent damage while the character is flashing, and the spikes only do damage once, making them 'safe' afterwards (until you walk on and off of them). How do I get it to 'repeat' damage whilst colliding/overlapping, without insta-killing the sprite?

Image
B
3
Posts: 5
Reputation: 185

Post » Tue Apr 07, 2015 7:31 pm

Every tick:
Hero->is in collision with (Spikes) & x Animation is playing (flash)-> then damage.

I used whatever example project I had laying around:
Image
Image
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446

Post » Wed Apr 08, 2015 4:01 pm

Works like a charm. Thanks!
B
3
Posts: 5
Reputation: 185

Post » Wed Apr 08, 2015 6:46 pm

@Zarhon Not a problem
Nothing goes unanswered!
B
24
S
5
G
1
Posts: 434
Reputation: 3,446


Return to How do I....?

Who is online

Users browsing this forum: unxcellent and 9 guests