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]
http://www.twitch.tv/kiugetski
https://discord.gg/55R9Gbs

feel free to contact me of follow me :) i can give some advice
B
37
S
11
G
4
Posts: 161
Reputation: 4,812

Post » Sun Jul 31, 2016 10:49 pm

On Asteroid Destroyed
Repeat ceil(random(5)) times - Spawn Minerals
Mistakes were made.
B
60
S
30
G
134
Posts: 1,950
Reputation: 75,377

Post » Sun Jul 31, 2016 11:34 pm

where is that repeat ceil
http://www.twitch.tv/kiugetski
https://discord.gg/55R9Gbs

feel free to contact me of follow me :) i can give some advice
B
37
S
11
G
4
Posts: 161
Reputation: 4,812

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
60
S
30
G
134
Posts: 1,950
Reputation: 75,377

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 ?
http://www.twitch.tv/kiugetski
https://discord.gg/55R9Gbs

feel free to contact me of follow me :) i can give some advice
B
37
S
11
G
4
Posts: 161
Reputation: 4,812

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
60
S
30
G
134
Posts: 1,950
Reputation: 75,377

Post » Mon Aug 01, 2016 2:00 am

ty so much it make it look much better

[url]kiugetski.com/space[/url]
http://www.twitch.tv/kiugetski
https://discord.gg/55R9Gbs

feel free to contact me of follow me :) i can give some advice
B
37
S
11
G
4
Posts: 161
Reputation: 4,812


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests