[RESOLVED] Sub-event logic??

0 favourites
  • 7 posts
From the Asset Store
100 items casual and logic games. All icons are of a high quality.
  • Hi guys, I'm having trouble to understand the Sub-events. I read the manual. Obviously following structure should work... but unfortunately it didn't. On doubleclick over each of the boxes, it should change its color and display the click status. Could someone take a look and say what is wrong??

    <img src="http://www.colarion.com/construct2-test/DoubleclickProblem.JPG" border="0">

    C2 file also here:

    Doubleclick Problem

    Thanks

  • Because it contradicts itself

    If you clicked Sprite with 0 it sets frame 1 but also it goes back to 0 instant

    there a way to fix it to add wait 0.1 second to each subevent

    I don't think i can help to text, it seems bad practice

  • XManBG

    Add "else" at condition "click != 0".

  • Thanks for the "Else" tipp. Although according to the Manual Sub-Events: <font color=blue>https://www.scirra.com/manual/128/sub-events</font> should work my way too, therewith the color successfully changed on doubleclick...

    But the text doesn't :( .

    My understanding for the sub-event was, that it uses the same starting event, i.e. Nr.2 on the picture, and executes the sub-events all at once... or maybe in a row?! Anyway, the Text sub-event Nr.5 should work for both cases.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Try adding for each text - condition before your variable comparison.

  • You need some extra brackets in there:

    "Clicked?: "&[b]<font color=red>(</font>[/b](Sprite.Clicked=0)?"NO":"YES"[b]<font color=red>)</font>[/b]
    
  • SOLVED: Now that works. Obviously the missing parentheses were the problem. <img src="smileys/smiley4.gif" border="0" align="middle" /> Thanks a lot!!

    <img src="http://www.colarion.com/construct2-test/DoubleclickSolution.JPG" border="0" />

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