80438ed06cbf

Leftover.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 16 Sep 2011 13:45:14 -0400
parents 7942222da830
children 9874586e98d1
branches/tags (none)
files src/examples/followbot.clj

Changes

--- a/src/examples/followbot.clj	Fri Sep 02 20:10:35 2011 -0400
+++ b/src/examples/followbot.clj	Fri Sep 16 13:45:14 2011 -0400
@@ -17,7 +17,7 @@
        (abs (- (:z from) (:z to))))))
 
 (defn- toward-single [from to]
-  (if (<= (abs (- from to)) 1)
+  (if (<= (abs (- from to)) 2)
     0
     (if (< from to) 1 -1)))
 
@@ -38,15 +38,13 @@
                      (distance-between bot %2))
                  entities))))
 
+
 ; Loops ----------------------------------------------------------------------------
 (defn follow [bot]
   (when (:loc @(:player bot))
     (let [players (find-other-players bot)
           closest (closest-entity bot players)]
       (when closest
-        (println (:name @(:player bot)) "following" (:name @closest))
-        (println (:loc @(:player bot)))
-        (println (:loc @closest))
         (let [{x :x z :z} (toward bot closest)]
           [(actions/move bot x 0 z)])))))