我正在尝试制作一个模型,当玩家到达球并决定携带它时,该模型涉及一只乌龟(球员)拿起一个球(如乌龟)。 任何相关的内置函数?
答案 0 :(得分:2)
使用tie
。
breed [balls ball]
breed [fetchers fetcher]
to setup
ca
create-balls 40 [
setxy random-xcor random-ycor
set shape "circle"
]
create-fetchers 1 [set size 2]
end
to go
ask fetchers [move]
end
to move ;turtle proc
set heading (heading - 45 + random 91)
fd 1
let _candidates balls-here
if any? _candidates [
create-link-with one-of _candidates [tie]
]
end