Random Drop Spawn Object

Get help using Construct 2

Post » Wed May 28, 2014 5:37 pm

So I'm making a shooter. I want to kill sprite5 and randomly have a sprite5 drop an object.

The object will be a boost to the main player when he collects the object.

Key Detail:

I want only 1 of the Sprite5's to drop 1 object randomly when Sprite5 is destroyed.

Advanced option.

Once the object is dropped another one can not be randomly dropped until after X amount of seconds.
Loop.
B
18
S
8
G
1
Posts: 56
Reputation: 2,018

Post » Wed May 28, 2014 6:05 pm

hey,
can you attach a sample to understand ?
i think you talking about falling down and destroy objects.
2D Game GUI Designer
B
12
S
4
G
3
Posts: 130
Reputation: 3,778

Post » Wed May 28, 2014 6:39 pm

@Manarsoft #Manarsoft

I can't think of a specific instance, but imagine Mario killed one of those Turtle things and when the turtle died a coin popped out of him.

BUT I don't want every turtle to drop a coin only 1 out of 4 or randomized
That's all I'm trying to do for now.
B
18
S
8
G
1
Posts: 56
Reputation: 2,018

Post » Wed May 28, 2014 7:09 pm

Hey,
you can do coins better by adding animated coins sprites from web.
or adding "Sin" behavior.

you can improve your game by adding sounds in the On collision of your Mario and Enemies !
:lol:
You do not have the required permissions to view the files attached to this post.
2D Game GUI Designer
B
12
S
4
G
3
Posts: 130
Reputation: 3,778

Post » Wed May 28, 2014 7:10 pm

Randomize a number and set it to a Global Variabel : floor(random(4))

Make sub-events of the Kill event:
- If variable = 0 => drop item 1
- If variable = 1 => drop item 2
- If variable = 2 => drop item 3
- If variable = 3 => drop item 4
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Post » Wed May 28, 2014 9:31 pm

@henriquesv

I don't know how to do what you said.

Say I kill 5 ants. I want 1 of the 5 to drop a power up.

How do I make sub events?
B
18
S
8
G
1
Posts: 56
Reputation: 2,018

Post » Wed May 28, 2014 10:08 pm

JDunamis wrote:@henriquesv
I don't know how to do what you said.
Say I kill 5 ants. I want 1 of the 5 to drop a power up.
How do I make sub events?

...
i gived you a sample,
is that what you are looking for?

to make a sub event, right click in the top left of an event and select Add sub event
2D Game GUI Designer
B
12
S
4
G
3
Posts: 130
Reputation: 3,778

Post » Wed May 28, 2014 10:14 pm

Thanks it says your version is higher than mine, but I don't see an update
B
18
S
8
G
1
Posts: 56
Reputation: 2,018

Post » Wed May 28, 2014 10:20 pm

JDunamis wrote:Thanks it says your version is higher than mine, but I don't see an update

...
download the last beta update from here
https://www.scirra.com/construct2/releases/r170
2D Game GUI Designer
B
12
S
4
G
3
Posts: 130
Reputation: 3,778

Post » Thu May 29, 2014 12:26 pm

Keep us updated!
B
24
S
4
G
1
Posts: 177
Reputation: 1,827

Next

Return to How do I....?

Who is online

Users browsing this forum: Artcadev, Iakkery and 30 guests