Array looping help

Get help using Construct 2

Post » Sun Feb 17, 2013 12:41 pm

Hello all,

I'm trying to get my head round doing the following set of actions using Construct 2. Could anyone lend me a hand :)

I have a global var moveID.

I increment this every time a move command is issued (like press right etc).

I also add this value to a one dimensional array using [moveID] as the index and then the move value.

What I want to be able to do, is take any moveID (let's say 100) and the array has values for example to 150. Loop from 100 to the end, extracting the values and adding them to another variable.

Then delete all the indexed values we just looped through.

I'm ok doing this in javascript but just need to understand what this will look like in c2.

Many thanks.

B
5
S
1
Posts: 39
Reputation: 828

Post » Sun Feb 17, 2013 3:18 pm

You can use the Array.Delete call. This deletes as you go.

ArrayDeleteSample
ImageImageImage
B
71
S
22
G
249
Posts: 3,763
Reputation: 138,577

Post » Sun Feb 17, 2013 3:29 pm

Thanks but I couldn't download the capx - free hosting 404 page.
B
5
S
1
Posts: 39
Reputation: 828


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests