Thanks for all the replies.
-snip- image
This did not work for me and looking at what AkiraWong wrote i think i know why. "Is between values" does not let me set a value as >=
Global variable:
random = 0
radius = 200
Instance variable:
Sprite2 (angleBetween = 0)
Event:
Every tick >
Set random to (random+1)
Sprite2 (Set position to (sun.X+cos(random)*radius, sun.Y+sin(random)*radius"))
Sprite2 (Set angleBetween to (angle(sun.X,sun.Y,Sprite2.X,Sprite2.Y))
Here control the angle which you don't want object to spawn~
For your case:
if Sprite2 (angleBetween <= 130) or (angleBetween >= 140)
Sprite2 spawn GreenDot on layer 0 (Image Point 0)
You may ask my angle is between 220 & 230~
But why the angle in the code is (<= 130) or (>= 140)~
That's because the calculation of angle(x1,x2,y1,y2)~
The return answer is between (-180 to 180 degrees)~
Start from opposite direction of the object~
Yup. That's it. Hope it help. (^_^)
I understand what you wrote and thanks for explaining how the degrees work. However like i said above it wont let met change it to >=. I also don't get why you put a +1 to random.
While AnD4D solution seems to work it still bothers me that i can't get it to work with your or shinkan solutions. Sorry to ask this but maybe a capx file would help me understand.