[Thread Prev] [Thread Next]
Hi!
You cannot erase "parts" of other turtles. One (definitely not easy) option
consists of making each tetris piece using several turtles. One difficulty
is the "rotate" procedure, which is different for each piece.
The 2 by 2 square is easy to rotate. Nothing to do
to rotate2by2
end
The 1 by 4 bar could be:
to rotate1by4 :tname1 :tname2 :tname3 :tname4
ifelse vertical?
[gohorizontal]
[govertical]
end
Next proc moves the turtle1 20 steps to the left, turtle2 20 steps up,
turtle3 20 steps up and to the right, turtle 4 20 steps up ant 40 to the
right
to gohorizontal : tname1 :tname2 :tname3 :tname4
ask :tname1 [setx xcor - 20]
ask :tname2 [sety ycor - 20]
ask :tname3 [sety ycor - 20 setx xcor + 20]
ask :tname4 [sety ycor - 20 setx xcor + 40]
end
to govertical
...
...
end
Then, each time a piece moves down, you have to check if you have a full row
somewhere. For that, check how many turtles have a ycor of 0. If you have
10, kill that row. Then check how many have a ycor of 20. If you have 10
turtles there, etc.
I didn't test that. It's just a theory.
Good luck. Keep playing. Even if you don't make it to "full success", your
efforts will be worth... your efforts. That's always something.
Alain
-----Original Message-----
From: mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
[mailto:mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx]On Behalf Of
askanexpert@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Sent: October 10, 2007 8:50 AM
To: askanexpert@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: MIA, Ask an Expert: turtle as eraser
This is an automatic message sent from the web form at:
http://www.openworldlearning.org/mia/howdoi.htm
from: Doug Alexander <dalexander@xxxxxxxxxxxxxxxxx>
date: Wed Oct 10 06:49:35 2007
platform: Mac OS10
version: MicroWorlds Ex
How do I make a turtle turn into an eraser to erase parts of the
existing turtles? I'm trying to enhance the FallIntoPlace example
on the MicroWorlds site, but I need a way to erase lines and "drop"
the remaining turtles one row down. Not sure this is possible - help?
Previous by thread:
MIA, Ask an Expert: turtle as eraser
Next by thread:
RE: MIA, Ask an Expert:using powers
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.
|