Project Folders
Teacher Resources
Student Resources
How Do I?
Site Map
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: Mac vs PC use of arrow keys in a game
From: "Menefee, Mike - OC" <Mike@xxxxxxxxxxxxxxx>
Date: Thu, 4 May 2006 08:25:42 -0700

Hi Nadia,
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
be elegant).

From: mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
[mailto:mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Nadia
Sent: Thursday, May 04, 2006 5:27 AM
To: mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
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


	to steer 
	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
it stop 

	and a separate procedure like 

	to go 
	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. 

		to steer 
		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! 


Attachment: Animaiden.mwx
Description: Animaiden.mwx

  • 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.

    © copyright 2001 - 2008