Double tap system?

This forum is currently in read-only mode.
  • Hello,there,people from the Scirra Fellowship xD.

    I'm having troubles trying to set up a "double tap" system for my game.

    I founded some references and old posts of people who resolved this before,but they're old and

    All hte download links are broken/deleted...Can someone please give me a little hint on how to set up this?

    Thanks in advance!_(-_-)7

  • I admit, I'm not familiar with the term "double tap", so I had a look at wikipedia, which stated that it is something like a rapid double shot.

    If it is meant to trigger once but shoot twice within a certain timespan, than you can do it this way:

    var 'double' - 0 for single shot, 1 for double

    var 'time' - timespan between first and second shot in milliseconds

    var 'timestamp' - (make this a private var to the bullet object, initially 0) the moment when the first shot is activated

    + some condition that activates double shot

    -> 'double' = 1

    + key for shooting pressed

    -> spawn bullet

    ++ if 'double' == 1

    --> bullet('timestamp') = timer

    + bullet('timestamp') > 0

    ++ bullet('timestamp') <= timer - 'time'

    --> spawn bullet

    # not from this bullet but from the player!

    If this isn't what you're looking for, please ignore or explain in detail

  • My request was for a "double click" style ,like in a fighting game,when you "duoble tap" the direction stick to run,or make a fast jump.

  • Kinda the same concept.

    +on "tap" pressed

    (sub event) +value "tap timer" is lower or equal to 0

    -set value "tap timer" to 30

    (sub event) +value "tap timer" is greater than 0

    -add your double tap actions here

    +value "tap timer" is greater than 0

    -subtract 60*timedelta from value "tap timer"

    ...or something like that.

  • Kinda the same concept.

    +on "tap" pressed

    (sub event) +value "tap timer" is lower or equal to 0

    -set value "tap timer" to 30

    (sub event) +value "tap timer" is greater than 0

    -add your double tap actions here

    +value "tap timer" is greater than 0

    -subtract 60*timedelta from value "tap timer"

    ...or something like that.

    Thank you very much,Tokinsom!It worked perfectly !

  • I admit, I'm not familiar with the term "double tap", so I had a look at wikipedia, which stated that it is something like a rapid double shot.

    I'm pretty sure what you got was about the hollywood hitman-lingo, where double-tap means to shoot the target in the head twice, "just to be sure". =P

    I'm pretty sure what he was thinking about was where instead of having a run button, you simply press left or right twice quickly and keep the button pressed after the second to make and keep the character running. ^^

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Kinda the same concept.

    +on "tap" pressed

    (sub event) +value "tap timer" is lower or equal to 0

    -set value "tap timer" to 30

    (sub event) +value "tap timer" is greater than 0

    -add your double tap actions here

    +value "tap timer" is greater than 0

    -subtract 60*timedelta from value "tap timer"

    ...or something like that.

    I have the same problem, but my question is, is "tap" the key being tapped?

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