Arrays iterate in wrong direction? (with example file)

Discussion and feedback on Construct 2

Post » Tue Jan 27, 2015 10:05 pm

Can someone please look at my example project file and explain to me, why the player sprite doesn't show up in the most up place of the terrain. (the bottom code in the event sheet).
I thought an array iterates from left to right (x or width) and at end of x goes down (y or hight) to the next line.

Like array(0,0) -> (1,0) -> (2,0) ...

and NOT

array(0,0) -> (0,1) -> (0,2) ...
You do not have the required permissions to view the files attached to this post.
B
11
S
2
Posts: 213
Reputation: 1,266

Post » Tue Jan 27, 2015 10:13 pm

No it runs through the columns from top to bottom and then jumps to the next one (right), so to speak. You can go through the array differently with your own loops.
B
23
S
6
G
11
Posts: 1,045
Reputation: 8,061

Post » Tue Jan 27, 2015 10:22 pm

Ah ok, thanks! This explains everything :)
B
11
S
2
Posts: 213
Reputation: 1,266


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 8 guests