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: askanexpert@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: MIA, Ask an Expert
From: askanexpert@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 16 Jul 2007 17:00:05 -0600 (MDT)

This is an automatic message sent from the web form at:
http://mia.openworldlearning.org/mwforum.htm

from: Max <mnphilips@xxxxxxxxxxx>
date: Mon Jul 16 17:00:05 2007
platform: PC
version: MicroWorlds Ex

I am trying to make a Snake game where you move around to 
eat stuff.  When you eat the targets, you grow a segment.

However, I need help with setting up the game.  When I set 
the page with the gameplay on it up, I set one turtle to a 
specific position.  I need to set another turtle to a 
random position.  So finally, here's my question:

How do i make the second turtle go to a different place if 
its random placement lands it right on top of the first 
turtle?  Is there a way to use somewhat of a 'goto' and 
'label' combo?  I will write these in my code in quotes.

Here is my code: (xcoord and ycoord are text boxes)

to start
t1, setpos [-257 -152]
'label 1'
setxcoord random 18
setycoord random 12
setxcoord xcoord * 30
setycoord ycoord * 30
setxcoord 253 - xcoord
setycoord 178 - ycoord
t2, setpos (se xcoord ycoord)
'if touching? "t1 "t2 [goto 1]'
end 


  • Previous by thread: RE: MIA, Ask an Expert
  • Next by thread: Re: MIA, Ask an Expert

  • 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