A simple animation toggle

0 favourites
  • 5 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • I have this sprite which has 2 animations - Default and UnMusic

    I have a global variable that says "IsMusic" set to 1 by default

    This is what I'm doing

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

    The "IsMusic" is becoming 0 when touched the first time, but the animation doesnt change.

    Anyone knows the reason?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The first event toggles it to 0, activating the second event as well. Put both 'isMusic' checks under the same 'on touch' events, and use 'else' on the second one.

  • Put both 'isMusic' checks under the same 'on touch'

    That seems to do the same thing, unless I move the zero check first I think :) (because of top down order of reading it)

    So better to use an "else"

    Thank you :D

  • > Put both 'isMusic' checks under the same 'on touch'

    That seems to do the same thing, unless I move the zero check first I think :) (because of top down order of reading it)

    So better to use an "else"

    Thank you :D

    onTouch

    .. if isMusic = 0

    ... Do stuff

    ..else

    ... Do other stuff

    Should work :)

  • nTouch

    .. if isMusic = 0

    ... Do stuff

    ..else

    ... Do other stuff

    yeah thats what I did after your first reply :) .. was just saying that if A

    do stuff

    if B

    do stuff

    doesnt work. :)

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