0 Favourites

Changing player animation when making combo hits

  • The project I'm working on is a sidescroller. You basically have to slash through enemies with your sword.

    I asigned the key for swinging the sword to K. What I want is for the animation to change the secind time I press K. Example:

    The player presses the K key and the character sprite swings his sword. Imediatly after the sword swing is done, the player hits the K key again, and this time the character sprite does a whole new animation of swinging this sword.

    Been trying to do this myself, but I just can't seem to make it work. Help

  • You need two animations. The normal swing and the combo swing.

    Then, if the player hits K and the sword animation is finished you set a boolean, called somthing like "combo", to true and call a timer event. This timer event represents the time the player has to hit K again to perform a combo attack. If the timer reaches 0 reset the "combo" boolean to 0 (he failed).

    If the user hits K and the "combo" boolean is true, then change the animation and do the combo attack.

  • You need two animations. The normal swing and the combo swing.

    Then, if the player hits K and the sword animation is finished you set a boolean, called somthing like "combo", to true and call a timer event. This timer event represents the time the player has to hit K again to perform a combo attack. If the timer reaches 0 reset the "combo" boolean to 0 (he failed).

    If the user hits K and the "combo" boolean is true, then change the animation and do the combo attack.

    Sorry, I've never used any time triggered events and got a little lost. How do I set the timer event?

  • You have to give one of your objects the timer behaviour. But you can also use a variable instead.

    After you gave it the timer event:

    On the K hit condition choose your timer object and set the timer.

    Then make a new condition "on timer".

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • SMDgamer27 You may want to review the manual on using timers.

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