2016-12-01 95 views
0

我开始与Netlogo一起开发,我面临的问题是我想让所有的海龟都以黑色移动。我怎样才能做到这一点 ?我尝试了补丁提前但我没有成功。 任何人都有解决方案?我会很感激。如何让海龟在Netlogo中以一种颜色移动

to setup 


clear-all 
    import-drawing "patch.png" 
    create-turtles 10 [set xcor -10 set ycor -13] 
    ask turtles [set color white] 
    ask turtles [set shape "bug"] 
    reset-ticks 
end 




to bouge 
    ask turtles[ 

fd 1 
] 


end 

to go 
    bouge 
ask turtles [if [pcolor] of patch-ahead 6 != black [set heading heading - 100] ] 



end 

enter image description here

+0

import-drawing“patch.png”不会更改pcolor值,请改为使用“import-pcolors”patch.png“'。 – Marzy

+0

@Marzy对不起,迟到的答案!非常感谢,它真的工作:) – Anouar

回答

0

你应该使用的类似:

设置黑补丁的补丁与[令pColor =黑色]

问龟[ 脸一黑,补丁 ]

Bests,Ervin

相关问题