Coding random patterns.

Started by ginanubismon, Fri 19/05/2006 20:01:17

Previous topic - Next topic

ginanubismon

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.
"I shall call thee, Roger Ellison David Nicouli Etcher Calvin Kevin Sue in honor of what kind of a big jack@$$ you had been to guys like me." ADR -01 Jabberwock Type on fanfiction writers.

R4L

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.

Kweepa

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.
Still waiting for Purity of the Surf II

R4L

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

Kweepa

#4
Here is a pachinko physics demo with source code, for AGS2.72.
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).
Still waiting for Purity of the Surf II

R4L

holy crap! :o Thats awesome Steve! Where is this collide 3d?

Kweepa

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.
Still waiting for Purity of the Surf II

SMF spam blocked by CleanTalk