How do I make randomly positioned objects drop from above?

0 favourites
  • 4 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • 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?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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)

  • 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!

  • Check out the vertical space shooter example that comes with C2 too (when you go to new project), most people miss it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)