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
6
S
1
Posts: 46
Reputation: 846

Post » Tue Oct 02, 2012 12:03 am

bump in hopes of R0j0hound replying. :P
B
6
S
1
Posts: 46
Reputation: 846

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
92
S
32
G
106
Posts: 5,273
Reputation: 69,457

Post » Fri Oct 05, 2012 9:16 pm

Yea... didn't get it to work. ;(
the arrow doesn't change position at all.
B
6
S
1
Posts: 46
Reputation: 846


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 5 guests