Posted By
|
Message
|
Fish20
Registered 03/12/2007
Points 263
|
15th May, 2011 at 16:58:08 -
I need making my character attack in a combo (Slash horizantaly, then vertical, then kick, etc.) I tried using flags, but whenever i press fire button 2, the character does two slashes in row, even when i only pressed it once.
+Pressed fire 2
+Restrict actions for 00-"25
+Detector is overlapping a backdrop.
-Change animation to slash 1
-Set Flag 0 to on.
+Flag 0 is on
+Animation 12 is playing
+Pressed fire 2
+Detector is overlapping a backdrop.
-Set Flag 1 on.
+Animation 12 is over
+Flag 1 is on
-Change animation to animation 13.
+Animation 13 is over
-Set flag 1 off.
What is the best way to do this?
All your base are in another castle, take this.
|
tetsuya_shino
Registered 12/08/2004
Points 491
|
15th May, 2011 at 18:13:58 -
Greetings. The following is how I go about making combos in my game. It doesn't uses flags or a timer. Rather, it is based on the current animation playing and the frame numbers of that animation.
+Only one action when even loops
+Pressed [s]
+Current animation is Stopped
+Current direction is [>]
-Change direction to [>]
-Change animation to Slash H
The above is for your first hit. Let's say your slash H animation is ten frames. And let's say you deal damage in the 2nd, 3rd, and 4th frames only.
+Only one action when even loops
+Current animation is Slash H
+Current level of animation = 10
-Change direction to [>]
-Change animation to Stopped
The above makes the hero go back to his stopped animation if he didn't press the [s] a 2nd time. Why 10 frames? You'll see.
+Only one action when even loops
+Pressed [s]
+Current animation is Slash H
+Current direction is [>]
+Current level of animation is greater then 7
+Current level of animation is less then 10
-Change direction to [>]
-Change animation to Slash V
Get it? If the player presses [s] again while the first slash is playing, but before the animation ends, you can jump to another attack animation. Depending on the speed of your attack animations, and number of frames, you can make chaining the combos very easy for the player or very hard. It's all in the timing.
Use the same logic to chain the Slash V to the Kick. But don't forget to have the hero return to the stopped animation if the player was either too slow to press the button, or didn't press it all.
I hope that helps. Good luck.
n/a
|
Fish20
Registered 03/12/2007
Points 263
|
15th May, 2011 at 19:40:40 -
Thank you! It worked.
All your base are in another castle, take this.
|
tetsuya_shino
Registered 12/08/2004
Points 491
|
16th May, 2011 at 01:28:47 -
Glad I could help.
Now that you got that down, you could take it to the next level. You can add a HP value check to the last hit, for example, that could be triggered if the player's health is too low. Let's say the hero can normally do a 3 hits. But if his HP is too low he can chain a 4th, more powerful attack.
That is just one thing you can do. You could also add a Exp value check to that as well.. meaning he has to have enough Exp -and- low HP to do the 4th hit.
Just some ideas. Good luck on your game.
n/a
|
|
|