how do i press double A to double punch

0 favourites
  • 13 posts
From the Asset Store
This sound pack features 117 game sounds : Axe,Punch Swing & Hit & Damage. This is a perfect collection for your game.
  • im going to make A for single punch and if player rapidly press A it will spawn special punch!

  • You could try making some sort of a counter which will count how many time specific button was pressed and then do something.

  • i don't found any solution on this.

    can you elaborate ?

  • Have a global variable for Timer and ButtonCount

    Every Tick at dt to Timer. This will create a timer

    Every time A is pressed, add 1 to ButtonCount.

    If ButtonCount >= 5 and Timer <= 5 then

    Spawn special attack

    Of course the number 5 can be changed. With this example, A has to be hit 5 times before the timer reaches 5 seconds.

    You will need to make the timer reset each time the button is pressed as well so you know if they hit A in the allotted time.   Play around with it. I'm sure you will get it :).

  • You'll need 'Combo' Variable

    Default is 0

    Punch Event 1

    -Check if Combo is '0'

    -If yes, it should set combo as '1'

    -Execute Punch

    -Wait 1 Second

    -Set combo back to '0'

    Punch Event 2

    -Check if combo is '1'

    -If yes, it should set combo to '2'

    -Execute Punch 2

    -Wait 1 Second

    -Set combo back to '0'

    This already deals with cooldown of attack 1, and combo 2.

    <img src="smileys/smiley1.gif" border="0" align="middle" />

  • i need capx to see an example =(..

    sorry am noob

  • hello ? someone ?

  • ok i tried arcadED i succeed, but what is DT ?

  • and how do i ..

    for example one combo MANA used for 50 2nd combo 50

    so the next combo the player can't perform the COMBO because of mana lacked.

    how should i do that ?

    and once again thx to arcadED

  • Delta Time, it's a feature inside the engine. Delta time means a space of time between 2 point in a time line.

    You can reproduce your request following this procedure:

    • Create a number variable inside your instance (instance is the sprite object) and call it as "combo";

    |- On keyboard "A" is pressed (for example);

    |- If "combo" = 0;

    -- Play the animation "punching1"

    -- Add 1 to "combo";

    • On animation "punching1" is finished:

    -- Set "combo" to 0;

    |- If "combo" = 1;

    |- On keyboard "A" is pressed;

    -- Play the animation "punching2"

    -- Add 1 to "combo";

    You can loop it, make different animations for each stage of the combo, or just repeat the combo animations, this way:

    |- If "combo" > 0;

    |- On keyboard "A" is pressed;

    #when you have one animation for each combo sequence;

    -- Play the animation "punching" & player.variable.combo;

    #when you have two animation at all;

    -- Play the animation "punching" & random(1,2);

    -- Add 1 to "combo";

    Don't miss to reset the "combo" variable to 0 when the "A" is not pressed by 1 or 2 seconds.

    That's it. ^^

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you can use the neat search function on the upper right corner of the page

    here?s a link with more details about dt ;]

  • Telle = its not working!!

    sheepy = thx! i appreciate that.. i did the tutorial

  • Rory, ive been trying to make urs but i fail

    this is my example .capx


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