0 Favourites

How do I

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

  • Construct 3

    Buy Construct 3

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

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


    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...

  • Thank you so much, I will work on that.


Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
99 10,137
karshinkoff's avatar
Unread hot topic
56 4,731
MPPlantOfficial's avatar
Unread hot topic
0 Favourites
Why is Stencyl doing better?
44 16,854
Potato's avatar