How do I get the coordinates of a value in an array?

Get help using Construct 2

Post » Sun Apr 06, 2014 6:34 am

This is more a question of syntax than of anything else.
Basically, all I'm trying to do is pull a value out of a set x-y position on a 2D array and set a variable to it (situation being that I have an array to store values of stuff in a shop for something and I want to get the price based off the current selection in order to show if you have enough money to buy it). How exactly would I tell it which slot in the array I want to access? (I know in C it's arrayname[x coordinate][y coordinate] or something along those lines- how would I do that in Construct 2?)
Thanks!
B
9
S
3
Posts: 22
Reputation: 755

Post » Sun Apr 06, 2014 1:24 pm

You can access specific Array slots using "Array.At(x,y,z)" and set specific Array slots using Array->Set at X,Y,Z or whatever.
B
33
S
7
G
8
Posts: 312
Reputation: 8,528

Post » Sun Apr 06, 2014 9:22 pm

Manley23 wrote:You can access specific Array slots using "Array.At(x,y,z)" and set specific Array slots using Array->Set at X,Y,Z or whatever.

Thanks! It's working now :D
B
9
S
3
Posts: 22
Reputation: 755


Return to How do I....?

Who is online

Users browsing this forum: sublimate and 2 guests