single tap to double jump and double tap to do single jump

  • Hello Everyone,

    I am trying to implement a logic to perform double jump if the user single tap and to do single jump if the user double tap.

    for this i have written this code (link below) but this is not working.

    Can anyone provide some input to do this.

    Regards

    Dev

    code - ibb.co/dKs8gS

    layout- ibb.co/gdAavn

  • Try this:

    1) Disable the double jump on platform behaviour;

    2) On tap (Single Tap)

    • Set jump strenght: 500
    • Simulate Platform Jump

    3) On Double tap

    • Set jump strenght: 250
    • Simulate Platform Jump
  • Try this:

    1) Disable the double jump on platform behaviour;

    2) On tap (Single Tap)

    - Set jump strenght: 500

    - Simulate Platform Jump

    3) On Double tap

    - Set jump strenght: 250

    - Simulate Platform Jump

    Sir i tried this but this is not working as well. I disable the double jump and have set the jump strength. now the sprite is not jumping at all.

    i am attaching an image - ibb.co/e1B7an

  • > Try this:

    >

    > 1) Disable the double jump on platform behaviour;

    > 2) On tap (Single Tap)

    > - Set jump strenght: 500

    > - Simulate Platform Jump

    > 3) On Double tap

    > - Set jump strenght: 250

    > - Simulate Platform Jump

    >

    Sir i tried this but this is not working as well. I disable the double jump and have set the jump strength. now the sprite is not jumping at all.

    i am attaching an image - https://ibb.co/e1B7an

    Try to swap the action: Set Vector Y and use Simulate Control: Jump

  • >

    > > Try this:

    > >

    > > 1) Disable the double jump on platform behaviour;

    > > 2) On tap (Single Tap)

    > > - Set jump strenght: 500

    > > - Simulate Platform Jump

    > > 3) On Double tap

    > > - Set jump strenght: 250

    > > - Simulate Platform Jump

    > >

    >

    > Sir i tried this but this is not working as well. I disable the double jump and have set the jump strength. now the sprite is not jumping at all.

    > i am attaching an image - ibb.co/e1B7an

    >

    Try to swap the action: Set Vector Y and use Simulate Control: Jump

    Sir not working still <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad" />. the sprite is jumping to same height in single tap and also in double tap

  • The problem is - when you do double-tap, the system first registers a single tap! So your character always start with high jump. And once it's in the air, the only way to make the jump lower is to adjust VectorY.

    Another issue is that people do double-tap with a different speed. So the character jump height will depend on how quickly double-tap was performed.

    I suggest you reconsider your control system.

  • The problem is - when you do double-tap, the system first registers a single tap! So your character always start with high jump. And once it's in the air, the only way to make the jump lower is to adjust VectorY.

    Another issue is that people do double-tap with a different speed. So the character jump height will depend on how quickly double-tap was performed.

    I suggest you reconsider your control system.

    Thanks Sir. I am also thinking about this. i think this is not possible since if i double tap the system will first register a single tap and perform that action.

    Regards

  • Yeah, I thought that it would not work because of the instant action of on tap.

    I have a project where I used to use On Tap and Double Tap but I changed to "sliding", so now, instead of Tap, the player needs to slide the screen so if he slides just a bit it will have a small jump strenght, if he slides more, it will have more jump strenght.

    Sending the img of my project so you can try if you like it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks Sir. I am also thinking about this. i think this is not possible since if i double tap the system will first register a single tap and perform that action.

    Regards

    It's possible, but may not work too well.

    You can start an "average" strength jump on single tap, then wait for about 0.5 seconds and if there was no double-tap registered, make the jump higher by increasing VectorY (for example Set VectorY to Self.Platform.VectorY*1.5)

    If double-tap event was registered, decrease VectorY (Set VectorY to Self.Platform.VectorY/1.5)

  • Yeah, I thought that it would not work because of the instant action of on tap.

    I have a project where I used to use On Tap and Double Tap but I changed to "sliding", so now, instead of Tap, the player needs to slide the screen so if he slides just a bit it will have a small jump strenght, if he slides more, it will have more jump strenght.

    Sending the img of my project so you can try if you like it.

    Thanks Klabundee. I will try to use this mechanics.

  • Isn't this completely counter intuitive. Everybody would expect a single tap to result in a normal jump and double tap to result in a double jump.

    Unless this is some reverse gameplay thing, to make things tricky for players, it really makes no sense to have it this way.

    If you really need to have it, then start a jump on single tap, then if no second tap within a second ( or whatever time ) just jump again from current position for a second jump. If player taps again nothing happens ( so gravity brings him down after the initial jump ) and you reset tap count to 0.

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