[SOLVED]Pick instances of spawned sprites?

Discussion and feedback on Construct 2

Post » Thu Nov 03, 2011 4:04 pm

Hi!

I come back with my tetris-like (remember), now I got a problem with instances.

I create some sprites, then when four sprites are create I want destroy them. So I do that:
[CODE]system - pick Sprite instance 0 : destroy Sprite
system - pick Sprite instance 1 : destroy Sprite
system - pick Sprite instance 2 : destroy Sprite
system - pick Sprite instance 3 : destroy Sprite[/CODE]
Only one sprite was destroy, instance 0, even if that was the fourth sprite.

I've read some topics about instances on the forum, but well I've to admit that I don't understand the problem.

Here a .capx:
test-instances.capxwilfryed2011-11-03 21:17:22
B
23
S
5
G
5
Posts: 112
Reputation: 4,737

Post » Thu Nov 03, 2011 8:18 pm

Maybe I need to explain that I don't create these Srite, but they are spawned.
So, it's possible to pick these spawned sprites?
B
23
S
5
G
5
Posts: 112
Reputation: 4,737

Post » Thu Nov 03, 2011 8:28 pm

I don't get this idea too. Comes the question, will be back the family things. Enemys family, allies family. This can save lifes in my office today.
B
203
S
37
G
13
Posts: 136
Reputation: 29,523

Post » Thu Nov 03, 2011 8:32 pm

Ok so I guess I can waste my night to find another idea :D
B
23
S
5
G
5
Posts: 112
Reputation: 4,737

Post » Thu Nov 03, 2011 8:47 pm

Only the most recently created/spawned instance is picked in the sub-events that follow. change event 4 so it's not a sub-event of event 3 and they should be able to get destroyed.
B
79
S
24
G
54
Posts: 4,751
Reputation: 40,765

Post » Thu Nov 03, 2011 9:16 pm

Hurray!

That works great!
Merci!

Here the solution:
test-instances.capxwilfryed2011-11-04 07:24:10
B
23
S
5
G
5
Posts: 112
Reputation: 4,737

Post » Thu Nov 03, 2011 11:55 pm

Wrong link.
I would like to see that example.

saludos :D
B
9
S
2
G
4
Posts: 19
Reputation: 2,648

Post » Fri Nov 04, 2011 7:25 am

Tadam I've fix the link!
Tell me if that works!
B
23
S
5
G
5
Posts: 112
Reputation: 4,737


Return to Construct 2 General

Who is online

Users browsing this forum: GhoulishGames and 13 guests