Sequence of buttons?

  • Regards

    I am new to construct 2 and in the forum.

    When starting my project I realized that the occion to create sequence of buttons is not in sight would help me a lot if I could explain it in the simplest possible way.

    To have an idea what I mean I want to press 2 a key my personage dodge or run and perform combos.

    Thanks in advance.

  • add a KeyIsDown to the condition to OnKeyPressed

    example add 2 conditions to your Event:

    On Key 'N' is pressed

    'Shift' is Down

    This will only Trigger when the player hits N+Shift together

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • add a KeyIsDown to the condition to OnKeyPressed

    example add 2 conditions to your Event:

    >> On Key 'N' is pressed

    'Shift' is Down

    This will only Trigger when the player hits N+Shift together

    You will also have to create the inverse condition

    On key `Shift` is pressed

    `N`is Down

    Otherwise the order in which you press the keys would matter.

  • You use ON KEY DOWN to read a key.

    You use ON KEY RELEASED to read when a key is up.

    You need both in most games to change the sprite animations between idle and moving

    Example:

    On Left Arrow is Down: Simulate Player Moving Left, Set Animation to "RunLeft"

    On Left Arrow Released: Set Animation to "Idle"

    If you are using the platform behavior the arrow keys are already set to the basic movents but you will have to set the appropriate animation for each key.

  • > add a KeyIsDown to the condition to OnKeyPressed

    >

    > example add 2 conditions to your Event:

    >

    > >> On Key 'N' is pressed

    > 'Shift' is Down

    >

    > This will only Trigger when the player hits N+Shift together

    >

    You will also have to create the inverse condition

    >> On key `Shift` is pressed

    `N`is Down

    Otherwise the order in which you press the keys would matter.

    Many thanks to both for your help but as it would be if I wanted my personage to walk and to press 2 veces D run

  • You will also have to create the inverse condition

    >> On key `Shift` is pressed

    `N`is Down

    Otherwise the order in which you press the keys would matter.

    it depends - if you want something only to happen when both are pressed, then yes, but in my case you need to add the modifier first. It's like when you type a capitol letter on a keyboard . You hit SHIFT first, then the letter. If you hit the letter first, the letter is lowercase, hitting the SHIFT after does nothing.

  • if I wanted my personage to walk and to press 2 veces D run

    what are the walk controls?

    what is veces?

  • > if I wanted my personage to walk and to press 2 veces D run

    >

    what are the walk controls?

    what is veces?

    Sorry I meant that if I give it to walk again run.

    So D walk - DD run

  • So D walk - DD run

    That is impossible. Unless it keeps walking when D is PRESSED once. In that case you need another key to stop it. If that is what you want, then it is easy. A second PRESS will run. Release the key and it keeps running/walking. Until another keys is pressed, eventually a 3th D PRESS.

    Why ?

    Well, when you want it to walk when HOLDING D, it will immediately run because you are HOLDING D. And there is no way around that.

  • So D walk - DD run

    That is impossible. Unless it keeps walking when D is PRESSED once. In that case you need another key to stop it. If that is what you want, then it is easy. A second PRESS will run. Release the key and it keeps running/walking. Until another keys is pressed, eventually a 3th D PRESS.

    Why ?

    Well, when you want it to walk when HOLDING D, it will immediately run because you are HOLDING D. And there is no way around that.

    Thanks for the help.

    I will see how I can accomplish that.

  • try this..

    tap D once and hold to walk... double tap D and hold to run...

    let go: idle

    https://www.dropbox.com/s/apot10oh5jdx9 ... .capx?dl=0

  • try this..

    tap D once and hold to walk... double tap D and hold to run...

    let go: idle

    https://www.dropbox.com/s/apot10oh5jdx9 ... .capx?dl=0

    Thanks and sorry for the inconvenience but I can not open the file since I still do not have the payment version before acquiring it I want to make sure that it fulfills my needs

  • Thanks was just what I needed

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