How do I Spawn 1 to 5 objects on kill

Get help using Construct 2

Post » Sun Jul 31, 2016 9:18 pm

ok here is what i want to do
when i destroy an asteroid
i want it to spawn 1 to 5 minerals

if you can send me a capx :)
[url]kiugetski.com/space[/url]
B
28
S
9
G
3
Posts: 136
Reputation: 3,775

Post » Sun Jul 31, 2016 10:49 pm

On Asteroid Destroyed
Repeat ceil(random(5)) times - Spawn Minerals
Mistakes were made.
B
53
S
27
G
114
Posts: 1,699
Reputation: 64,446

Post » Sun Jul 31, 2016 11:34 pm

where is that repeat ceil
B
28
S
9
G
3
Posts: 136
Reputation: 3,775

Post » Sun Jul 31, 2016 11:41 pm

System-repeat.

ceil(random(5)) is the expression for how many times to repeat. Ceil() rounds up.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,699
Reputation: 64,446

Post » Sun Jul 31, 2016 11:45 pm

ok found it but now the problem is they are all stacked XD
is there a way to not have them stacked ?
B
28
S
9
G
3
Posts: 136
Reputation: 3,775

Post » Mon Aug 01, 2016 12:45 am

How do you want them to spawn then? You can position them however you want after creating them.

One way is to move at angle, for example 20 pixels at random(360) degrees.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,699
Reputation: 64,446

Post » Mon Aug 01, 2016 2:00 am

ty so much it make it look much better

[url]kiugetski.com/space[/url]
B
28
S
9
G
3
Posts: 136
Reputation: 3,775


Return to How do I....?

Who is online

Users browsing this forum: Kyatric and 30 guests