Is there a way to create a random path for small ball like a pinball?
I was thinking of adding a small mini-game of pachinko for fun (and perhaps extra prizes and to be different ;D ) and I was wondering what kind of scripting would be needed.
Well, you would have to create ball physics, and that would be a little bit of code. Use the Maths functions in AGS to do this. Also, you might need to code in a SINE table. Heres a link to the SINE table
http://www.2dadventure.com/ags/SINE_TABLE.zip
Theres the demo game, and if you open it in AGS you'll see the code for it all.
Whoa there! There is no need for that "SINE table" any more, since AGS has built in functions for sin, cos etc.
Writing a pachinko simulation from scratch would be pretty difficult for a beginner. You could fake it by having each ball object decide randomly whether to fall to the left or right (using "Random(1)") of the next pin.
Quote from: SteveMcCrea on Fri 19/05/2006 22:23:12
Whoa there! There is no need for that "SINE table" any more, since AGS has built in functions for sin, cos etc.
It was just a little example to maybe help him get on track. ;D
Here is a pachinko physics demo with source code, for AGS2.72.
http://www.kweepa.com/step/ags/tech/pachinko.zip (http://www.kweepa.com/step/ags/tech/pachinko.zip)
It's probably not much use to you but I felt inspired to write it.
Includes a Math3d module and a Collide3d module (although obviously this demo only uses 2 of the 3 d).
holy crap! :o Thats awesome Steve! Where is this collide 3d?
It's the module "Collide3d.scm" in the zip file. It doesn't do very much - just sphere v sphere, sphere v capsule, moving sphere v sphere, and moving sphere v capsule.