Only one of the colliding entities should move, and which entity should move should be random
I tried doing this
var collide_d:Dan = collide("dan", x, y) as Dan;
if (collide_d && doOneTime == 1)
{ var whom:int = FP.choose(1, 2); if (whom == 1) y -= 40; if (whom == 2) collide_d.y -= 40; doOneTime ++; }
Now there is one problem. When both Dan entities collide, they both run this function. If they both happen to get the same value of whom, they both move.
How do I counter this problem? I thought I’d handle all of this inside of the gameworld, but I don’t know how to check if two external entities collide…
Thanks