A seemingly trivial task!

Jim Ford jaford
Mon May 5 08:53:40 PDT 2003


Hi,
As a start to a simulation of the transition of states of matter from solid
to liquid to gas, I want to make an object (molecule) jiggle about a given x
y point. Using tiles, I've tried:

Ellipse heading Random 180 (I would expect Random 180 to return an integer
                           between 1 and 180, but it doesn't - it returns
                           -180 to +180, but it produces the right effect!)
Ellipse forward 10
Ellipse heading 180 (to point back where it came from)
Ellipse forward 10  (to return to the starting x y)

What actually happens is that the object rotates randomly (as wanted) about
a fixed point - but the 'Ellipse forward 10' statements don't get executed
at all. Is there some preprocessing going on that decides that the net moves
are nill, so the Ellipse is not moved at all (like curses iirc)? If so, how
do I get round it (using tiles), please? I've tried inserting delay loops at
strategic points to attempt to thwart this, also 'Ellipse forward -10' instead
of rotating it 180, but the preprocessor's smarter than I am!.

Regards: Jim Ford



More information about the Squeakland mailing list