any ideas on an algol to achieve this?

Hi,
Any ideas any1 can throw on how this could be achieved? It looks completely random but it is still not random.

http://www.yoambulante.com/en/labs/landingball.php

cheers,

?:)

I was going to ask if you downloaded the source and had a look at it, and then I noticed they have taken the source down.

I would also like to see how this was accomplished.

take a look at our pinball sample code

c

Carlos,
the link is not about the pinball, it is about how you can choose a pre-determined location and make it appear totally random.

cheers,

?:)

I think in the example on that page, he's just precalculating all the paths. (He does say 1250 paths).

since he has 9 numbers, there will be 81 possible pairs of starting number and ending number. for these 81 pairs, he must have determined required path(s) for each position of starting number.

Once above are known, all you have to do is play that specific path.

Hi Chinmay,
That is still not helpful, I was looking more for someone trying to attempt a pseudo code or actual code on how it can be done.

thanks for trying anyways,

cheers,

?:)

well pseudo code will be two part

precalculation of path
0) Setup world
1) For each starting position of ball on top (can be done at pixel level), and say 3 starting directions (SW, S, SE) run the simulation,
2) note the position where the ball lands on the scrolling floor and time taken
3) save all the simulation data into a file to load later into table

actual game play
1) take user input abt end position

2) search database to find the starting points on the top which result in end position. You will likely have multiple choices here.
For scrolling floor you have determinate system. i.e at any given time, you can calculate what state the scrolling floor would be at any future time.

3) do a search within search results of step 2 above, to find path such that difference between
a) time for drop simulation and
b) time for scrolling floor to reach desired end position
if within acceptable limits. The acceptable limits here are acceptable limits for time required to send ball up from scrolling floor to starting position

note that b) above will have to be done for multiple passes of scrolling floor

4) once you have right path, do the animation

May be this is too vague, but this is how essentially it's done. The reason i don't want to write code is because it will take way too much time to precalculate in corona as you can't speed up physics in corona.

Hi guys!

this is funny, read all the crazy thoughts and conclusions you got here, hehehe, quite interesting though. This algorithm uses reverse physics to predict the landing position and yes it is 100% totally at random, it will never repeat a path, the chances of that happen are extremely low. The reason why the source code was remove from the website is because a gambling company bought it and they ask for remove it, but!! the physical file is still on the server (same location), so grab it and don't tell anyone, hehehe... http://www.yoambulante.com/scripts/flash/LandingBall.zip cheers!

@alex,
you are a legend. Thanks for that. Hope to see more code samples from you now that you are on Corona.

cheers,

?:)

reverse physics? wow!
thanks for the zip file!

views:1662 update:2011/9/20 13:12:00
corona forums © 2003-2011