How do I remove a specific value from an array

Get help using Construct 2

Post » Thu Jan 26, 2017 7:39 pm

Hello,

In my game I have an array with 3 values (10, 11, 12). These values correspondent with an instance value of a sprite (for example an enemy sprite with an instance value of EnemyID = 10).

I would like the following: when an enemy is destroyed, I want the corresponding value removed from the array. So if enemy with EnemyID = 10 is destroyed, remove the index from the array where the value is 10.

Is this possible? How can I achieve this?
B
7
S
1
Posts: 23
Reputation: 421

Post » Thu Jan 26, 2017 7:49 pm

Array.Delete
ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Thu Jan 26, 2017 8:55 pm

Hi blackhornet, thank you! Can you give me a more specific example how to achieve this? Thank you!
B
7
S
1
Posts: 23
Reputation: 421

Post » Thu Jan 26, 2017 9:22 pm

Image
ImageImageImage
B
71
S
21
G
221
Posts: 3,649
Reputation: 124,227

Post » Thu Jan 26, 2017 9:29 pm

Thank you! This is great!
B
7
S
1
Posts: 23
Reputation: 421


Return to How do I....?

Who is online

Users browsing this forum: vegapomme27, Yahoo [Bot] and 9 guests