Hundreds of features to explore
Games made in Construct
Your questions answered
Trusted by schools and universities worldwide
Free education resources to use in the classroom
Students do not need accounts with us
What we believe
We are in this together
World class complete documentation
Official and community submitted guides
Learn and share with other game developers
Upload and play games from the Construct community
Game development stories & opinions
im trying to figure out a formula on how to spawn objects around a circle. i need it to be random X,Y but at a fixed interval in distance.
so i want the red sprites to only spawn inside in the grey band. any ideas?
PS. the grey band is not an actual sprite, only a visual example of the formula im looking for.
You may generate random X,Y coordinates and check whether they are inside an area or not. For instance, you can use the "distance" function and it should be between 2 values. Keep generating coordinates until they are in =)
hmm ye that might work, thanks! i was trying to use a cos/sin but math > me =)
Develop games in your browser. Powerful, performant & highly capable.
tried your solution but i think i solved it another way:
created object at circle.x, circle.y
move object random(500,600) at angle random(0,360)
repeat as many times as i need... did kind of work.
Great! It is nice that there are many ways to achieve a goal! =)