[Thread Prev] [Thread Next]
On 30 Apr 2006 at 12:15, Nadia Bluhm wrote:
> Is there any easy way to run different procedures at different times
> using the OnTic in the turtles backpack. I know you can put a value in
> the OnTic and run a procedure every so many 1/10th of a second, but
> what if you want to run different procedures at different times?
> thanks in advance, Nadia
This is my first attempt to send, not a project, but a single turtle as
attachment. We can do that with EX.
For all those that don't have EX here is the code:
The turtle has this private variable:
It has this code when the user clicks on it once:
And it has this code as it's OnTick instruction:
OnTick 2/10 second
The private procedure is:
if 0 = remainder time 10 [rt 90]
if 0 = remainder time 30 [bk 20]
settime time + 1
The variable "time" is incremented every 2 tenths
of a second.
When "time" is 0
remainder time 10
is 0 so rt 90 is run. That will not happen
when time = 1,2,3,4,5,6,7,8 and 9
remainder 10 10
is 0 again, that is when "rt 90" will run again.
Description: Binary data
Previous by thread:
MicroWorlds EX OnTic field in turtle's backback
Next by thread:
Re: MicroWorlds EX OnTic field in turtle's backback
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.