globals [ g ; gravity constant (for gibbets) kills ;; number of player kills shots ;; number of player shots fired hits ;; number of shots that hit misses ;; number of shots that missed speed ;; overall zombie speed counter ;; counter for level advancement level ;; current game level / wave score ; current score gun-type ;; the type of gun/bullet pattern barrier ;; the patches that contain the barrier game-over? ;; is the gamve over? tocks ;; occur every 5 ticks crosshairs ;; the turtle that is the crosshair gun ;; the turtle that is the gun bullet ;; fire? ;; has the fire button been pressed (or, with auto, is it time to fire?) full-auto? ;; is full auto mode on? target ;; the thing that is the current gun target point-blank ;; the xcoord beyond which damage is 8 mid-range ;; the xcoord beyond which damage is 4 long-range ;; the xcoord beyond which damage is 2 truck! ;; keeps track of the last appearance of the zombie truck mid-pxcor mid-pycor fire-rate message msg-row messenger ] breed [ bullets a-bullet ] breed [ zombies a-zombie ] breed [ trucks truck ] breed [ giants giant ] breed [ trees a-tree ] breed [ guns a-gun ] breed [ gibbets a-gibbet ] breed [ new-gibbets ] breed [ hairs a-hair ] breed [ messengers a-messanger ] gibbets-own [ vx vy ttl burning? ] guns-own [ base-shape ] zombies-own [ pace ;; how fast this particular zombie moves integrity ;; the current physical integrity of the zombie--at zero, zombie disintegrates frame ;; the current animation frame of this zombie base-shape ;; the base of the shape name for this zombie bonus ;; the score bonus obtained from killing this zombie sub-breed ;; the sub-breed of this zombie (zombie, giant, trucks) inflammable? ;; can this zombie burn? burning? ;; is this zombie currently burning? ] to startup setup end ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. to setup ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. display clear-all setup-background setup-default-shapes setup-globals setup-barrier setup-gun-and-bullet setup-trees setup-crosshair setup-messenger zombie-birth end to setup-gun-and-bullet ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ask patch (min-pxcor + 5) 0 [ sprout-guns 1 [ set gun self set color gray set heading 90 set size 5 set base-shape "gun" hatch-bullets 1 [ set bullet self set shape "line" set size world-width set color white __set-line-thickness .2 hide-turtle ] ] ] end to setup-trees ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. let row max-pycor repeat world-height [ ask patches with [ pycor = row and pxcor > min-pxcor + 5 and random 10 < 5 and (min-pxcor + random world-width ) < pxcor ] [ sprout-trees 1 [ set shape "tree" set size 3 stamp if random 10 > 2 [ die ] set shape "tree-top" ] ] set row row - 1 ] end to setup-crosshair ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. create-hairs 1 [ set crosshairs self set color white set heading 0 set size 3 home ] end to setup-messenger create-messengers 1 [ set messenger self set shape "default" set size 0 set color black set label "" setxy 0 max-pycor ] end to setup-default-shapes ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. set-default-shape zombies "zombie0" set-default-shape guns "gun" set-default-shape gibbets "gibbet" set-default-shape bullets "bullet" set-default-shape hairs "cross-hair" end to setup-globals ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. set g -0.03 ;; gravity constant set game-over? false ;; game over flag set kills 0 set counter 1 set speed .1 set level 0 set gun-type 0 ; set ticks 0 set tocks random 5 set full-auto? false set long-range min-pxcor + world-width * .5 set mid-range min-pxcor + world-width * .25 set point-blank min-pxcor + world-width * .125 set truck! 0 set full-auto? false set mid-pxcor min-pxcor + world-width * .5 set mid-pycor min-pycor + world-height * .5 set fire-rate 5 set message "STOP THE ZOMBIES!" set msg-row max-pycor end ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. to go ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ; if game-over? = true [ display stop ] every ( 1 / 60 ) [ no-display advance-clock display-messages ifelse not game-over? [ aim fire if ticks mod 100 = 0 [ barrier-repair ] ] [ if not any? zombies and not any? gibbets [ stop ] ] zombies-move gibbets-fly ; bullets-fly display ] end to aim ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ifelse full-auto? [ ifelse any? zombies with [ pxcor < (max-pxcor - 5) ] [ if not is-a-zombie? target or random-float 1.0 < 0.05 [ let targets (zombies with [ pxcor < (max-pxcor - 5) ]) ifelse any? targets with [ not burning? ] [ set target min-one-of targets with [ not burning? ] [ distance gun ] ] [ set target min-one-of targets [ distance gun ] ] ] if is-a-zombie? target [ ask crosshairs [ setxy (.6 * xcor + .4 * [ xcor ] of target) (.6 * ycor + .4 * [ ycor ] of target )] ] ] [ if not is-a-zombie? target [ ask crosshairs [ setxy (.8 * xcor + .2 * mid-pxcor) ( .8 * ycor + .2 * ( mid-pycor + world-height * .4 * sin (3 * ticks) )) ] ] ] ask gun [ face crosshairs ] ask bullet [ set heading [ heading ] of gun ] ] [ if mouse-inside? [ let mx mouse-xcor let my mouse-ycor ask crosshairs [ setxy mx my ask gun [ face myself ;ifelse pycor < [pycor] of myself ;[ set ycor ycor + .5 ] ;[ if pycor > [pycor] of myself ; [ set ycor ycor - .5 ] ;] ] ask bullet [ set heading [ heading ] of gun ] ] ] ] set fire? mouse-down? or (full-auto? and is-a-zombie? target ) end to fire ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ifelse ticks mod fire-rate = 0 and fire? [ ask bullet [ show-turtle ] ask gun [ set shape (word base-shape "-fire") set shots shots + 1 let hit min-one-of zombies with [ abs subtract-headings (safe-towards myself ) (180 + [heading] of myself ) < 2 ] [ distance myself ] ifelse is-a-zombie? hit [ set hits hits + 1 ask bullet [ set size distance hit ] ask hit [ zombie-injury ] ] [ set misses misses + 1 ask bullet [ set size world-width ] ] ] ] [ ask bullet [ hide-turtle ] ask gun [ if shape != base-shape [ set shape base-shape ] ] ] end to-report safe-towards [ agent ] ifelse patch-here = [ patch-here ] of agent [ report 0 ] [ report towards agent ] end ;;; ;;; Previous fire routine, when gun fired individual pellets, in various patterns ;;;to fire ;;; ask gun ;;; [ ;;; ifelse gun-type = -1 [ make-bullets 1 0 0 0 0 ] ;;; [ ifelse gun-type = 0 [ make-bullets 2 0 0 -.5 1 ] ;;; [ ifelse gun-type = 1 [ make-bullets 3 0 0 -1 1 ] ;;; [ ifelse gun-type = 2 [ make-bullets 3 -5 5 0 0 ] ;;; [ ifelse gun-type = 3 [ make-bullets 4 0 0 -2 1.25 ] ;;; [ ifelse gun-type = 4 [ make-bullets 5 -20 10 0 0 ] ;;; [ ifelse gun-type = 5 [ make-bullets 5 0 0 -4 2 ] ;;; [ ifelse gun-type = 6 [ make-bullets 7 -15 5 -3 1 ] ;;; [ make-bullets 7 -15 5 -6 2 ] ;;; ]]]]]]] ;;; ] ;;;end to bullets-fly ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ask bullets [ if not can-move? 1 [ die ] jump 1 let targets (zombies-on neighbors) with [ abs (pxcor - [pxcor] of myself) < 1.5 and abs (pycor - [pycor] of myself) < 3 ] if any? targets [ ask one-of targets [ zombie-injury ] die ] ] end to gibbets-fly ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ask gibbets [ set ttl ttl - 1 if ttl <= 0 [ die ] set vy vy + g let nx xcor + vx let ny ycor + vy if nx < min-pxcor or nx > max-pxcor or ny < min-pycor or ny > max-pycor [ die ] setxy nx ny rt 10 ] end to gibbets-birth [ qty looks new-size] ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. hatch-gibbets qty [ gibbet-props ifelse looks = "" [ ifelse burning? [ set color orange ] [ set color red ] ] [ set shape looks ] set size new-size ] end to gibbet-props ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. set vx -.3 + random-float 2.0 set vy random-float .5 set ttl 20 set label "" end to zombies-move ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. if ticks mod 2 != 0 [ stop ] ;; make new zombies if game-over? != true and count zombies < 35 and random 100 <= counter [ zombie-birth ] ask zombies [ ;; if random 100 <= counter [ face one-of guns ] if not is-patch? patch-ahead 1 [ zombie-death ] if not ( any? (zombies-on patch-ahead 1) with [ self != myself ] or any? zombies-here with [ who < [who] of myself ] ) [ if sub-breed = trucks [ stamp-erase ] if sub-breed = giants [ ask trees in-radius (size * .5) [ die ] ] jump pace ] set frame frame + .5 if frame >= 4 [ set frame 0 if burning? [ set integrity integrity - 1 ask zombies in-radius ( size ) [ zombie-start-burning ] if integrity <= 0 [ update-counters zombie-death ] ] ] set shape (word base-shape floor frame) if shade-of? pcolor barrier-base-color [ let rad size * .5 if burning? [ set rad size ] ask barrier in-radius rad [ set pcolor background-color ] zombie-death ] if pxcor <= min-pxcor [ zombie-death ] ] ;; set label integrity end to zombie-birth ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. let birth-patches patches with [ pxcor = max-pxcor and pycor < max-pycor - 5 and pycor > min-pycor + 5 ] if any? birth-patches with [ not any? zombies-here ] [ ask one-of birth-patches with [ not any? zombies-here ] [ sprout-zombies 1 [ set heading 270 set color green + level * 10 - 1 + random-float 2 set size 3 set frame 0 set pace speed + random .1 set integrity 1 + int (level * .1) set base-shape "zombie" set bonus 0 set sub-breed zombies set burning? false set inflammable? true if random 100 < 5 + level [ set pace 1 set color color - color mod 10 + 8 set integrity 1 + int (.25 * integrity) ] if any? barrier with [ shade-of? pcolor barrier-base-color ] [ face one-of barrier with [ shade-of? pcolor barrier-base-color ] ] ;; giants!! ifelse level >= 10 and random 100 < 2 [ set size size * 3 set pace .1 + pace * .1 set integrity integrity * 10 set bonus 1000 set sub-breed giants set base-shape "zombie" set message "ALERT! GIANT MUTANT ZOMBIE!" ][ if truck! < level and (level mod 4 = 0 or level > 20) [ set heading 270 set truck! level set base-shape "truck" set size size * 2 set pace .1 set integrity integrity * 50 set bonus 3000 set sub-breed trucks set burning? false set inflammable? false ;; trucks don't burn set message "ALERT! TRACTOR RIDING ZOMBIE!" ]] ] ] ] end to zombie-injury ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. let damage 0 if gun-type = 1 [ zombie-start-burning ] set damage damage-by-range set integrity integrity - damage ifelse integrity <= 0 [ update-counters zombie-death ] [ gibbets-birth damage "" (1 + random-float 1.0) ] if xcor + .5 < max-pxcor [ set xcor xcor + .5 ] end to zombie-start-burning if inflammable? and not burning? [ set burning? true set base-shape (word base-shape "-burning" ) ] end to-report damage-by-range ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ifelse pxcor < point-blank [ report 8 ][ ifelse pxcor < mid-range [ report 4 ][ ifelse pxcor < long-range [ report 2 ][ report 1]]] end to zombie-death ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. let gc count gibbets + count zombies ;; gibbet-count ;; ngc = new gibbet count let ngc ifelse-value ( gc < 100 ) [ 5 ] [ 0 ] let ngs 1 set base-shape remove "-burning" base-shape if gc < 175 [ gibbets-birth 1 (word base-shape "-part0") size ] if gc < 150 [ let index 1 repeat 4 [ gibbets-birth 1 (word base-shape "-part" index) size set index index + 1 ] ] ifelse gc < 50 [ gibbets-birth 10 "" (1 + random-float 1.0) ] [ if gc < 100 [ gibbets-birth 5 "" (1 + random-float 1.0) ] ] if not any? barrier with [ shade-of? pcolor blue ] [ game-over ] die end to make-bullets [ qty offset spread y-off y-inc ] ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. set offset heading + offset hatch-bullets qty [ jump 2.5 set heading offset let nx xcor + y-off * sin ( heading - 90) let ny ycor + y-off * cos ( heading - 90) set offset offset + spread set y-off y-off + y-inc if nx < min-pxcor or ny < min-pycor or ny > max-pycor [ die ] setxy nx ny set color 8 + 10 * random 13 ] end ;to update-score [ amt ] ;;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ; set score score + amt ; ; set [plabel] of scoreboard (word score ":" level ) ;end to update-counters ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. set kills kills + 1 set score score + level + bonus set counter counter + 1 if counter >= 100 [ set counter counter - 100 set speed speed * 1.03 if speed > .5 [ set speed .1 ] set level level + 1 ifelse gun-type = 0 [ if fire-rate > 2 and level mod 5 = 0 [ set message "RELOAD RATE UPGRADE!" set fire-rate fire-rate - 1 ] if level >= 20 [ set gun-type 1 ask bullet [ set color red ] ask gun [ set base-shape "gun1" ] set fire-rate 6 set message "WEAPON UPGRADE!" ] ] [ if fire-rate > 1 and level mod 5 = 0 [ set fire-rate fire-rate - 1 __set-line-thickness .1 * fire-rate set message "BEAM REFRESH UPGRADE!" ] ] ] end to game-over ask crosshairs [ home ] set message "GAME OVER!" set game-over? true end to setup-background ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ask patches [ set pcolor background-color ] end to-report background-color ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ;; reports a textured background color for the current patch, based on patch location, etc. report brown - 5 + .1 * random 5 + 6 * ((pycor - min-pycor) / world-height) ; end to setup-barrier ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ;; defines and colors the patches that comprise the barrier set barrier patches with [ pxcor <= min-pxcor + 5 ] ask barrier [ set pcolor barrier-color ] end to-report barrier-color ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ;; reports the barrier color for the current patch report barrier-base-color - 3 + pxcor - min-pxcor + ((pycor + pxcor) mod 2) end to-report barrier-base-color ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ;; reports the barrier base color ;; hack--for better speed should really be a global report blue end to barrier-repair ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ;; if barrier needs repair, repair one cell of the barrier if any? barrier with [ not shade-of? pcolor barrier-base-color ] [ ask one-of barrier with [not shade-of? pcolor barrier-base-color and any? neighbors4 with [ shade-of? pcolor barrier-base-color ] ] [ set pcolor barrier-color ] ] end to advance-clock ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. tick end to auto-fire ;; ~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸.~º°¯°º~.¸_¸. ;; toggle / initialize if needed, the full-auto variable set full-auto? (full-auto? = false) let state "DE-" if full-auto? [ set state "" ] set message (word "AUTO-FIRE " state "ACTIVATED") end to display-messages if message != "" [ set msg-row msg-row - .5 if msg-row <= min-pycor [ set message "" set msg-row max-pycor ] ask messenger [ set ycor msg-row set label message ] ] end @#$#@#$#@ GRAPHICS-WINDOW 10 60 913 507 37 17 11.91 1 20 1 1 1 0 0 0 1 -37 37 -17 17 1 0 0 ticks CC-WINDOW 5 521 929 616 Command Center 0 TEXTBOX 10 15 920 60 Directions: Shoot zombies before they reach the blue barrier. \nClick GO to play. Aim and fire with mouse. Click reset to start over.\nClick AUTO-FIRE to toggle automatic firing mode. Weapon upgrade at level 20. 11 0.0 BUTTON 855 10 910 55 reset setup NIL 1 T OBSERVER NIL R NIL NIL BUTTON 490 10 545 55 NIL go T 1 T OBSERVER NIL G NIL NIL BUTTON 788 10 843 55 NIL auto-fire NIL 1 T OBSERVER NIL A NIL NIL MONITOR 625 10 694 55 NIL Score 3 1 11 MONITOR 560 10 610 55 Days level 0 1 11 MONITOR 710 10 774 55 Accuracy (word \n (ifelse-value (hits = 0) [ \"\" ][precision (100 * hits / shots) 0 ])\n \"%\"\n ) 3 1 11 @#$#@#$#@ WHAT IS IT? ----------- Defend the city gate barricade from the ZOMBIE HOARDS! HOW TO USE IT ------------- Click Setup, then Go. Aim with the mouse. Shoot by pressing the mouse button. When zombies hit a bullet or the wall, they are injured. If injured enough, they disintegrate! Zombies damage the wall when they hit it. Burning zombies damage the wall even more. As long as even one brick of the barricade remains, the city is safe. Unseen helpers repair damage to the barricade, slowly, but as fast as they can! Watch out for surprises the zombies may have for you! In 20 days, you will receive a new laser gun from a neighboring city! THINGS TO NOTICE ---------------- The gun, bullets, zombies, and even the gobs of gore are all kinds of turtles. Zombies are sometimes hidden behind the trees. Background trees are tree shapes stamped into the drawing layer. Forground trees are tree turtles. As the invasion continues, the zombies attack in waves, attack more quickly, and become tougher to destroy. Now aDifferent kinds of zombies appear from time to time. As long as even one brick of the barricade remains, the city is safe. Unseen helpers repair damage to the barricade, slowly, but as fast as they can! WAYS TO EXTEND THE MODEL ------------------------ Add more kind of zombies Add different kinds of weapons Add the ability to build barricades that the zombies must navigate COPYRIGHT --------- Copyright © 2007, James P. Steiner @#$#@#$#@ default true 3 Polygon -13840069 true false 75 255 30 225 45 225 45 210 60 210 60 195 90 240 Polygon -6459832 true true 120 60 180 60 210 75 225 105 225 210 210 240 180 255 120 255 90 240 75 210 75 120 90 75 120 60 120 90 180 90 105 210 120 225 195 105 195 210 180 225 120 225 105 210 105 105 120 90 Polygon -13840069 true false 135 255 150 270 135 300 165 270 165 255 Polygon -13840069 true false 225 255 270 225 255 225 255 210 240 210 240 195 210 240 Polygon -13840069 true false 225 90 270 60 255 60 255 45 240 45 240 30 210 75 Polygon -13840069 true false 75 90 30 60 45 60 45 45 60 45 60 30 90 75 Polygon -10899396 true false 105 210 105 105 120 90 180 90 Polygon -10899396 true false 120 225 195 105 195 210 180 225 Polygon -13840069 true false 135 60 120 30 135 0 150 -15 165 0 180 30 165 60 link true 0 Line -7500403 true 150 0 150 300 link direction true 0 Line -7500403 true 150 150 30 225 Line -7500403 true 150 150 270 225 bullet false 0 Circle -7500403 true true 135 135 30 cross-hair false 0 Circle -7500403 false true 15 0 270 Circle -7500403 false true 0 15 270 Circle -7500403 false true 15 30 270 Circle -7500403 false true 30 15 270 Line -7500403 true 150 30 150 75 Line -7500403 true 30 150 75 150 Line -7500403 true 150 270 150 225 Line -7500403 true 270 150 225 150 gibbet false 0 Circle -7500403 true true 105 105 90 gun true 0 Rectangle -7500403 true true 135 0 165 120 Rectangle -16777216 false false 135 0 165 120 Circle -7500403 true true 105 105 90 Circle -16777216 false false 105 105 90 Circle -7500403 true true 45 105 90 Circle -7500403 true true 165 105 90 Circle -16777216 false false 45 105 90 Circle -16777216 false false 165 105 90 gun-fire true 0 Circle -1184463 true false 45 -105 210 Circle -1 true false 75 -75 150 Rectangle -7500403 true true 135 0 165 120 Rectangle -16777216 false false 135 0 165 120 Polygon -2674135 true false 120 0 60 -15 120 -15 60 -60 120 -30 105 -90 135 -30 150 -120 165 -30 180 -90 180 -30 240 -60 195 -15 255 -15 180 0 Circle -7500403 true true 105 105 90 Circle -16777216 false false 105 105 90 Circle -7500403 true true 45 105 90 Circle -7500403 true true 165 105 90 Circle -16777216 false false 45 105 90 Circle -16777216 false false 165 105 90 gun1 true 0 Circle -7500403 true true 120 240 60 Circle -16777216 false false 120 240 60 Circle -7500403 true true 105 180 90 Circle -16777216 false false 105 180 90 Rectangle -7500403 true true 135 0 165 120 Rectangle -16777216 false false 135 0 165 120 Circle -7500403 true true 75 75 150 Rectangle -1184463 true false 120 15 180 30 Rectangle -955883 true false 90 45 210 60 Circle -16777216 false false 75 75 150 Polygon -5825686 true false 165 105 120 150 150 165 135 195 180 150 150 135 Rectangle -2674135 true false 105 75 195 90 gun1-fire true 0 Circle -7500403 true true 120 240 60 Circle -16777216 false false 120 240 60 Circle -7500403 true true 105 180 90 Circle -16777216 false false 105 180 90 Circle -11221820 true false 15 -135 270 Circle -13791810 true false 45 -105 210 Rectangle -7500403 true true 135 0 165 120 Rectangle -16777216 false false 135 0 165 120 Circle -7500403 true true 75 75 150 Circle -16777216 false false 75 75 150 Rectangle -1184463 true false 120 15 180 30 Rectangle -955883 true false 90 45 210 60 Rectangle -2674135 true false 105 75 195 90 Polygon -5825686 true false 165 105 120 150 150 165 135 195 180 150 150 135 Polygon -2674135 true false 135 -150 105 -165 135 -120 90 -105 135 -90 105 -60 135 -60 75 -15 135 15 165 15 225 -15 165 -60 195 -60 165 -90 210 -105 165 -120 195 -165 165 -150 line true 0 Line -7500403 true 150 -150 150 150 tree false 0 Polygon -6459832 true false 90 210 120 255 120 300 75 315 150 300 150 315 165 300 210 315 165 285 165 240 225 210 165 225 210 180 225 150 165 195 135 120 135 225 90 180 45 120 Circle -10899396 true false 20 5 170 Circle -13840069 true false 75 75 120 Circle -13840069 true false 30 -45 150 Circle -10899396 true false 138 -12 175 Polygon -6459832 true false 75 15 120 120 105 135 Polygon -6459832 true false 165 120 240 30 180 135 tree-top false 0 Circle -10899396 true false 20 5 170 Circle -13840069 true false 75 75 120 Circle -13840069 true false 30 -45 150 Circle -10899396 true false 138 -12 175 Polygon -6459832 true false 75 15 120 120 105 135 Polygon -6459832 true false 165 120 240 30 180 135 truck-part0 true 0 Polygon -7500403 true true 194 130 203 142 164 158 161 176 193 209 181 217 152 188 124 222 112 212 143 175 144 157 106 141 111 127 146 143 161 146 Circle -7500403 true true 140 105 26 Circle -16777216 true false 145 111 6 Circle -16777216 true false 154 111 8 Polygon -16777216 true false 144 126 148 119 155 120 159 126 truck-part1 true 0 Rectangle -1 false false 90 180 120 225 Rectangle -2674135 true false 75 105 240 195 Rectangle -1 true false 75 120 120 135 Rectangle -16777216 true false 75 135 165 165 truck-part2 false 0 Circle -16777216 true false 120 120 60 Circle -1 false false 120 120 60 Circle -1 true false 135 135 30 truck-part3 false 0 Circle -16777216 true false 90 90 120 Circle -1 false false 90 90 120 Circle -1 true false 135 135 30 truck-part4 true 0 Polygon -2674135 true false 90 255 90 165 120 60 210 60 225 225 210 210 180 195 150 195 120 210 90 255 90 165 195 165 195 75 135 75 120 165 90 165 truck0 false 0 Circle -7500403 true true 219 69 42 Rectangle -7500403 true true 225 120 255 150 Rectangle -1 false false 15 210 45 255 Circle -16777216 true false 180 180 120 Rectangle -2674135 true false 0 135 165 225 Circle -16777216 true false 0 240 60 Circle -1 false false 0 240 60 Circle -1 false false 180 180 120 Circle -1 true false 225 225 30 Rectangle -1 true false 0 150 45 165 Rectangle -16777216 true false 15 165 105 195 Polygon -2674135 true false 165 225 165 135 195 30 285 30 300 195 285 180 255 165 225 165 195 180 165 225 165 135 270 135 270 45 210 45 195 135 165 135 Circle -16777216 true false 236 79 12 Circle -16777216 true false 222 79 12 Polygon -16777216 true false 225 104 234 96 248 104 234 102 Polygon -16777216 true false 243 106 244 95 254 93 248 99 Circle -1 true false 15 255 30 truck1 false 0 Circle -7500403 true true 219 69 42 Rectangle -7500403 true true 225 120 255 150 Rectangle -1 false false 15 210 45 255 Circle -16777216 true false 180 180 120 Rectangle -2674135 true false 0 138 165 228 Circle -16777216 true false 0 240 60 Circle -1 false false 0 240 60 Circle -1 false false 180 180 120 Circle -1 true false 225 225 30 Rectangle -1 true false 1 153 46 168 Rectangle -16777216 true false 15 169 105 199 Polygon -2674135 true false 165 229 165 139 195 34 285 34 300 199 285 184 255 169 225 169 195 184 165 229 165 139 270 139 270 49 210 49 195 139 165 139 Circle -16777216 true false 236 79 12 Circle -16777216 true false 222 79 12 Polygon -16777216 true false 225 104 234 96 248 104 234 102 Polygon -16777216 true false 243 106 244 95 254 93 248 99 Circle -1 true false 15 255 30 truck2 false 0 Circle -7500403 true true 219 69 42 Rectangle -7500403 true true 225 120 255 150 Rectangle -1 false false 15 210 45 255 Circle -16777216 true false 180 180 120 Rectangle -2674135 true false -1 132 164 222 Circle -16777216 true false 0 240 60 Circle -1 false false 0 240 60 Circle -1 false false 180 180 120 Circle -1 true false 225 225 30 Rectangle -1 true false 0 143 45 158 Rectangle -16777216 true false 15 160 105 190 Polygon -2674135 true false 165 222 165 132 195 27 285 27 300 192 285 177 255 162 225 162 195 177 165 222 165 132 270 132 270 42 210 42 195 132 165 132 Circle -16777216 true false 236 79 12 Circle -16777216 true false 222 79 12 Polygon -16777216 true false 225 104 234 96 248 104 234 102 Polygon -16777216 true false 243 106 244 95 254 93 248 99 Circle -1 true false 15 255 30 truck3 false 0 Circle -7500403 true true 219 69 42 Rectangle -7500403 true true 225 120 255 150 Rectangle -1 false false 15 210 45 255 Circle -16777216 true false 180 180 120 Rectangle -2674135 true false 0 135 165 225 Circle -16777216 true false 0 240 60 Circle -1 false false 0 240 60 Circle -1 false false 180 180 120 Circle -1 true false 225 225 30 Rectangle -1 true false 0 150 45 165 Rectangle -16777216 true false 15 165 105 195 Polygon -2674135 true false 165 225 165 135 195 30 285 30 300 195 285 180 255 165 225 165 195 180 165 225 165 135 270 135 270 45 210 45 195 135 165 135 Circle -16777216 true false 236 79 12 Circle -16777216 true false 222 79 12 Polygon -16777216 true false 225 104 234 96 248 104 234 102 Polygon -16777216 true false 243 106 244 95 254 93 248 99 Circle -1 true false 15 255 30 zombie-burning0 false 0 Circle -7500403 true true 103 15 90 Polygon -7500403 true true 45 75 150 90 180 105 180 180 210 285 165 300 150 210 135 300 90 285 120 195 120 150 30 150 30 120 120 120 45 105 Polygon -16777216 true false 165 60 149 70 150 90 Polygon -16777216 true false 105 60 118 70 120 90 Circle -16777216 true false 108 36 18 Circle -16777216 true false 134 37 18 Polygon -16777216 true false 122 87 122 72 134 70 142 75 143 90 133 81 Polygon -955883 true false 105 45 60 -45 105 15 90 -45 135 -15 150 -75 165 -15 210 -60 195 45 135 30 Polygon -1184463 true false 150 105 105 75 75 75 60 45 45 75 75 90 Polygon -1184463 true false 120 120 90 105 75 120 45 105 30 120 75 135 Polygon -2674135 true false 165 105 180 60 180 135 225 90 180 180 225 135 195 225 240 195 210 270 180 255 195 255 165 210 180 210 150 150 165 150 150 90 zombie-burning1 false 0 Circle -7500403 true true 103 15 90 Polygon -7500403 true true 45 75 150 90 180 105 180 180 195 285 150 300 150 210 150 300 105 285 120 195 120 150 30 150 30 120 120 120 45 105 Polygon -16777216 true false 165 60 149 70 150 90 Polygon -16777216 true false 105 60 118 70 120 90 Circle -16777216 true false 108 36 18 Circle -16777216 true false 134 37 18 Polygon -16777216 true false 122 87 122 72 134 70 142 75 143 90 133 81 Polygon -955883 true false 120 45 90 15 120 30 90 -75 135 15 165 -45 165 15 210 -45 195 45 150 30 Polygon -2674135 true false 180 285 210 270 240 210 210 240 210 195 195 210 195 165 180 195 150 135 165 210 120 195 180 255 120 225 Polygon -1184463 true false 30 135 15 105 45 135 45 105 75 135 90 105 90 135 135 120 120 150 Polygon -1184463 true false 45 90 30 60 60 90 75 60 90 90 150 90 135 105 zombie-burning2 false 0 Circle -7500403 true true 118 15 90 Polygon -7500403 true true 45 75 150 90 180 105 180 180 180 285 150 300 150 210 150 300 120 285 120 195 120 150 30 150 30 120 120 120 45 105 Polygon -16777216 true false 180 60 164 70 165 90 Polygon -16777216 true false 120 60 133 70 135 90 Circle -16777216 true false 123 36 18 Circle -16777216 true false 149 37 18 Polygon -16777216 true false 137 87 137 72 149 70 157 75 158 90 148 81 Polygon -955883 true false 120 30 75 -60 135 0 135 -30 150 0 180 -75 180 0 195 -30 195 15 270 -45 195 60 150 45 Polygon -2674135 true false 150 300 120 240 135 240 120 180 135 195 135 120 150 195 180 120 180 195 210 165 180 240 210 225 180 285 Polygon -1184463 true false 30 135 45 105 75 135 90 105 105 135 120 90 135 135 75 150 Polygon -1184463 true false 45 105 30 60 60 90 90 45 90 90 120 60 135 105 zombie-burning3 false 0 Circle -7500403 true true 118 15 90 Polygon -7500403 true true 45 60 150 90 180 105 180 180 195 285 150 300 150 210 150 300 105 285 120 195 120 150 30 165 30 135 120 120 45 90 Polygon -16777216 true false 180 60 164 70 165 90 Polygon -16777216 true false 120 60 133 70 135 90 Circle -16777216 true false 123 36 18 Circle -16777216 true false 149 37 18 Polygon -16777216 true false 137 87 137 72 149 70 157 75 158 90 148 81 Polygon -955883 true false 120 30 105 -15 120 0 120 -90 150 0 195 -90 180 0 225 -30 195 45 120 60 60 0 Polygon -1184463 true false 30 150 45 105 60 135 60 90 75 120 90 90 105 120 120 105 120 135 Polygon -1184463 true false 45 75 60 30 60 60 75 60 90 75 105 75 105 90 135 75 135 105 Polygon -2674135 true false 195 285 240 240 210 255 225 180 210 210 210 120 195 165 180 105 165 150 150 135 180 195 150 180 180 225 150 210 180 255 150 270 zombie-part0 true 0 Circle -7500403 true true 103 105 90 Polygon -16777216 true false 167 159 151 169 148 189 Polygon -16777216 true false 105 157 118 167 120 187 Circle -16777216 true false 115 137 18 Circle -16777216 true false 141 138 18 Polygon -16777216 true false 123 183 123 168 135 166 143 171 144 186 134 177 zombie-part1 true 0 Polygon -7500403 true true 135 135 240 150 240 180 135 165 zombie-part2 true 0 Polygon -7500403 true true 75 135 165 135 165 165 75 165 zombie-part3 true 0 Polygon -7500403 true true 105 225 135 135 165 150 150 240 zombie-part4 true 0 Polygon -7500403 true true 150 240 135 150 165 120 195 225 zombie0 false 0 Circle -7500403 true true 103 15 90 Polygon -7500403 true true 45 75 150 90 180 105 180 180 210 285 165 300 150 210 135 300 90 285 120 195 120 150 30 150 30 120 120 120 45 105 Polygon -16777216 true false 165 60 149 70 150 90 Polygon -16777216 true false 105 60 118 70 120 90 Circle -16777216 true false 108 36 18 Circle -16777216 true false 134 37 18 Polygon -16777216 true false 122 87 122 72 134 70 142 75 143 90 133 81 zombie1 false 0 Circle -7500403 true true 103 15 90 Polygon -7500403 true true 45 75 150 90 180 105 180 180 195 285 150 300 150 210 150 300 105 285 120 195 120 150 30 150 30 120 120 120 45 105 Polygon -16777216 true false 165 60 149 70 150 90 Polygon -16777216 true false 105 60 118 70 120 90 Circle -16777216 true false 108 36 18 Circle -16777216 true false 134 37 18 Polygon -16777216 true false 122 87 122 72 134 70 142 75 143 90 133 81 zombie2 false 0 Circle -7500403 true true 118 15 90 Polygon -7500403 true true 45 75 150 90 180 105 180 180 180 285 150 300 150 210 150 300 120 285 120 195 120 150 30 150 30 120 120 120 45 105 Polygon -16777216 true false 180 60 164 70 165 90 Polygon -16777216 true false 120 60 133 70 135 90 Circle -16777216 true false 123 36 18 Circle -16777216 true false 149 37 18 Polygon -16777216 true false 137 87 137 72 149 70 157 75 158 90 148 81 zombie3 false 0 Circle -7500403 true true 118 15 90 Polygon -7500403 true true 45 60 150 90 180 105 180 180 195 285 150 300 150 210 150 300 105 285 120 195 120 150 30 165 30 135 120 120 45 90 Polygon -16777216 true false 180 60 164 70 165 90 Polygon -16777216 true false 120 60 133 70 135 90 Circle -16777216 true false 123 36 18 Circle -16777216 true false 149 37 18 Polygon -16777216 true false 137 87 137 72 149 70 157 75 158 90 148 81 @#$#@#$#@ NetLogo 4.0beta1 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@