During my presentation last week, a teacher asked me about the possibility of using Squeak to simulate colliding balls (e.g. gas molecules). I came up with this simple project: http://poincare.uits.iupui.edu/~heiland/squeak/collide/
and would like feedback on the "best" way to do collision detection - for siblings, in this case. The little 2-ball simulation I show in this proj result in a springy/sticky action as they collide (due to the test and the forward by amount, I guess. Is there a better test to use than "overlaps any", or better logic?
Also, I captured the screen image before saving the project. After I saved the proj, all "Sketch" tiles in the scripts were changed to "Sketch1". I think I've had this happen before, reported it, and had Scott reply, but I'm too lazy to go try to find it right now :) Maybe it happened due to the fact that I had assignment stmts for both Sketch and Sketch1 in the 'reset' script??
--Randy
Randy,
I'm pretty sure that you have considerd using Kedama.
If you create a script something like:
patch clear. turtle1 patchValueIn patch increse by 1. Test: turtle1 patchValueIn patch > 1 Yes: turtle1 turn by 180. No:
and tick this script, it is similar to what your example is doing but with more molecules.
-- Yoshiki
squeakland@lists.squeakfoundation.org