How do I make randomly positioned objects drop from above?

Get help using Construct 2

Post » Sun Sep 25, 2016 2:31 pm

I'm working on a project with feigned horizontal movement, where the player has to stay airborne while avoiding/dealing with obstacles. I'm wanting things to come in from above the screen somewhat randomly, how would I go about this?
B
8
S
1
Posts: 58
Reputation: 570

Post » Sun Sep 25, 2016 3:06 pm

You can set up a series of spawn points above that are used randomly, every x seconds pick random spawn point instance or you can create objects at a random range of X across Y every X seconds. Lots of ways to do it. The objects will need some other logic set up to move down, or you can apply physics behaviour.

So the logic will look something like this:

Every X seconds
Pick random SpawnPoint -- Spawn Obstacle at SpawnPoint

OR

Every X seconds -- Create object Obstacle at X=random(0,1000), Y=0 (co-ords are flexible)
B
45
S
15
G
73
Posts: 2,026
Reputation: 43,434

Post » Sun Sep 25, 2016 4:48 pm

plinkie wrote:You can set up a series of spawn points above that are used randomly, every x seconds pick random spawn point instance or you can create objects at a random range of X across Y every X seconds. Lots of ways to do it. The objects will need some other logic set up to move down, or you can apply physics behaviour.

So the logic will look something like this:

Every X seconds
Pick random SpawnPoint -- Spawn Obstacle at SpawnPoint

OR

Every X seconds -- Create object Obstacle at X=random(0,1000), Y=0 (co-ords are flexible)

Thanks much!
B
8
S
1
Posts: 58
Reputation: 570

Post » Sun Sep 25, 2016 5:27 pm

Check out the vertical space shooter example that comes with C2 too (when you go to new project), most people miss it.
Mistakes were made.
B
49
S
24
G
107
Posts: 1,581
Reputation: 60,303


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Ryan Kocourek and 2 guests