[MWForum]hide with touch
Jeff Knope
mwforum@lists.mathcats.com
Sat, 1 May 2004 17:15:58 -0700
This is a multi-part message in MIME format.
------=_NextPart_000_0007_01C42F9F.F8986920
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Misty wrote:
How do I get two turtles to hide when another turtle goes over them
Thank you for any help
Hi Misty,
Start MicroWorlds, then copy and paste the following into the procedures =
tab. Run SETUP once. Then run HIDEWITHTOUCH as many times as you like.
TO SETUP
newturtle "t01
setpos [0 100]=20
setc "red
st
newturtle "t02
setpos [100 100]=20
setc "blue
st
newturtle "t03=20
setc "green
st
end
TO HIDEWITHTOUCH
when [touching? "t03 "t01][tto "t01 ht]
when [touching? "t03 "t02][tto "t02 ht]
tto "t03
repeat 20 [fd 5 wait 1]=20
rt 90=20
repeat 30 [fd 5 wait 1]
setpos [0 0] seth 0
everyone [st]
stopall
end
(When I follow these directions, for some reason it copies into the =
procedures tab with what appear to be extra spaces between each line. I =
don't know why it does that. But it still works okay. Good luck, -Jeff)
------=_NextPart_000_0007_01C42F9F.F8986920
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Misty wrote:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV>How do I get two turtles to hide when another turtle goes over=20
them<BR>Thank you for any help</DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Hi Misty,</FONT><BR><BR><FONT =
face=3DArial=20
size=3D2>Start MicroWorlds, then copy and paste the =
following into=20
the procedures tab. Run SETUP once. Then run HIDEWITHTOUCH as many times =
as you=20
like.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>TO SETUP</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>newturtle "t01<BR>setpos [0 100] =
<BR>setc=20
"red<BR>st</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>newturtle "t02<BR>setpos [100 100] =
<BR>setc=20
"blue<BR>st</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>newturtle "t03 <BR>setc =
"green<BR>st</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>end</FONT></DIV>
<DIV> </DIV><FONT face=3DArial size=3D2>
<DIV><BR>TO HIDEWITHTOUCH</DIV>
<DIV> </DIV>
<DIV>when [touching? "t03 "t01][tto "t01 ht]<BR>when [touching? "t03 =
"t02][tto=20
"t02 ht]</DIV>
<DIV> </DIV>
<DIV>tto "t03<BR>repeat 20 [fd 5 wait 1] </DIV>
<DIV>rt 90 </DIV>
<DIV>repeat 30 [fd 5 wait 1]<BR>setpos [0 0] seth 0</DIV>
<DIV> </DIV>
<DIV>everyone [st]<BR>stopall</DIV>
<DIV> </DIV>
<DIV>end</DIV>
<DIV> </DIV>
<DIV>(When I follow these directions, for some reason it copies into the =
procedures tab with what appear to be extra spaces between each line. I =
don't=20
know why it does that. But it still works okay. Good luck, -Jeff)</DIV>
<DIV></FONT> </DIV></BODY></HTML>
------=_NextPart_000_0007_01C42F9F.F8986920--