Delete an Element in an Array, Shift The Remaining Items

Get help using Construct 2

Post » Fri Mar 14, 2014 8:34 am

Hello,


i'm kind of frustrated with how to do this in construct so here goes.

I have a 2D array with, say like 5 elements, and all of them have contents.
I decide to remove the element at index[2][0] for example.

It should remove the element at the index[2][0] and all the elements alongside it, and shift the items so that there is no space left in the middle.
B
8
Posts: 35
Reputation: 388

Post » Fri Mar 14, 2014 2:35 pm

I don't understand your gripes with how Construct handles this. If you delete an index on an axis, the remaining elements are automatically shifted on that particular axis...
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Fri Mar 14, 2014 4:24 pm

B
10
S
2
Posts: 135
Reputation: 1,090

Post » Fri Mar 14, 2014 6:53 pm

If you have any doubt, it works "multi-dimensionally"
deleteIndexOnAxis.capx
B
66
S
22
G
14
Posts: 1,484
Reputation: 16,511


Return to How do I....?

Who is online

Users browsing this forum: Cha0tiXGamer, ketramtu18 and 9 guests