Conflicts with in-game actions and UI

  • Hi you all!

    I've set an action when the player touches any area of the screen (character jumping), but I don't want to activate this action when an UI button is touched. I only want to activate the button action in that specific case ("one tap object" / "one touched object" doesn't work :S). How could do I this correctly? I thought Construct 2 respected the Z order when you touch or make click on the UI or another element of the screen which are below or above in the z order or in different layers.

    And if the characters jump when any region of the screen is touched (one tap), how do I to assign a double tap to change between the characters without conflicts with the number of taps?

    Thank you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, all objects are touched/clicked regardless of the Z-order, even if they are invisible. You can put all UI elements into a family and create your event like this:

    + Touch: On tap gesture

    + Touch: [X] Is touching Fam_UI

    -> Sprite: Simulate Platform pressing Jump

    But i dont know what you mean by changing characters.

  • Yes, all objects are touched/clicked regardless of the Z-order, even if they are invisible. You can put all UI elements into a family and create your event like this:

    + Touch: On tap gesture

    + Touch: [X] Is touching Fam_UI

    -> Sprite: Simulate Platform pressing Jump

    But i dont know what you mean by changing characters.

    Thank you, kriand! I will test it later.

    Sorry, I forgot to mention that I want to alternate between two characters of the game with a double tap on the screen. That's what I meant by "changing characters".

  • you could create your own double tap function, but that would lead to delays.

    A better solution would be to place a button on the UI to jump or switch. Or you use a swipe to change the character.

    PS: C2 has no 'Timer is running' event. Use systems compare two values: Player.Timer.CurrentTime("DoubleTap") < Player.Timer.Duration("DoubleTap")

  • you could create your own double tap function, but that would lead to delays.

    A better solution would be to place a button on the UI to jump or switch. Or you use a swipe to change the character.

    PS: C2 has no 'Timer is running' event. Use systems compare two values: Player.Timer.CurrentTime("DoubleTap") < Player.Timer.Duration("DoubleTap")

    Thank you, kriand. I will test that solution. I hope it will work in my case or gives me a clue at least.

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