[squeakland] problem with location of Etoys players

Louis LaBrunda Lou at LaBrunda.Info
Thu Sep 23 14:23:11 EDT 2010


Hi,

I'm working on an Etoys project I call Pizza Pi.  The idea is to calculate
the value of Pi by randomly shooting blobs of tomato sauce at a pizza.  The
pizza is in a box.  The radius if the pizza is one foot (or one anything)
and just fits in the box.  Given these simple dimensions, Pi can be
calculated by the formula Pi = (blobsThatHitPizza * 4) / (blobsThatHitPizza
+ blobsThatMissPizza).  The blobs that miss the pizza are confined to the
box.

I am doing this with blobs of sauce that shoot toward the pizza box and
then jump to a random spot in the box.  The problem is that when I try to
calculate this random spot the position of the box or the blob is not what
I expect.  If I grab a blob and move it to the bottom of the playfield its
y position is -85?  I have origin-at-center turned off in the playfield
options, so I would expect the bottom edge of the playfield to be zero not
-85.

I must be missing something, so can someone please clear this up for me.
Thanks.

Lou
-----------------------------------------------------------
Louis LaBrunda
SkypeMe callto://PhotonDemon
mailto:Lou at LaBrunda.Info http://www.LaBrunda.Info



More information about the squeakland mailing list