[Thread Prev] [Thread Next]
Here is a sample that includes Seymour's suggestion of clickon and
clickoff. Try it!
If this sample is too befuddling, or does not work for you, please feel
free to inquire further. This sample includes some other ideas I have
been learning about, like changing the size of the glyph depending on
location, and changing the speed to make it look realistic as the size
changes. May be just too much stuff to make sense of (especially since
I tend to use brute force, not knowing enough yet about programming to
[mailto:mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Nadia
Sent: Thursday, May 04, 2006 5:27 AM
Subject: Re: Mac vs PC use of arrow keys in a game
Thanks for pointing this principle out. It does work better. However, I
would rather only have the turtle move when I press on the arrow keys,
not have to be started up initially (by pressing a key or setting speed
greater than 0) This is how most video games work. Is this possible?
On May 2, 2006, at 4:07 PM, Seymour Papert wrote:
A good general principle: don't put together what you can do
I see why you want the action of a key to be something like
:"move in a particular direction."
But mathematically it is "cleaner" to keep turning and moving
make "key readchar
...if :key = 38 [seth 0]
;then add two more lines to make other keys strat and stop the
;one way to do this is
if :key = ..... [clickon]
if :key = ,,,,, [clickoff]
;but there are also lots of good ways to do this My favorite is
to give the turtle the property "speed, run forever [fd speed] and use
commands like setspeed (whatever) to make it go and setspeed 0 to make
and a separate procedure like
make "gokey readchar
In this case
On May 2, 2006, at 11:46 AM, Nadia Bluhm wrote:
I am using arrow keys to steer a turtle in a game.
I use the following procedure in the turtle's backpack
and set OnClick: Steer to forever.
make "key ascii readchar
if :key = 38 [seth 0 fd 10]
if :key = 39 [seth 90 fd 10]
if :key = 40 [seth 180 fd 10]
if :key = 37 [seth 270 fd 10]
if :key = 30 [seth 0 fd 10 ]
if :key = 29 [seth 90 fd 10]
if :key = 31 [seth 180 fd 10]
if :key = 28 [seth 270 fd 10]
On the Mac, one can just hold down the arrow keys to
make the turtle move but on the PC, one has to keep hitting the arrow
keys. Why is this? How can I get the PC version to behave the same way
as the Mac version. Obviously, the Mac game is more fun to play but most
kids have PCs!
Previous by thread:
Re: Mac vs PC use of arrow keys in a game
Next by thread:
RE: Mac vs PC use of arrow keys in a game
To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.