Array.IndexOf - is there a way to get the Y value?

Get help using Construct 2

Post » Sat Oct 08, 2016 8:23 am

Hi, I'm still trying to wrap my head around arrays, I have a two dimensional array set up which I'm populating with some random numbers and strings. What I want to do is search the array for a word, and then be able to pinpoint both its x,y position to further manipulate the array data around it. The problem is, I can only seem to get it to return the x value with Array.IndexOf and Array.LastIndexOf - there seems to be no way to return the y value as well.
B
67
S
25
G
4
Posts: 212
Reputation: 7,084

Post » Sat Oct 08, 2016 12:35 pm

If you do for each XY value, current value = "monkey", it will look for "monkey". Once found, the array.curY is the Y position of "monkey".
B
47
S
18
G
84
Posts: 2,271
Reputation: 49,796

Post » Sat Oct 08, 2016 10:34 pm

Thank you, that helped a lot! :)
B
67
S
25
G
4
Posts: 212
Reputation: 7,084


Return to How do I....?

Who is online

Users browsing this forum: psicodelicow3 and 5 guests