glad to know it works.
w = (500-200)/2;
x = random(w)-w;
The range of x will be (0 ~ 150)-150; That is (-150 ~ 0);
What we need is to make x range: -150 ~ 150;
So, I would use random(300)-150; That is (0 ~ 300)-150;
|
Results 1 to 7 of 7
Threaded View
|
Click Here to Expand Forum to Full Width |