Programmatic generation and execution of Morphic scripts?
Bruce Cohen
brucecohen at qwest.net
Tue Jul 16 23:44:57 UTC 2002
The other day I found about MotionSketch,
http://www.snibbe.com/scott/mphone/index.html, and decided that this
ought to be a good, quick hack in Squeak (currently using 3.2 gamma,
latest updates, if it matters). The basic notion of MotionSketch
is a short interactive loop a few seconds long, that repeats the
motion made b y the user with some shape, over and over, as the user
adds more motions/shapes. Well, I thought, since I'd like to extend
this to repeat changes in other properties than position (color and
shape, for instance) this is a perfect application for scripting.
After a bunch of poking around with browsers and playing with
scriptors, I still think so, but I'm having trouble figuring out
exactly how to go about it.
Scripting seems to have been designed for supporting interactive
creation and execution of scripts. What I want to do is create
scripts programmatically, given Morph property names and ordered
collections of values to assign to them on successive ticks,
associate the scripts on the fly with particular Morphs (actually
their players, I guess), and then have the MotionSketch loop execute
them. Is there some simple way to, for instance, create script
strings, compile them, and associate them with a given Player? I
don't want to use SyntaxMorphs, that seems overkill for what I'm
doing; in fact, I don't want to create any sort of Tile or Tile
support object, since I don't want the scripts to display under
normal conditions.
Has anyone played with this sort of idea?
--
"The joke is over when the head falls off." - Scotts' proverb
=========
Bruce Cohen
brucecohen at qwest.net
More information about the Squeak-dev
mailing list
|