How do I spawn multiple instances of same object

Get help using Construct 2

Post » Fri Apr 03, 2015 8:46 am

I'm trying to find the best way to spawn multiple sprites from another.

I have a invisible 'spawn box' toward the bottom of my layout. After the user completes the task and level I want 20 instances of the same object to spawn from this spawn box. Each instance should spawn from a different area of the spawn box. What is the best way to do this?.

Is it better to create 10 mini spawn boxes and have a seperate sprite spawn from each one when the time is right?. Or can I do it just from one long spawn box and have all sprites spawn at different points?.

A balloon image spawns from the spawn box, I've just added another balloon so in total there's just 2 so far. I'm sure there's a better way of doing this with concerns to memory too.

Image
B
4
Posts: 19
Reputation: 238

Post » Fri Apr 03, 2015 9:14 am

Why not use Repeat condition - and create balloons in random layout positions action.
Image
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,145

Post » Fri Apr 03, 2015 9:39 am

Random and predetermined spawn points..
http://s000.tinyupload.com/index.php?fi ... 7142149468
Image
B
59
S
23
G
7
Posts: 1,450
Reputation: 10,614

Post » Fri Apr 03, 2015 10:18 am

Thanks alot - never knew about the repeat condition. Thanks
B
4
Posts: 19
Reputation: 238

Post » Fri Apr 03, 2015 12:48 pm

Looks like your question has already been answered but what I would likely do is use

system - create object - x = random(0,0) y = random(0,0) and then replace the 0,0 with whatever space you want it to spawn in such as x = (0,680) y = (580,680)

then I would either have it repeat 10 times or I'd just manual copy and paste it a few times.
B
6
S
1
G
1
Posts: 31
Reputation: 945


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests