view.x,y& rand-->still problems with screen range
Posted: Thu Apr 22, 2004 2:10 pm
Quote:
Makslane wrote: Try this:
x = (rand(40) - 20) + your_x_center;
This will make the actor around your x center with the range:
your_x_center - 20 to your_x_center + 20
I'm still having trouble with this. Please,anyone,help.
My screen coordinates for view.x are:
-360 (left upper corner)
-160 (right upper corner)
-260 (x center) ??
My screen coordinates for view.y are:
-130 (left upper corner)
130 (Lower left corner)
0 (y center) ??
Please show me the code for this. I have tried your example over and over. I have tried many senarios but I think I'm missing something.
Here is how I think it should work, but it doesn't:
x or y= rand (a random number from 0 to some number) - ( distance from actor's x or y center) + (view.x center or view.y center)
The actor should move between the view.x (-360) and view.x (-160) coordinates and view.y (-130) to (130) at rand locations.
I'm sorry to be so slow about this. If I can ever get the proper code through my head, my next very simple activation region demo will be pretty much done. TIA
Makslane wrote: Try this:
x = (rand(40) - 20) + your_x_center;
This will make the actor around your x center with the range:
your_x_center - 20 to your_x_center + 20
I'm still having trouble with this. Please,anyone,help.
My screen coordinates for view.x are:
-360 (left upper corner)
-160 (right upper corner)
-260 (x center) ??
My screen coordinates for view.y are:
-130 (left upper corner)
130 (Lower left corner)
0 (y center) ??
Please show me the code for this. I have tried your example over and over. I have tried many senarios but I think I'm missing something.
Here is how I think it should work, but it doesn't:
x or y= rand (a random number from 0 to some number) - ( distance from actor's x or y center) + (view.x center or view.y center)
The actor should move between the view.x (-360) and view.x (-160) coordinates and view.y (-130) to (130) at rand locations.
I'm sorry to be so slow about this. If I can ever get the proper code through my head, my next very simple activation region demo will be pretty much done. TIA