Edge running
Posted: Fri Dec 07, 2007 2:45 am
I'm having some issues. I don't know if it is me or the computer, but here is my problem.
my code:
destX = (dx * .05) + (r.nextDouble() * (dx * .9)); // choose random destination
destY = (dy * .05) + (r.nextDouble() * (dy * .9));
This is suppoessed to keep my units away from the edge of the battle screen, unforntally it doesn't seem to work. I have tired several different numeric value, but i can't seem to fix the issue. I have thought about hard codeing number values in, but that is a bad idea if you change the area size. I beleive the area size is roughly 50 x 50. Any ideas?
my code:
destX = (dx * .05) + (r.nextDouble() * (dx * .9)); // choose random destination
destY = (dy * .05) + (r.nextDouble() * (dy * .9));
This is suppoessed to keep my units away from the edge of the battle screen, unforntally it doesn't seem to work. I have tired several different numeric value, but i can't seem to fix the issue. I have thought about hard codeing number values in, but that is a bad idea if you change the area size. I beleive the area size is roughly 50 x 50. Any ideas?