Sofox's Forum Posts

  • 1 posts
  • I'm no expert but here's how I would do it:

    First of all, confirm that the physics engine is deterministic: If the initial angle, ball speed, roulette position and roulette rotation speed is the same, will it always lead to the same final result? Especially on different platforms? If so, then continue on. If not, then this solution won't work. I'm actually new to Construct 2 and don't know how its physics engine operates.

    Having the program go on a continual loop of trying random ball angles, ball speeds and roulette starting positions; then marking down which number the ball ends up in. Leave this running for a few hours, and when you return, you'll have a list of initial settings tied with which end number they'll produce. This means that for every number on the roulette wheel you should have a couple of initial settings that you know will produce that number.

    So now it's simple, whenever you want to produce a given number on the wheel, you just randomly choose one of the initial setting that you know will produce that number.

    Just remember: Any changes to the physics engine may make you have to do the whole thing again. Also, double check that different platforms won't run the physics engine differently. Sometimes floating numbers are dealt with differently by platform.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 1 posts