How do I? - Timed enemy attack

Get help using Construct 2

Post » Fri May 26, 2017 12:12 pm

Hi,

I'm making a small platform game like Wonderboy, and I have run into a bit of a problem.

How can I make an enemy execute an attack, wait 1 second, and then attack again? I've tried various things, but either the
enemy just keeps attacking over and over, or stops attacking entirely.

I have now tried to tie the attack time to the animation, but it does not seem to work. (it's the red circled bit in the image)

Anyway, thanks in advance!


Image
B
3
Posts: 5
Reputation: 185

Post » Fri May 26, 2017 8:46 pm

You could set "on attack finished" to run a function that picks the UID of the attacker and then has a "wait one second" and "play the "attack" animation, making sure the animation is not set to loop. You may be able to do this without a function but that's what comes to mind.
I'd also set the attack animation to start playing when the variable is one, and not 0, and separate the on attack finished instead of having it be a child of enemy attack = 1.
B
54
S
32
G
23
Posts: 333
Reputation: 16,591

Post » Sat May 27, 2017 8:04 am

Thanks! I'll try that right away!
B
3
Posts: 5
Reputation: 185


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Yahoo [Bot] and 6 guests