Array Disarray

Get help using Construct 2

Post » Sat Jul 18, 2015 12:31 pm

Hi there,

I recently found out about using arrays in Construct, but I have a problem I was hoping someone could help me out with.

When I create an array, the X and Y axis seem to be inverted.
For example, when I set the array height to 3, it sets the horizontal width to 3, at least according to Debug mode.
When I set a value at (0,1), I expected it to refer to the second row's first X value, but instead it refers to the first row's second X value.

Perhaps my limited coding knowledge is at fault here, but according to logic, shouldn't the X axis be horizontal and the Y axis vertical?

If someone explain this to me, I'd be grateful.

Thanks in advance
B
3
Posts: 2
Reputation: 179

Post » Sat Jul 18, 2015 12:50 pm

Copied from the tutorial Arrays for beginners

Image
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jul 18, 2015 1:26 pm

The debugger shows arrays like this:

2x2x2 array:
Code: Select all
x    y, z, y, z
x    y, z, y, z
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Sat Jul 18, 2015 1:32 pm

Image
B
66
S
24
G
7
Posts: 1,514
Reputation: 11,039

Post » Sat Jul 18, 2015 1:43 pm

Thanks guys!

It seems I was in error. I thought an array read like a graph >.<. I guess I still have a lot to learn.

Thank you all for replying so fast.
B
3
Posts: 2
Reputation: 179


Return to How do I....?

Who is online

Users browsing this forum: Baidu [Spider] and 35 guests