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

Get help using Construct 2

Post » Fri Jun 16, 2017 12:11 am

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:

Image

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

Thanks!
Last edited by lukezero on Thu Jun 22, 2017 9:20 am, edited 3 times in total.
B
39
S
9
G
3
Posts: 261
Reputation: 4,363

Post » Fri Jun 16, 2017 4:40 pm

Nothing yet. :(
B
39
S
9
G
3
Posts: 261
Reputation: 4,363

Post » Fri Jun 16, 2017 7:54 pm

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 :)
Thank you to Construct 2 for giving me the ability to create games without programming knowledge.
My games & gaming portal = DolyGames
If anyone wants to cooperate to help each other Win-Win please email me - I am always happy to discover new opportunities.
Cheers,
COSMOS
B
21
S
10
G
1
Posts: 85
Reputation: 2,297

Post » Fri Jun 16, 2017 11:11 pm

DolyGamesCosmos wrote: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, @DolyGamesCosmos. :D

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.

Image
B
39
S
9
G
3
Posts: 261
Reputation: 4,363

Post » Sat Jun 17, 2017 1:25 pm

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.
Thank you to Construct 2 for giving me the ability to create games without programming knowledge.
My games & gaming portal = DolyGames
If anyone wants to cooperate to help each other Win-Win please email me - I am always happy to discover new opportunities.
Cheers,
COSMOS
B
21
S
10
G
1
Posts: 85
Reputation: 2,297

Post » Sat Jun 17, 2017 2:29 pm

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:

Code: Select all
// 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;
B
39
S
16
G
6
Posts: 543
Reputation: 7,619

Post » Sat Jun 17, 2017 3:19 pm

DolyGamesCosmos wrote: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. :D
B
39
S
9
G
3
Posts: 261
Reputation: 4,363

Post » Sat Jun 17, 2017 3:22 pm

ErekT wrote: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:

Code: Select all
// 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;


Thanks so much, @ErekT! :D

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. :D

Soon I'll tell you what happened here.
B
39
S
9
G
3
Posts: 261
Reputation: 4,363

Post » Sat Jun 17, 2017 3:50 pm

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

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.

Image

Note: The problem here wasn't the difference of the animation DashAttack and RunAttack.
Last edited by lukezero on Tue Jun 20, 2017 11:06 am, edited 1 time in total.
B
39
S
9
G
3
Posts: 261
Reputation: 4,363

Post » Sat Jun 17, 2017 7:53 pm

ErekT wrote: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:

Code: Select all
// 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;


I tried here and unfortunately don't worked well. :cry:

Does anyone have a CAPX example with a "dashing attack" functional?
Last edited by lukezero on Sun Jun 18, 2017 11:58 am, edited 1 time in total.
B
39
S
9
G
3
Posts: 261
Reputation: 4,363

Next

Return to How do I....?

Who is online

Users browsing this forum: Klarner and 24 guests