Set random position in spot points without overlapping!

0 favourites
  • 5 posts
From the Asset Store
In this template the music plays without looping in your game
  • i am trying to set random position without overlapping, right now i don't have the overlapping problem but i cant get random position, the sprites get the first 5 positions ( i have 12 over the layout) but not random, i am trying to do this by different ways, the last one was using families and creating 1 sprite per spot (12 different sprite spots inside the family) but didn't worked, i cant found the solution, please give me a hand...

    Update:

    I burned my brain the whole day trying to solve this, finally i thought that I had finally made it but for some reason sometimes 1 object refuse to move of position, why?? why????? i don't know <img src="{SMILIES_PATH}/icon_evil.gif" alt=":evil:" title="Evil or Very Mad">

    Update 2: My head explode now, in the debugger all looks OK, i cant understand..

    capx

    http://www.filedropper.com/thepositiondilema

  • i think i fixed it https://mega.nz/#!hZdk2ZAT!qwp40D5hS_O0 ... 9pNj6Hu-yw

    it works with the 0 origin point.. you dont need to have all those origin points.. there is no database to check if their occupied... so instead of that i checked the positioned of objects and overlapping each other it shoots 2 times... first time picks all familly then if any of them objects overlaps same position object picks that object and moves it on another empty slot...

    i think thats what you wanted <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • how about

    https://goo.gl/JGrs7I

  • i think i fixed it https://mega.nz/#!hZdk2ZAT!qwp40D5hS_O0 ... 9pNj6Hu-yw

    it works with the 0 origin point.. you dont need to have all those origin points.. there is no database to check if their occupied... so instead of that i checked the positioned of objects and overlapping each other it shoots 2 times... first time picks all familly then if any of them objects overlaps same position object picks that object and moves it on another empty slot...

    i think thats what you wanted <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    Yes!!!!!!, thank you so much!!! <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Majinboo - but did you work out why your version didn't work ?

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