Page 1 of 1

Create actor at random point from x/y +10 or -10

PostPosted: Sat Apr 14, 2007 4:51 am
by littlekruser
I was wondering how I can create an actor at a random distance away from the creating actor but only within about +/-10 of the x/y coordinate.

PostPosted: Sat Apr 14, 2007 2:46 pm
by makslane
In the creator actor put:

Code: Select all
double newx, newx;

newx = x + rand(20) - 10;
newy = y + rand(20) - 10;


Put the newx and newy variables in the CreateActor function.

PostPosted: Sat Apr 14, 2007 7:38 pm
by littlekruser
thank you very much :)