[ARRAY] - Moving all values to the left

Get help using Construct 2

Post » Tue Jan 29, 2013 9:47 pm

Ok so I got a 1D array which looks like this

[ ][ ][ ][N]

For every X seconds I want the N to move one to the left and when it comes "off" the edge it is gone from the array.

So it would look like this:
[ ][ ][ ][N]
[ ][ ][N][ ]
[ ][N][ ][ ]
[N][ ][ ][ ]
[ ][ ][ ][ ]
[ ][ ][ ][ ]...

Anyone got an idea on how to do this? I would be very happy for any help.

Edit:
Would like a .capx exampleTheNormalGeek2013-01-29 22:02:46
(\__/)
(='.'=)
(")_(")
B
20
S
9
G
1
Posts: 68
Reputation: 3,057

Post » Tue Jan 29, 2013 10:09 pm

Set each value in the array to the value to the right.

Array: For each X element:
---- Array: set value at self.CurX to self.At(self.CurX+1)
B
79
S
24
G
54
Posts: 4,747
Reputation: 40,757

Post » Tue Jan 29, 2013 10:11 pm

Thank you! I will test this out.
(\__/)
(='.'=)
(")_(")
B
20
S
9
G
1
Posts: 68
Reputation: 3,057

Post » Tue Jan 29, 2013 10:31 pm

B
13
S
4
G
3
Posts: 75
Reputation: 3,425

Post » Wed Jan 30, 2013 7:48 pm

Anyone that knows why this won't work? Did try R0J0hound's example but it won't work either.


(It is in sub-events while I am debugging)

*It got fixed by removing all the inverted conditions*TheNormalGeek2013-01-30 20:17:07
(\__/)
(='.'=)
(")_(")
B
20
S
9
G
1
Posts: 68
Reputation: 3,057


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 17 guests