Stepping through an array.

Get help using Construct 2

Post » Mon Oct 01, 2012 10:26 pm

I would like to be able to step through an array. Value by value. When I reach the end of the array I want to go back to the oldest.

In my case I want Q to step back through the array and W to step forward in the array.



Haven't found any elegant solution to this. You can ignore the Pop back on X axis event in the screenshot. :)
B
4
Posts: 46
Reputation: 617

Post » Tue Oct 02, 2012 12:03 am

bump in hopes of R0j0hound replying. :P
B
4
Posts: 46
Reputation: 617

Post » Tue Oct 02, 2012 1:24 am

It looks like you have it most of the way there. A few points:

* You can probably remove the "pick all" condition as they are all picked by default.

* I'm guessing GlobalStoneAmmout is the same as the Array width so your second event should look like this: "StoneSelection >= GlobalStoneAmmout" since arrays always go from 0 to array.width-1.

*Then just do set StoneSelection to array.width-1 when it's less than 0.
B
79
S
24
G
54
Posts: 4,751
Reputation: 40,765

Post » Fri Oct 05, 2012 9:16 pm

Yea... didn't get it to work. ;(
the arrow doesn't change position at all.
B
4
Posts: 46
Reputation: 617


Return to How do I....?

Who is online

Users browsing this forum: DemantDigitalArt, farfetchd83, mjj1990 and 6 guests