0 Favourites

How do I do random and exclude ?

  • Hi,

    Well I have seen this answer by codah, which describes very simple and elegant way of choosing random number from the range, but excludes already chosen. The method employs 2 arrays.

    scirra.com/forum/transfer-array-vars-then-have-that-var-deleted_t119328

    But I want to ask about another method of doing this, using built in "Pick random instance". It applys corresponding IID to to every created sprite and stores this value in inst. variable. Then it picks random sprite and deletes it, and so on. Is it OK and safe?

    Another thing - where an instance with "0" IID/Variable comes from ? Without being deleted in event 5, it will show instance with var equal to zero ?

    dropbox.com/s/yua4nsd86z2vl9d/random%20and%20exclude.capx?dl=0

    thanks

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)