Creating "commands" for Etoys
Lex Spoon
lex at cc.gatech.edu
Mon Mar 26 15:45:06 UTC 2001
J Scott Jaderholm <scott at jaderholm.com> wrote:
> Ok, there must be a way to do this then without creating my own
> commands, but I don't know how.
>
> I have three SketchMorphs named Moon, Earth, and Sun. I want the Moon
> to revolve around the Earth, and the Earth to revolve around Sun.
>
> I was going to make a command that would change the moon's X,Y based on
> the Earth's X,Y, but if I can't create commands that's not really an
> option.
>
> I guess there's a better way to do this using the commands we already
> have..any ideas what that way is?
>
Do you know about arithmetic in EToys? Click the little green arrow
pointing to the right, and you can adjust a value using basic
arithmetic. So you can do things like:
Moon's x <- Earth's x + Moon's deltaX
-Lex
More information about the Squeak-dev
mailing list
|