Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

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

[Thread Prev] [Thread Next]

To: mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx, Luvin.Shoppin@xxxxxxxxx
Subject: Re: MIA, Ask an Expert: action with keys
From: "Daniel Ajoy" <da.ajoy@xxxxxxxxx>
Date: Tue, 21 Aug 2007 17:24:57 -0500
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed;

On 17 Aug 2007 at 17:23, askanexpert@xxxxxxxxxxxxxxxxxxxxxxxxxxxx wrote:

> from: <Luvin.Shoppin@xxxxxxxxx>
> date: Fri Aug 17 17:23:54 2007
> platform: PC
> version: MicroWorlds Ex
> 
> How can I stop my turtle using the space bar, and get it to start
> moving again when I push the space bar once more?

Hi,

You could use something like the switch implemented in this
mw ex project attached.

The slider serves as the switch when the user clicks on the
spacebar and the slider is on 0, then the turtle is activated
and the slider is switched to 1.

Then when slider is in 1, the turtle is deactivated and the
slider is switched to 0 again.

The code in that project is:

to start
forever [
 if 32 = ascii readchar [
  ifelse 0 = on-off 
   [t1, clickon]
   [t1, clickoff]
  seton-off 1 - on-off
 ]
]
end


Daniel
OpenWorld Learning

The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any other MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

   ---- File information -----------
     File:  Switch.mwx
     Date:  21 Aug 2007, 17:16
     Size:  2733 bytes.
     Type:  Unknown

Attachment: Switch.mwx
Description: Binary data


  • Previous by thread: MIA, Ask an Expert: action with keys
  • Next by thread: MIA, Ask an Expert: chase with keys

  • 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