How do I make object falling down random ?

Get help using Construct 2

Post » Sat Oct 25, 2014 8:49 am

Is there any method allow to fall different types of objects random from outside the layer to inside so the player can grab it or eat it ?
You do not have the required permissions to view the files attached to this post.
B
4
S
1
Posts: 18
Reputation: 395

Post » Sat Oct 25, 2014 9:18 am

You can do something like

system > every 1 sec
--- system > create object at position (random(0,layout.Width), layout/Height)

And use another event to make them fall. What kind of fall do you want to achieve? Do they should stop when they have reached a certain distance ?
B
12
S
7
G
7
Posts: 450
Reputation: 4,276

Post » Sat Oct 25, 2014 9:56 am

I threw together a .capx file for you. Its kinda late here so I didn't have time to comment it much. I think you can figure it out though its pretty straight forward.

All it does is call for a random spawner object (one of 5) to spawn a random piece of 5 fruit every 3-4 seconds. The fruit and floor have physics so they fall and bounce but you can give the items bullet behaviors and set angle to 90 and whatever speed you like and do an on-collison or overlap with floor instead.

Hope it helps you see one way to put together multi-items selections without the complication of arrays. :)
You do not have the required permissions to view the files attached to this post.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
B
65
S
17
G
8
Posts: 636
Reputation: 9,333

Post » Sun Oct 26, 2014 8:44 am

Coin-coin le Canapin wrote:You can do something like

system > every 1 sec
--- system > create object at position (random(0,layout.Width), layout/Height)

And use another event to make them fall. What kind of fall do you want to achieve? Do they should stop when they have reached a certain distance ?

Yes

chrisinfinger wrote:I threw together a .capx file for you. Its kinda late here so I didn't have time to comment it much. I think you can figure it out though its pretty straight forward.

All it does is call for a random spawner object (one of 5) to spawn a random piece of 5 fruit every 3-4 seconds. The fruit and floor have physics so they fall and bounce but you can give the items bullet behaviors and set angle to 90 and whatever speed you like and do an on-collison or overlap with floor instead.

Hope it helps you see one way to put together multi-items selections without the complication of arrays. :)

thank you. I will download it and try it.
B
4
S
1
Posts: 18
Reputation: 395


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests