[SOLVED] How do I make a good beat 'em up "dashing attack"?

0 favourites
From the Asset Store
Setup and ready for your art, animations and story. Viral Storybook App Template.
  • Hi guys! ^^

    How is the best way to make a good dash attack (two taps + attack button), typical of fighting games like Captain Commando and Streets of Rage?

    Example:

    Note: I successfully did the two taps move (run) in my game prototype. Now I cannot do an attack during the run.

    Thanks!

  • Nothing yet.

  • Hi,

    I will try.

    Isn't it simply creating 2 GLOBAL variables such as Cooldown_1 and Cooldown_2

    because I imagine you want your combo attacks to require fast pressing of a specific instance

    Then you can say on press #1 you do your attack and also set Cooldown_1 to say 0.5 seconds

    Then if Cooldown_1 = 0.5s action Wait 0.5s and set Cooldown_1 = 0

    Then on press #2 AND IF Cooldown_1 = 0.5s then do your 2nd attack and set Cooldown_2 to 0.5s

    Then if Cooldown_2 = 0.5s action Wait 0.5s and set Cooldown_2 = 0

    Then on press #3 AND IF Cooldown_2 = 0.5s then do your 3rd attack

    There you go

  • Hi,

    I will try.

    Isn't it simply creating 2 GLOBAL variables such as Cooldown_1 and Cooldown_2

    because I imagine you want your combo attacks to require fast pressing of a specific instance

    Then you can say on press #1 you do your attack and also set Cooldown_1 to say 0.5 seconds

    Then if Cooldown_1 = 0.5s action Wait 0.5s and set Cooldown_1 = 0

    Then on press #2 AND IF Cooldown_1 = 0.5s then do your 2nd attack and set Cooldown_2 to 0.5s

    Then if Cooldown_2 = 0.5s action Wait 0.5s and set Cooldown_2 = 0

    Then on press #3 AND IF Cooldown_2 = 0.5s then do your 3rd attack

    There you go

    Thanks for your collaboration,

    What I'm trying to implement is a player's character attack during a running (made with two taps on the left or right directional). When deployed, this attack would quickly decelerate the character until it stopped him. That's why I mentioned the example of Axel's Grand Upper.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    I understand. I think the cooldown system I suggested would do that.

    So if the player is clicking or tapping too slow the player will not get the special attack.

    If the player is doing fast according to the cooldown rules, then this attack happens and you can choose exactly what happens such as slowing down the player speed during the attack as you wanted.

  • Assuming you've structured your game logic something like this...

    Each fighter uses states for different actions and attack moves i.e.:

    Fighter.State == STATE_RUNNING, STATE_ATTACKING, etc...

    Fighter.AttackType == ATTACK_DASH, ATTACK_PUNCH, ATTACK_KICK, etc...

    ... you can check the state and determine an attack from that:

    // someplace that runs every tick
    if (Player.State == STATE_RUNNING)
             if (KeyDown(KEY_PUNCH))
                    Player.State = STATE_ATTACKING;
                    Player.AttackType = ATTACK_DASH;
    
    // reduce movement speed while doing the dash attack
    if (Player.State == STATE_ATTACKING && Player.AttackType == ATTACK_DASH)
             if (Player.MoveSpeed > 0)
                    Player.MoveSpeed = Player.MoveSpeed - 0.5*dt;
             else
                    Player.MoveSpeed = 0;
    [/code:x4wjc65s]
  • Hi,

    I understand. I think the cooldown system I suggested would do that.

    So if the player is clicking or tapping too slow the player will not get the special attack.

    If the player is doing fast according to the cooldown rules, then this attack happens and you can choose exactly what happens such as slowing down the player speed during the attack as you wanted.

    Sure, dude.

    It could be useful.

    Thanks one more time.

  • Assuming you've structured your game logic something like this...

    Each fighter uses states for different actions and attack moves i.e.:

    Fighter.State == STATE_RUNNING, STATE_ATTACKING, etc...

    Fighter.AttackType == ATTACK_DASH, ATTACK_PUNCH, ATTACK_KICK, etc...

    ... you can check the state and determine an attack from that:

    > // someplace that runs every tick
    if (Player.State == STATE_RUNNING)
             if (KeyDown(KEY_PUNCH))
                    Player.State = STATE_ATTACKING;
                    Player.AttackType = ATTACK_DASH;
    
    // reduce movement speed while doing the dash attack
    if (Player.State == STATE_ATTACKING && Player.AttackType == ATTACK_DASH)
             if (Player.MoveSpeed > 0)
                    Player.MoveSpeed = Player.MoveSpeed - 0.5*dt;
             else
                    Player.MoveSpeed = 0;
    [/code:2ez2pkc9]
    

    Thanks so much, ErekT!

    I used Functions and Boolean variables to set the player's mechanics and movements.

    Do you think that String variables is more effective?

    It's worth emphasizing that my game mixes characteristics of the platform and beat 'em up genres. My character has several abilities such as attack, concentrated attack, combo attack, double jump, run, slide, climb and pick up impulse on the walls.

    I confess that I had forgotten to apply the Delta Time to the platform states, but I'll test now.

    Soon I'll tell you what happened here.

  • I still haven't been able to do it. I don't know where I'm going wrong.

    The attack during the race has to slow down until it stops completely in a short time. The animation of the attack remains until the speed reaches zero, changing to the normal state of the character next.

    Note: The problem here wasn't the difference of the animation DashAttack and RunAttack.

  • Assuming you've structured your game logic something like this...

    Each fighter uses states for different actions and attack moves i.e.:

    Fighter.State == STATE_RUNNING, STATE_ATTACKING, etc...

    Fighter.AttackType == ATTACK_DASH, ATTACK_PUNCH, ATTACK_KICK, etc...

    ... you can check the state and determine an attack from that:

    > // someplace that runs every tick
    if (Player.State == STATE_RUNNING)
             if (KeyDown(KEY_PUNCH))
                    Player.State = STATE_ATTACKING;
                    Player.AttackType = ATTACK_DASH;
    
    // reduce movement speed while doing the dash attack
    if (Player.State == STATE_ATTACKING && Player.AttackType == ATTACK_DASH)
             if (Player.MoveSpeed > 0)
                    Player.MoveSpeed = Player.MoveSpeed - 0.5*dt;
             else
                    Player.MoveSpeed = 0;
    [/code:3j3a9agt]
    

    I tried here and unfortunately don't worked well.

    Does anyone have a CAPX example with a "dashing attack" functional?

  • I'm almost there, after deactivate/activate some Character moviment groups.

    I'm so rusty...

  • I did it!

    The problem was just the condition to finalize the dashing attack, that before was the end of the dash attack animation and now is the zero velocity. I still don't understand why the C2 didn't allow the operation by the end of the animation. If anyone can explain, I'm open to explanations.

    Thanks everyone! ^_^

  • Hey, glad you figured it out. Was away or I would have replied earlier. Anyways, since you're using the platform behaviour you shouldn't use dt. All behaviours use delta time automatically.

  • Hey, glad you figured it out. Was away or I would have replied earlier. Anyways, since you're using the platform behaviour you shouldn't use dt. All behaviours use delta time automatically.

    Thanks one more time, ErekT!

    Now I'm using the DT with the platform behaviour. Do you think this could lead to a problem?

  • any capx please?

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