How do I

0 favourites
  • 3 posts
  • Hi,

    How do I spawn an object, randomly picked from my 10 different sprites. Is there a simple tutorial for this.

    I see in the manual that I can use 'FAMILY' which requires a C2 license. Is there a long way to do this as I am not yet sure that C2 is right for me or if I have the ability to learn this program.

    Thank you.

  • Delsetray, it is much easier using a Family...

    but without Family, I would create a global variable, and set it to a random number between 1 and 10 and then create a sprite for each possible result:

    SpawnNumber = Round(Random(1,10))

    Then

    System Compare Variable -> SpawnNumber = 1 -> System Create Object -> Sprite1 on layer 0 at x , y

    System Compare Variable -> SpawnNumber = 2 -> System Create Object -> Sprite2 on layer 0 at x , y

    System Compare Variable -> SpawnNumber = 3 -> System Create Object -> Sprite3 on layer 0 at x , y

    .

    .

    .

    System Compare Variable -> SpawnNumber = 10 -> System Create Object -> Sprite10 on layer 0 at x , y

    Note: you would want to have all those lines be sub-events of some code that decides when you need to spawn a sprite. If they were top level events they would continuously spawn sprites as long as the global variable has a value...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you so much, I will work on that.

    Del

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