Hundreds of features to explore
Games made in Construct
Your questions answered
Popular & trusted by schools and Universities world-wide
Construct 3 runs in the browser & works offline
Students do not need accounts with us
Our educational partners
Free education resources to use in the classroom
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
I want to create an object at a random X location that is random on two ranges.
Like on the interval: [a, b] AND [c, d]
I might want to create an object that is outside the layer on either side.
Develop games in your browser. Powerful, performant & highly capable.
Thanks. Is there a way I can give weights to the arguments to choose()?
Like say I wanted it to generate a number on [10, 20] 1/3 of the time and [70,85] 2/3 of the time?
I mean I know for that specific example I could do like choose(random(10, 20), random(70, 85), random(70, 85))
But what if the weights weren't integers or large integers with no large common factors, so I'd have to spam the random()'s in many times?
I found a way:
Can't post url's yet but the thread was titled "Weighted probabilities"