Set random position in spot points without overlapping!

Get help using Construct 2

Post » Sat Sep 12, 2015 10:29 pm

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

Image

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 :evil:

Image

Image

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

Image

capx
http://www.filedropper.com/thepositiondilema
B
9
S
3
Posts: 142
Reputation: 1,108

Post » Sun Sep 13, 2015 9:24 am

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 :)
B
78
S
23
G
69
Posts: 1,354
Reputation: 44,027

Post » Sun Sep 13, 2015 2:25 pm

August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892

Post » Sun Sep 13, 2015 7:54 pm

gamecorpstudio wrote: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 :)


Yes!!!!!!, thank you so much!!! :)
B
9
S
3
Posts: 142
Reputation: 1,108

Post » Wed Sep 16, 2015 7:19 am

@majinboo - but did you work out why your version didn't work ?
August 2015 - I misplaced a lot of links - I will try to find backups and repost. If You find a post that interests please reply to post with @rampackwobble and I will get a nudge!

If you find my posts useful please consider donating something to a local charity or to the http://www.mndassociation.org/
B
64
S
34
G
47
Posts: 1,194
Reputation: 30,892


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests