How to make a 3 hit combo?

L

Lazyfella

Guest
Hello, I started Game maker 2 a month ago so I’m fairly new to everything so all advice is welcome.

So me and my class mates are having a hard time finding a tutorial or examples how to make combo attacks. Our vision is a top-down hack n slash game with a combo attack. The attack combo would include normal attack --> normal attack --> heavy attack. All that with left mouse button.


Any links and advice how we could accomplice this is appreciated.
Thanks
 
O

orSQUADstra

Guest
What I would do is have a cooldown variable. Let's say the cooldown between hits would be 10 frames, also an attack counting variable.
The logic would be:
  1. Have an attack counter
  2. Have a cooldown variable, in the step event take 1 from it every frame
  3. Check for attack input and check cooldown and check attack counter
    • If the cooldown is 0, set attack counter to 1
    • If the cooldown is not 0, add one to the attack counter.
    • If the attack counter is 3, do the special attack animation
 
L

Linkdeous

Guest
Add a variable that count how many hit you got, then make it so the first 2 attac kare normal then when the counter hit the 3 mark, do another attack

it would be something like :
CREATE EVENT :
hit=0;
STEP =
if !hit=3{normal attack code} else (so when the counter counted 3 attack) {heavy attack code, and important hit=0 here to reset}
 
Top