!!!---groupj1.nlogo

来自「NETLOGO」· NLOGO 代码 · 共 575 行 · 第 1/2 页

NLOGO
575
字号
breeds [owner dog]                            ;; the two breeds are owner and dogglobals [ level time_left]  to new                                      ;; Observer Button (starts a new game)  ca                                          set level 1  load-map  create-dog 1  ask dog [set shape "dog"   set size 2  set color brown]  create-owner 1  ask owner [set shape "person"  set size 2]  set time_left 20endto load-map                                ;; loads the three different maps  if (pickmap = 1 ) [load-map1]  if (pickmap = 2 ) [load-map2]    if (pickmap = 3 ) [load-map3]endto load-map1                                    ;; Observer Procedure (loads Ally's Maze)    import-world  "games/groupj1.csv"     endto load-map2                                    ;; Observer Procedure (loads Melanie's maze)    import-world  "games/groupj3.csv"     endto load-map3                                    ;; Observer Procedure (loads Dana's Maze)  import-world "games/groupj2.csv"  endto start                                    ;; sets the game up    ask dog[ setxy -9 9    set heading 180]    ask owner [ setxy 4 -4    set heading 180]           endto move   if (xcor = 4 and ycor = -4 ) [            ;;prints "You win" when you get to the owner and stops the game   print "YOU WIN!!!!!!!!!"   stop    ]   if pcolor-of patch-at dx dy = black       ;; looks to see if there is a walking (black) space and then moves forward            [  fd 1 ]endto move-up                                   ;;moves dog up    ask dog [    set heading 0    move ]endto move-left                                ;;moves dog left    ask dog [    set heading 270    move ]endto move-right                              ;;moves dog right    ask dog [    set heading 90    move ]endto move-down                                ;; moves dog down    ask dog [    set heading 180    move ]end@#$#@#$#@GRAPHICS-WINDOW32110772482101021.011001CC-WINDOW344488669607Command CenterBUTTON566411997NILnewNIL1TOBSERVERBUTTON1406620399NILstartNIL1TOBSERVERBUTTON101195189229NILmove-upNIL1TOBSERVERBUTTON49228139262NILmove-leftNIL1TOBSERVERBUTTON135227234261NILmove-rightNIL1TOBSERVERBUTTON94259200293NILmove-downNIL1TOBSERVERCHOICE84117222162pickmappickmap1 2 30TEXTBOX66328156358For Diretions See InfomationTEXTBOX861723747THE LOST LITTLE PUPPY@#$#@#$#@****************************************The Object****************************************The object of the game is to get the dog to it's owner.To get to it's owner the dog has to get though a maze.***************************************To Play***************************************To pick which level you use the drop down bar. After that, press "new" to bring up the maze. Then press "start".  Now go find your way through the maze to your owner using the move up, move down, move left and move right buttons. Once you reach your owner, the game will stop and the command center will stay "You Win!"@#$#@#$#@defaulttrue0Polygon -7566196 true true 150 5 40 250 150 205 260 250anttrue0Polygon -7566196 true true 136 61 129 46 144 30 119 45 124 60 114 82 97 37 132 10 93 36 111 84 127 105 172 105 189 84 208 35 171 11 202 35 204 37 186 82 177 60 180 44 159 32 170 44 165 60Polygon -7566196 true true 150 95 135 103 139 117 125 149 137 180 135 196 150 204 166 195 161 180 174 150 158 116 164 102Polygon -7566196 true true 149 186 128 197 114 232 134 270 149 282 166 270 185 232 171 195 149 186 149 186Polygon -7566196 true true 225 66 230 107 159 122 161 127 234 111 236 106Polygon -7566196 true true 78 58 99 116 139 123 137 128 95 119Polygon -7566196 true true 48 103 90 147 129 147 130 151 86 151Polygon -7566196 true true 65 224 92 171 134 160 135 164 95 175Polygon -7566196 true true 235 222 210 170 163 162 161 166 208 174Polygon -7566196 true true 249 107 211 147 168 147 168 150 213 150Polygon -7566196 true true 270 14Polygon -7566196 true true 276 21arrowtrue0Polygon -7566196 true true 150 0 0 150 105 150 105 293 195 293 195 150 300 150beetrue0Polygon -256 true false 151 152 137 77 105 67 89 67 66 74 48 85 36 100 24 116 14 134 0 151 15 167 22 182 40 206 58 220 82 226 105 226 134 222Polygon -16777216 true false 151 150 149 128 149 114 155 98 178 80 197 80 217 81 233 95 242 117 246 141 247 151 245 177 234 195 218 207 206 211 184 211 161 204 151 189 148 171Polygon -7566196 true true 246 151 241 119 240 96 250 81 261 78 275 87 282 103 277 115 287 121 299 150 286 180 277 189 283 197 281 210 270 222 256 222 243 212 242 192Polygon -16777216 true false 115 70 129 74 128 223 114 224Polygon -16777216 true false 89 67 74 71 74 224 89 225 89 67Polygon -16777216 true false 43 91 31 106 31 195 45 211Line -1 false 200 144 213 70Line -1 false 213 70 213 45Line -1 false 214 45 203 26Line -1 false 204 26 185 22Line -1 false 185 22 170 25Line -1 false 169 26 159 37Line -1 false 159 37 156 55Line -1 false 157 55 199 143Line -1 false 200 141 162 227Line -1 false 162 227 163 241Line -1 false 163 241 171 249Line -1 false 171 249 190 254Line -1 false 192 253 203 248Line -1 false 205 249 218 235Line -1 false 218 235 200 144bird1false0Polygon -7566196 true true 2 6 2 39 270 298 297 298 299 271 187 160 279 75 276 22 100 67 31 0

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?