I am trying to ask turtles to move along the path that I set please see pic below:
I want people walking alone the pink path one by one (like in a queue). here's my piece of code:
;;set paths where people walk in a queue
ask patches with [ pycor = -12 and pxcor >= 3 and pxcor <= 45 and pzcor = 0]
[ set path 1
set pcolor pink
]
ask patches with [ pycor = -12 and pxcor >= -45 and pxcor <= -3 and pzcor = 0]
[ set path 1
set pcolor pink
]
ask patches with [ pycor <= 12 and pycor >= -12 and pxcor = -45 and pzcor = 0]
[ set path 1
set pcolor pink
]
to go
ask turtles [
queue
]
tick
end
to queue
face one-of patches with [path = 1]
ifelse [path] of patch-ahead 1 = 1
[set heading heading - 180 fd 1]
[fd 1]
end
But this code won't give me the result as people only walking along the pink path one by one. Could anyone help me with this please? Thanks in advance!