How do I Get a Random NR not to repeat?

0 favourites
  • 7 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Like i want to know how can i do like random repeater but... without repeating the nr's that allready where generated like.

    i have allready made this with choose function

    i made Choose(1,2,3,4,5) till like 32 and the only problem is i dunno how to make it not choose the nr's that allready where displayed

    i know i would find some way but it would beee like in my logic hard and time consuming so i tought mybe u can help me

  • kinda something different like how i can delete a nr thats already been used. in array

    like lotery

  • This will do that. You set the size(32), call 'New scramble' and just index from 0 to 31, one at a time. Or, if you really want to remove, copy the values to a regular array and use Pop to remove them from the top.

  • You can also achieve the "random lottery" behavior without use of a third-part plugin.

    See the attached and commented capx. It uses two arrays, but hopefully the comments will make it clear and simple enough.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • hmm not quite what i am looking for think... i need like a way to make something like usig dictionary wich can tell that some nr is already used and cant be used anymore or if like one animation is displayed it cant be displayed anymore i have made like pictures apear and animations change and each animation has its own nr

    and the choose function chooses randomly from 32 nrs the one nr and then picture changes telling player what to do and i only need that when one picture is displayed it cant be displayed anymore or the nr cant be picked anymore by the choose system hope u know what i mean... ty all

  • okay i got that solved now when i complite the lvl and restart they layout and start from beginning its throws the restart button right back again even if i restarted the layout and reset the variables..

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