How do I? - Timed enemy attack

0 favourites
  • 3 posts
From the Asset Store
Moles Attack game assets for 2D whack a mole smash and hit action fun game.
  • 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!

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks! I'll try that right away!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)