[Solved]How do I spawn different sprite in sequence?

Just started using Construct 2? Post your questions here

Post » Mon Aug 03, 2015 3:01 pm

Hi everyone,

I use the following event to spawn random enemies:

System: Every tick - System: Set randomenemy to floor(random(3))

System: randomenemy = 0 - System: Create object A
System: randomenemy = 1 - System: Create object B
System: randomenemy = 2 - System: Create object C

I would like to know the way to spawn enemy in sequence. Like create A, B and C then repeat A, B and C.

Thanks,
Clement
Last edited by mrneko on Tue Aug 11, 2015 11:32 pm, edited 1 time in total.
B
23
S
10
G
2
Posts: 104
Reputation: 3,071

Post » Tue Aug 04, 2015 9:21 am

Image
B
28
S
11
G
2
Posts: 139
Reputation: 3,299

Post » Wed Aug 05, 2015 10:21 am

@Fidasx

Thanks for your input.

I forgot to add something. I want to create Object B after Object A has been destroyed and Object C after Object B Has been destroyed. When Object C has been destroyed, it goes back to create Object A and so on.

Hope it doesn't confuse you.
B
23
S
10
G
2
Posts: 104
Reputation: 3,071

Post » Wed Aug 05, 2015 4:00 pm

just make an instance variable on the sprite and use it as a bollean 0-1 so if the object "exists" set to 1 else set to 0
then make a subevent and on the loop check if its 0 or 1 then fire any action you like
Image
B
28
S
11
G
2
Posts: 139
Reputation: 3,299

Post » Thu Aug 06, 2015 6:09 pm

you can also put al the stuff in a family and do your events with the family..
He will spawn random objects from the family
B
6
S
2
Posts: 114
Reputation: 874

Post » Tue Aug 11, 2015 5:02 pm

This question of mine was very similar, and I received very helpful guidance:

viewtopic.php?f=147&t=149531
B
6
S
2
Posts: 34
Reputation: 512

Post » Tue Aug 11, 2015 11:31 pm

Thanks guys. I've come up with a solution some time ago based on Fidasx's suggestion but forgot to update this thread here. I'll mark this as solved.
B
23
S
10
G
2
Posts: 104
Reputation: 3,071


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest