0 Favourites

Random Spawn Intervals

  • How do I make a sprite spawn a zombie at a random interval?

    Like, it randomly picks a number, for example 6, waits 6 seconds, spawns a zombie, it randomly picks a number again, for example 3, waits 3 seconds, spawns a zombie, etc. etc..

    How would I go about doing that?

  • Click on the System command 'Every X seconds', and use the syntax "random(10)" for a max interval of 10 seconds.

    Then the action would be System, Create Object, and fill in the layer and x,y co-ords

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Using this post, and because I need something similar but I cant find the right logic:

    How do I make a random spawn of 4 numbers in 4 different but fixed positions without repeating themselves?

    In other way I want them to spawn in a,b,c and d positions randomly but never overlapping.

    I found a rudimentary way with a "set position" x=CHOOSE(128,384,640,896) and every time they overlap its forced to choose another place to be. This repeats 4 times for each number. It works but it seems very badly done. It brings me further problems when I want 10 numbers in 10 random fixed positions... its huge!

    I have this feeling that this is done with an array, but I don't know how to use it here.

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