Shift values in an Array (previously rotate)

Get help using Construct 2

Post » Fri Nov 25, 2011 11:35 am

Hi, is it possible to shift items in an arrray (this was previously called rotate in construct 1 I believe).

I am wanting to store the last 10 positions of a sprite so that when a new postion is added to the 10th slot the position currently in the tenth moves down to fill the ninth, and so on so that the item currently in the first slot gets replaced by the second and is dropped off the end.

Is there any way to accomplish in Construct 2?
B
16
S
5
G
1
Posts: 43
Reputation: 1,595

Post » Fri Nov 25, 2011 11:59 am

This might be what you are looking for:

http://www.scirra.com/forum/plugin-data-structures-in-associative-lists_topic44044.html
B
34
S
8
G
6
Posts: 34
Reputation: 4,940

Post » Fri Nov 25, 2011 12:30 pm

Hi there jumprock. This is implemented in this .capx:

http://dl.dropbox.com/u/1378330/random.capx

I don't have time to really comment it through right now, sorry. But I've marked the pertinent event with a comment. Hope it helps!
B
55
S
12
G
8
Posts: 339
Reputation: 9,314

Post » Sat Nov 26, 2011 5:05 am

Thanks for the suggestions - I'm using dataStructures plug in and it's doing exactly what I need it to.
B
16
S
5
G
1
Posts: 43
Reputation: 1,595

Post » Sat Nov 26, 2011 5:07 am

Hi cow_trix, I wasn't able to open your demo - said there was an unknown plug in ID.
B
16
S
5
G
1
Posts: 43
Reputation: 1,595


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests