# Random Loc then Collsion detection

**URL:** https://forum.kirupa.com/t/random-loc-then-collsion-detection/249982
**Category:** flash
**Created:** [January 24, 2008, 5:26am UTC](https://forum.kirupa.com/t/random-loc-then-collsion-detection/249982 "2008-01-24T05:26:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sarumitai](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@sarumitai](https://forum.kirupa.com/u/sarumitai)
#### Post date: [January 24, 2008, 5:26am UTC](https://forum.kirupa.com/t/random-loc-then-collsion-detection/249982/1 "2008-01-24T05:26:52Z")

</div>

I have a script that starts with a loop like:

for (i=1;i\<6;i++) {

MC\_mc.\_x = random(10);  
MC\_mc.\_y = random(10);  
}

That works fine. The MCs are scattered all around the stage.

But many overlap and I can’t have that. I know it’s collision detection and I’m pretty sure I need a nested FOR loop to check each time, but the syntax eludes me. I’m not super fluent with FOR loops.

Any help would be greatly appreciated.
