[MWForum]Duplicating turtles for game levels
Wendy Petti
mwforum@lists.mathcats.com
Tue, 5 Aug 2003 00:37:58 -0400
The problem you've encountered is puzzling because procedures which include
turtle commands should indeed talk to the turtles on the active page. For
instance, if you never renamed turtles but kept the first turtle on each
page as "t1" then only the "t1" turtle on the active page will respond when
addressed by name. I double-checked just now on MW 2.03 and MW Pro on a PC
and had no trouble naming a turtle "car" on page1 and page2 and then
addressing the car turtle on page2. I am wondering if your students might
be making a very slight error in naming turtles, for example by including a
blank space after "car " - this does make a difference.
I would like to suggest an alternative to naming a turtle "car" on
successive pages. Is it possible to keep your game all on one page and
have the project load new background pictures as needed (to create more
difficult mazes, for instance) and/or have instruction textboxes pop up as
needed? You might even change the values on sliders under program control
when the player advances to a new level. You can make buttons and
obstacles appear or disappear as needed.
To save a background drawing as a picture file, type in the command center:
savepict "filename.gif
(The ".gif" is optional and does not work with all versions of MW for Mac
but it saves on file size.)
To load a saved picture file, include this command in a procedure:
loadpict "filename
However, this command will not work on a web-based project. If you wish to
post your projects on the web, they must be self-contained without any
extra picture files (even though they can include external sounds). An
alternate way to load a new background would be to save a picture as a
large shape and then have a turtle in the middle of the page put on this
shape, stamp itself, and then hide itself. You could change backgrounds
numerous times using this technique. Just be aware that large shapes do
add considerably to a project's file size.
Wendy Petti
OWL's MicroWorlds in Action
http://mia.openworldlearning.org
Math Cats
http://www.mathcats.com
> -----Original Message-----
> From: mwforum-admin@lists.mathcats.com
> [mailto:mwforum-admin@lists.mathcats.com]On Behalf Of LRichter99@aol.com
> Sent: Monday, August 04, 2003 11:50 PM
> To: mwforum@lists.mathcats.com
> Subject: [MWForum]Duplicating turtles for game levels
>
>
> I've several kids in my classes that want to design "levels" to
> their games. Basically, this means that when their player has
> accomplished the goal on one page, they take him to a new one
> where the action continues with a similar challenge...just a bit
> more difficult/complex.
>
> My question has to do with the turtles...and particularly their
> names and the procedures which affect them. MicroWorlds allows
> you to create multiple pages which contain the same turtle
> (names). This is what we'd like, of course, because the core of
> the game logic will be used across pages (our "levels").
> However, we've run into difficulty. Understandably so, I
> suppose. For example, how is MicroWorlds to know which of the
> CAR turtles it should work on when there's one on page1 and
> page2? My assumption would be that it would affect the one on
> the active page only. But this doesn't appear to be correct. MW
> appears to be ignoring the turtles on the second page.
>
> Is there something we're missing? Is it even possible to have
> two turtles (with the same name) on separate pages utilizing the
> same code? If not, could you share any tricks to get this
> concept working without duplicating code? (On option would be
> to use variable input to the procedures and pass in the turtle
> name, but even this would require reworking what they've already
> designed and tested.)
>
> Thanks a million for any suggestions.
>
> Lisa Richter
> Cosmic Thinkers in Laguna Beach, CA
> Lisa@CosmicThinkers.com
> _______________________________________________
> MWForum mailing list
> MWForum@lists.mathcats.com
> http://lists.mathcats.com/mailman/listinfo/mwforum
> attachments archived at:
> http://www.mathcats.com/mwforum/attachments.html
>