How do I preserve room enemies?

Get help using Construct 2

Post » Sat Feb 04, 2017 10:28 am

Hi guys,

I have a problem, and maybe u can help me. I have a room generation system in which I assign a layout to a room. Same layout can be assigned to many rooms. At the start of each layout, I spawn the enemies through spawners placed in the layout. So now, what I want to do is to not spawn the enemies I have killed, and spawn the enemies that were not killed. I can do this with the persist behaviour, but I as I said, I use the same layout for different rooms, so the enemies from the room 1 are not the same than the room 5.

If someone knows a workaround for this, I would appreciate it, thank you.
B
6
S
2
Posts: 61
Reputation: 1,099

Post » Sat Feb 04, 2017 2:39 pm

Finally I did it with an array.

A bidimensional array in which I save in the 0 index the room UID and the subsquent index the IID of the enemy spawners when I kill the enemy that belongs to that spawner.

So if I go back to that room, and the IID of the spawner is in the array, it does not spawn anything
B
6
S
2
Posts: 61
Reputation: 1,099


Return to How do I....?

Who is online

Users browsing this forum: adelwich, androidpro, Instrex and 29 guests