[Thread Prev] [Thread Next]
7-9-07
Dear Alain,
Many thanks. This was the kind of procedure I envisioned, but
didn't know how to put in the correct syntax. We tried it today, and
did, in fact, play with the values, until we arrived at the
following, below. "To dribble" was in the onclick box of the
offensive basketball player/turtle dribbling the ball, and your
"getcloser" procedure was in the onclick box of the defensive
basketball player/turtle.
We added a colored box border around the edges of the screen, so
the players wouldn't disappear above and reappear below.
Would I assume that if we didn't want to have the players defying
the "law of gravity," could we also place parameters on the xcor and
the ycor, so the players couldn't go above the bleachers? Or we
could have them playing on a space station in zero G.
to dribble
t1, forever [fd random 50 wait 2 rt random 30]
forever [pt, fd 2 rt 1]
end
to getcloser
towards "t1
if (distance "t1) > 100 [fd 10 wait 1]
end
to bounce
rt 180
end
to start
t1, setpos [270 0]
t2, setpos [150 0]
everyone [clickon]
end
Anyway, thanks for the suggestion. It was right on target.
John Kendall
Previous by thread:
Re: Second Turtle following First Turtle, but from a Distance
Next by thread:
more interesting ideas from Edu-sig
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.
|