From 01cc12045bd2d4198c3dd8b72a2a2de05a09fe20 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Sun, 8 Jan 2012 20:13:14 -0500 Subject: [PATCH] Update copyright for 2012, and some cleanup. --- base.nls | 2 +- bullet.nls | 2 +- explosion.nls | 2 +- lobo.nlogo | 48 +++--------------------------------------------- pillbox.nls | 4 ++-- player.nls | 10 ++-------- tank.nls | 12 +++++++++++- 7 files changed, 21 insertions(+), 59 deletions(-) diff --git a/base.nls b/base.nls index 9eb3024..c705be4 100644 --- a/base.nls +++ b/base.nls @@ -1,5 +1,5 @@ ;; lobo: Logo Bolo -;; (c) Ben Kurtovic, 2011 +;; (c) Ben Kurtovic, 2011-2012 breed [bases base] diff --git a/bullet.nls b/bullet.nls index c985c0d..27cc36d 100644 --- a/bullet.nls +++ b/bullet.nls @@ -1,5 +1,5 @@ ;; lobo: Logo Bolo -;; (c) Ben Kurtovic, 2011 +;; (c) Ben Kurtovic, 2011-2012 breed [bullets bullet] diff --git a/explosion.nls b/explosion.nls index 8b14742..db437d4 100644 --- a/explosion.nls +++ b/explosion.nls @@ -1,5 +1,5 @@ ;; lobo: Logo Bolo -;; (c) Ben Kurtovic, 2011 +;; (c) Ben Kurtovic, 2011-2012 globals [ explosions-table diff --git a/lobo.nlogo b/lobo.nlogo index 09d08e9..0dc90e9 100644 --- a/lobo.nlogo +++ b/lobo.nlogo @@ -1,5 +1,5 @@ ;; lobo: Logo Bolo -;; (c) Ben Kurtovic, 2011 +;; (c) Ben Kurtovic, 2011-2012 ;; ;; Logo Bolo is a re-envisioning of the classic tank game by Stuart Cheshire in NetLogo. ;; @@ -41,6 +41,7 @@ to setup spawn-tank 1 6 0 270 spawn-base 0 -7 spawn-pillbox 6 6 + show-hud render set last-tick-time timer end @@ -188,7 +189,7 @@ end to play-sound [name] if enable-sound? [ let dist distancexy ([xcor] of player) ([ycor] of player) - let volume 127 - (dist * 8) + let volume 100 - (dist * 4) if volume > 0 [ sound:play-drum (table:get sounds name) volume ] @@ -353,49 +354,6 @@ NIL NIL @#$#@#$#@ -WHAT IS IT? ------------ -This section could give a general understanding of what the model is trying to show or explain. - - -HOW IT WORKS ------------- -This section could explain what rules the agents use to create the overall behavior of the model. - - -HOW TO USE IT -------------- -This section could explain how to use the model, including a description of each of the items in the interface tab. - - -THINGS TO NOTICE ----------------- -This section could give some ideas of things for the user to notice while running the model. - - -THINGS TO TRY -------------- -This section could give some ideas of things for the user to try to do (move sliders, switches, etc.) with the model. - - -EXTENDING THE MODEL -------------------- -This section could give some ideas of things to add or change in the procedures tab to make the model more complicated, detailed, accurate, etc. - - -NETLOGO FEATURES ----------------- -This section could point out any especially interesting or unusual features of NetLogo that the model makes use of, particularly in the Procedures tab. It might also point out places where workarounds were needed because of missing features. - - -RELATED MODELS --------------- -This section could give the names of models in the NetLogo Models Library or elsewhere which are of related interest. - - -CREDITS AND REFERENCES ----------------------- -This section could contain a reference to the model's URL on the web if it has one, as well as any other necessary credits or references. @#$#@#$#@ default true diff --git a/pillbox.nls b/pillbox.nls index ff21cc8..1e15430 100644 --- a/pillbox.nls +++ b/pillbox.nls @@ -1,5 +1,5 @@ ;; lobo: Logo Bolo -;; (c) Ben Kurtovic, 2011 +;; (c) Ben Kurtovic, 2011-2012 breed [pillboxes pillbox] @@ -26,7 +26,7 @@ end to hatch-pillbox hatch 1 [ - debug who "PILL-HATCH" (word "by " ([who] of myself)) + debug who "PILL-PLACE" (word "by " ([who] of myself)) set breed pillboxes set-pill-vars [team] of myself ] diff --git a/player.nls b/player.nls index 7c31c4b..d8a409e 100644 --- a/player.nls +++ b/player.nls @@ -1,5 +1,5 @@ ;; lobo: Logo Bolo -;; (c) Ben Kurtovic, 2011 +;; (c) Ben Kurtovic, 2011-2012 globals [ player @@ -56,13 +56,7 @@ end to player-place-pill ask player [ - ifelse number-of-pills > 0 [ - set number-of-pills number-of-pills - 1 - hatch-pillbox - play-sound "place" - ] [ - play-sound "nopill" - ] + place-pill ] end diff --git a/tank.nls b/tank.nls index 4f15efd..1ff12e4 100644 --- a/tank.nls +++ b/tank.nls @@ -1,5 +1,5 @@ ;; lobo: Logo Bolo -;; (c) Ben Kurtovic, 2011 +;; (c) Ben Kurtovic, 2011-2012 breed [tanks tank] @@ -131,6 +131,16 @@ to kill-tank die end +to place-pill + ifelse number-of-pills > 0 and count bases-here = 0 [ + set number-of-pills number-of-pills - 1 + hatch-pillbox + play-sound "place" + ] [ + play-sound "nopill" + ] +end + ;; ========= ;; Reporters ;; =========