Unable to toggle a sprite based Menu

  • What am I doing wrong here? <img src="smileys/smiley5.gif" border="0" align="middle" />

    <img src="https://dl.dropboxusercontent.com/u/48735785/Construct2_Issues/soundmenutoggle.png" border="0" />

  • What is happening is .. my animation is going from "Default" to "NoMusic", but on next touch it never returns back :(

    Variable is perfectly toggling to 1 and 0 though.

  • Sorry my bad.. variable doesnt toggle as well.. also I moved that Debug out to a every tick function (obviously was in wrong place).

    So once it goes to zero, I cant toggle back to 1.

    Is it probably because now user is touching "NoMusic" animation rather than Default?

  • Fixed it.

    <img src="https://dl.dropboxusercontent.com/u/48735785/Construct2_Issues/soundmenutogglefixed.png" border="0" />

    Why doesn't the earlier screenshot one work though?

    Anyone?

    If Touch

    -> var = something then do something

    -> var = somethingelse then do somethingelse

    vs

    IF touch and var = something do something

    If touched and var = somethingelse do somethingelse.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Do

    + On Touched Text_Music
    ++ System: IsMusic = 1
    ---> set animation "Default"
    ++ Else
    ++ System: IsMusic = 0
    ---> set animation "NoMusic"

    Construct reads events from top to bottom. You want to make sure that the second sub-event fires only when the first condition is false.

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