How do I make object falling down random ?

0 favourites
  • 4 posts
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • 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 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 ?

  • Try Construct 3

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

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

    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.

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