Touch function and messages sequence

0 favourites
  • 5 posts
From the Asset Store
Surena Touch
$2.50 USD
A wrap from official Touch plugin to export touch/mouse input to other plugins.
  • Hi,

    (sorry it's my second post today but I have 2 distincts problems I can't resolve...)

    I'm trying to make appear a sequence of sentences with the Touch function.

    For example : Sentence_1 - The player has to click on "Next" sprite to make Sentence_1 to disappear and to make appear the sentence_2. etc.

    But when I do that, whatever I use "On touched", "Is Touching", "On Tap object" (I tested all of them!!) it doesn't works correctly and ALL my sentences are disappear.

    Here precisely what I did in my events (my sentences are in Text object) :

    (By default, all my Texts are invisible except the first)

    EVENT 1 :

    Text Sentence_1 is visible ........................................ Text Sentence_1 - Destroy

    Touch - On touched "NEXT"...................................... Text Sentence_2 Set visible

    System - Trigger Once

    EVENT 2 :

    Text Sentence_2 is visible ........................................ Text Sentence_2 - Destroy

    Touch - On touched "NEXT"...................................... Text Sentence_3 Set visible

    System - Trigger Once

    EVENT 3 :

    Text Sentence_3 is visible ........................................ Text Sentence_3 - Destroy

    Touch - On touched "NEXT"...................................... Text Sentence_4 Set visible

    System - Trigger Once

    etc, etc, etc....

    But when I test it, if I touch the "Next" sprite, all my sentences are destroying at the same time. What I'm doing wrong ?

    Or is it a bug with the Touch function when we test it on construct 2 via computer ? It's an app for Mobile so I don't have the choice to use "Touch" here...

    thx for your help

  • Have On touched first, then sub-event S1 is visible Else S2 is visble Else... That is the bester way to deal with this.

  • Ok I will try this, thank you very much

  • On Touched Object is a trigger who works only once, so, you can't use On Touched Object and Once While True, they are the same with the add of the touch condition.

    You can solve your problem by inverting your condition events, check the last by first and so on or use the sample I made, but you'll need to change your logic.

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Blackhornet, your solution worked to me, thx again

    TelleS0808, thank you to made a capx specially for me, I have an older version than you so for now I can't open it, but I'll make an update today to be able to open it, and see finally which solution is the best.

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