[Home] [Back to Message Index]

Global SchoolNet - Automated Message Archive

Re: LOGO-L> MWorlds ?@ keys




The Eliot Montessori School (eliot_tr@ndl.net)
Tue, 28 Jan 1997 11:29:19 -0500

Thanks Michael...and others who responded with suggestions,

Michael,

My student tried to use parts of your example (see below), but it wasn't
working and I thought that maybe you had a different keyboard. Even the
number keys wouldn't work with their ascii number. But then I tried myself,
typing in your example exactly. It still didn't work. I now know why. My
student, David, doesn't want to have a button on his field so I was trying
to run the starting program, GO, from the command center (is that what it is
called?). I see now that you said to have a GO button and that way it does
work. Why won't it run from the command center? Just curious.

I made a fun program with your example as a start. I added some effects and
varied it but it was a useful starting tool. I might give it to some kids
and see where it takes them.

Thanks so much for your help.

Debra

>>One of my sixth graders is using Microworlds and is trying to program a
>>soccer game. One of the things he wants to do is have the arrow keys or the
>>number keys on the keyboard have spacific functions for his game. Like
>>turning and moving the players.
>>Is there a way to program keys in MW or not?

>Sure. Here's a sample I gave to my sixth and seventh graders. The ascii
>codes 28, 29, 30, and 31 correspond to the Macintosh arrow keys. There are
>two turtles on the page. One is programmed to SEEK "many times" and the
>other to DRIFT "many times". There's a GO button which you click to start
>the game.
>
>
>to go
>everyone [clickon]
>t1, forever [direct readchar]
>end
>
>to direct :key
>if (ascii :key) = 28 [ seth 270]
>if (ascii :key) = 29 [ seth 90]
>if (ascii :key) = 30 [ seth 0]
>if (ascii :key) = 31 [ seth 180]
>if :key = "s [stopall]
>end
>
>to seek
>fd 5
>if touching? "t1 "t2
> [announce "gotcha!! stopall]
>end
>
>to drift
>glide 500 1
>seth random 360
>end
>
>The kids have developed some pretty elaborate games from this start,
>especially mazes.
>
>-Michael
__________________________________________

The Eliot Montessori School
South Natick, Massachussets, USA
eliot_tr@ndl.net
__________________________________________

---------------------------------------------------------------
Please post messages to the Logo forum to logo-l@gsn.org. Mail
questions about the list administration to logofdn@gsn.org. To
unsubscribe send unsubscribe logo-l to majordomo@gsn.org.