to setup ; executed when we press the SETUP button ca ; clear all patches and turtles crt 1 ; create one turtle ask turtles [ set shape "man-standing" ; set its shape to the "man-standing" shape set heading 90 ; set its heading to 90 degrees, i.e. to the right ] end to go ; continuously executed since GO is a forever button if (velocity = 0) [stand] ; if velocity is 0, then execute STAND if (velocity = 1) [walk] ; if velocity is 1, then execute WALK if (velocity = 2) [running] ; if velocity is 2, then execute RUNNING end to stand ; WHEN THE MAN STANDS: ask turtles[ set shape "man-standing" ; if velocity=0, the man is standing wait 0.5 ] end to walk ; WHEN THE MAN WALKS: ask turtles [ ifelse (shape = "walking-right") ; if his shape is "walking-right" [set shape "walking-left"] ; then set it to "walking-left" [set shape "walking-right"] ; else set it to "walking-right" wait 0.5 fd 1 ; move forward ] end to running ; WHEN THE MAN RUNS: ask turtles[ ifelse (shape = "running-right") ; if his shape is "running-right" [set shape "running-left"] ; then set it to "running-left" [set shape "running-right"] ; else set it to "running-right" wait 0.2 fd 1 ; move forward ] end @#$#@#$#@ GRAPHICS-WINDOW 321 10 664 374 4 4 37.0 1 10 1 1 1 CC-WINDOW 12 166 309 341 Command Center BUTTON 76 66 131 99 Setup setup NIL 1 T OBSERVER BUTTON 147 66 202 99 Go go T 1 T OBSERVER SLIDER 77 114 202 147 velocity velocity 0 2 1 1 1 NIL @#$#@#$#@ WHAT IS IT? ----------- This code example shows how to use shapes to create animations. In this model, the moving turtle alternates between two shapes to give the impression of motion. To make your own shapes, press the SHAPES button on the right-hand side of the toolbar.You can create your own design or select from the existing shapes. @#$#@#$#@ default true 0 Polygon -7566196 true true 150 5 40 250 150 205 260 250 man-standing false 0 Circle -16776961 true false 112 23 75 Rectangle -16776961 true false 136 91 164 209 Polygon -16776961 true false 136 107 106 107 91 149 105 149 120 121 136 121 181 121 195 150 211 150 195 106 Polygon -16776961 true false 136 209 106 225 106 255 90 255 90 269 121 269 121 240 150 225 180 240 180 269 211 269 211 256 196 256 196 225 165 210 running-left false 0 Circle -16776961 true false 113 23 76 Rectangle -16776961 true false 136 91 164 209 Polygon -16776961 true false 137 209 121 240 121 269 150 270 150 256 133 255 151 210 165 255 165 271 194 271 194 257 179 256 162 208 running-right false 0 Circle -16776961 true false 160 40 72 Polygon -16776961 true false 181 105 150 120 136 165 136 195 165 195 165 165 181 119 195 105 Polygon -16776961 true false 137 195 121 225 121 239 121 255 150 255 150 240 134 240 135 224 150 195 137 195 Polygon -16776961 true false 165 194 181 225 181 240 210 240 210 226 195 226 166 179 Line -16776961 false 166 180 190 190 Line -16776961 false 164 180 192 192 Line -16776961 false 166 180 190 190 Line -16776961 false 164 180 191 191 Line -16776961 false 166 181 193 193 Line -16776961 false 165 191 181 181 Polygon -16776961 true false 172 135 195 165 225 150 215 141 195 151 176 124 Polygon -16776961 true false 151 121 128 110 106 134 116 139 129 124 148 131 151 121 walking-left false 0 Circle -16776961 true false 113 23 76 Rectangle -16776961 true false 136 91 164 209 Polygon -16776961 true false 137 209 121 240 121 269 150 270 150 256 133 255 151 210 165 255 165 271 194 271 194 257 179 256 162 208 walking-right false 0 Circle -16776961 true false 113 23 76 Rectangle -16776961 true false 136 91 164 209 Polygon -16776961 true false 136 209 122 238 122 269 151 269 151 255 136 255 137 240 150 209 179 239 179 254 210 254 210 240 196 240 163 209 136 209 136 209 Polygon -16776961 true false 135 105 105 105 91 150 105 150 121 120 180 120 195 135 225 105 211 105 196 120 181 105 @#$#@#$#@ NetLogo 2.0alpha1 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@