breed [Agricultores Agricultor]
turtles-own [energy edad]
to Configuracion
clear-all
ask patches [ set pcolor green ]
create-turtles poblacion
create-agricultores 2
ask turtles[
set shape "wolf"
set color red
setxy random-xcor random-ycor
]
ask agricultores
[
set shape "person"
set color white
setxy random-xcor random-ycor
]
end
to Iniciar
mover-turtles
mover-Agricultores
end
to mover-turtles
ask turtles
[
right random 360
forward 1
set energy energy - 1
set edad edad + 1
if pcolor = green [
set pcolor black
set energy (energy + 3)
]
if energy < 0 [ die ]
if edad = 43 [ die ]
]
end
to mover-Agricultores
ask Agricultores
[
right random 360
if pcolor = black [
set pcolor green
forward 1
]
]
end
No hay comentarios:
Publicar un comentario