• Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!

How to make a 3 hit combo?

Lazyfella

Member
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
 

orSQUADstra

Member
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
 

Linkdeous

Member
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