monkeyonmars's Recent Forum Activity

  • How to randomize without duplicates (Advanced Random permutation table feature) - LINK

    Thanks a lot! I'll take a look at it right away! :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As the title says i have this scenario:

    I have a cards.json with an array of cards (array of objects). I want to generate 3 cards "opponents" to the player without the possibility to choose the same element.

    Example:

    cards.json

    [{ "id": 1, "name": "Goblin" }, { "id": 2, "name": "Another Goblin" }, { "id": 3, "name": "Healing Potion" }, { "id": 4, "name": "Ogre" }, { "id": 5, "name": "Healing Potion Super" }]

    I want to choose randomly three of this five elements and throw it to player without repetitive of the same object.

    Of course i'm doing a for loop in cards array and i know i can use round((random(0, max_size_of_array))), but how i can prevent the repetition?

    Thanks a lot for the help! :)

  • You do not have permission to view this post

monkeyonmars's avatar

monkeyonmars

Member since 10 Nov, 2019

None one is following monkeyonmars yet!

Trophy Case

  • 5-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

7/44
How to earn trophies