Animation & For Each

  • Hi everyone,

    I have a level overview screen and want the button to reflect the level completion status of each map.

    So on start of the layout I'm calling a function to cycle through all buttons, comparing each one to an array and changing its state variable accordingly. Another loop applies the state to play the related animation.

    But it doesnt seem to change the animation reliably, can anyone tell what the problem is?

  • The code looks ok to me.

    Check that the order of Map_Button instances and elements in the array is the same.

    You can add Browser->Log to these loops to output debug information.

  • dop2000 thanks for checking, the array seems to match up.

    another oddity I'm getting is that the function seems to only work when i use it in a touch event for clicking/tapping the button. it will then update only the clicked button.

    I feel like I'm missing something obvious here ...

    'on Start of Layout' does trigger EVERY time i load a map, right?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Every time you load this layout, yes.

    It's hard to tell what could be wrong without seeing your capx file..

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