Sword Stab

Get help using Construct 2

Post » Mon Sep 29, 2014 3:07 am

I'm trying to create a function that replicates a sword stab in this mini-project of mine. In my head, the code I have makes sense, but on execution, it is like the program isn't reading all of my code.

This is the code I have so far:

Image

What it seems to be doing is just going so fast through the code that it just skips all animation and the "action = 1". However, it does take 1 second for the sword to disappear.

You can't see it from the code snippet I provided, but when action is set to 1, the character is unable to move. It works in all other instances of the game. I threw in the "8Direction" disabled for good measure, but it doesn't do anything either.

Any help would be greatly appreciated!
B
3
Posts: 6
Reputation: 187

Post » Mon Sep 29, 2014 5:26 am

OnTrigger condition shouldn't be nested. Move the condition in Line53 into the top of Line52.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Mon Sep 29, 2014 6:44 am

You can nest the conditions in a sub but the keyboard trigger should be first.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
69
S
18
G
8
Posts: 639
Reputation: 9,549

Post » Mon Sep 29, 2014 10:47 am

Unfortunately, that didn't fix anything besides make lines 52/53 more compact.
B
3
Posts: 6
Reputation: 187

Post » Mon Sep 29, 2014 11:01 am

Need capx to see what is happening
B
255
S
39
G
15
Posts: 1,982
Reputation: 41,005

Post » Mon Sep 29, 2014 11:43 am

B
3
Posts: 6
Reputation: 187

Post » Mon Sep 29, 2014 11:58 am

The function sets action to 1 for 1 second but event 34 is setting it back to 0 immediately because flicker = 0.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,670

Post » Tue Sep 30, 2014 12:59 am

Thank you for you help, I can't believe I didn't catch that.

Thanks!! :)
B
3
Posts: 6
Reputation: 187


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 53 guests