Inverted For

  • Greetings there.

    I am trying to make a mouse scrolling based weapon changing between some "activated" weapons in an array.

    I've managed to get it working on the down scroll that actually increments the index and i can to some stuff and select the appropriate weapon.

    But for the up scrolling, i need to go upwards, i need a for loop with a negative increment, and it seems that it doesn't work with the default for.

    Can someone confirm that? Or give me a workaround or something :S

    Thanks in advance <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You'll have to use a local variable for that, or do the inversion yourself everytime you use the loopindex. If your "step" is -1, I'd use the second method.

    For x = 0 to upperBound

    ---Set variable to upperBound - loopindex

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