Changing player animation when making combo hits

Get help using Construct 2

Post » Wed Mar 12, 2014 3:37 pm

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 :(
B
6
S
1
Posts: 22
Reputation: 600

Post » Wed Mar 12, 2014 3:55 pm

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.
B
10
S
2
Posts: 135
Reputation: 1,090

Post » Wed Mar 12, 2014 4:17 pm

Alyra Games wrote: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?
B
6
S
1
Posts: 22
Reputation: 600

Post » Wed Mar 12, 2014 4:21 pm

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".
B
10
S
2
Posts: 135
Reputation: 1,090

Post » Wed Mar 12, 2014 5:07 pm

@SMDgamer27 You may want to review the manual on using timers.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,573


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, tarek2 and 8 guests