How do I Block

Get help using Construct 2

Post » Mon Apr 18, 2016 2:11 am

Hello, I'm coming up with a beat em' up type game and need to know how to block. Seems like something pretty easy but I cant seem to figure it out. I have animations and buttons down I just cant get it to not affect the characters health when the enemy hits you. Thank you, hoping for a fast reply :)
B
5
S
1
Posts: 3
Reputation: 331

Post » Mon Apr 18, 2016 7:56 pm

Please help anyone
B
5
S
1
Posts: 3
Reputation: 331

Post » Mon Apr 18, 2016 8:10 pm

So, you have the animations. And you have choosen a key. I suppose you play the animation when the key is pressed.
I suppose you have some variable that gets set when the key is pressed, so when a 'block' happens


Do you check that variable when the thing hits the player before drawing health.
For how much time is that variable set to block ? One tick ? As long as the animation ? As long as the key pressed ?
When and how is that variable resetted ?
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Mon Apr 18, 2016 9:19 pm

Add an exception to the damage collision check you do when testing to see if the enemy has hit you? Something like:

- Enemy collides with player, Player animation "block" is NOT playing = damage the player
Image



Coming soon on Steam!
B
16
S
9
G
3
Posts: 209
Reputation: 3,476

Post » Wed Apr 20, 2016 12:38 am

Thank you mikehive! Huge help :)
B
5
S
1
Posts: 3
Reputation: 331


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], newt and 18 guests