9d6dd2ef87e5

Add a bit of a comment.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Fri, 13 Jul 2012 23:52:13 -0400
parents e2ed8ba084a0
children b894c3ffe436
branches/tags (none)
files src/caves/ui/drawing.clj

Changes

--- a/src/caves/ui/drawing.clj	Fri Jul 13 23:47:08 2012 -0400
+++ b/src/caves/ui/drawing.clj	Fri Jul 13 23:52:13 2012 -0400
@@ -32,6 +32,21 @@
 
 
 ; Play ------------------------------------------------------------------------
+;
+; The Play UI draws the world.  This is tricky, but hopefully not too bad.
+;
+; Imagine a 10 by 4 world with a 3 by 2 "viewport":
+;
+;  0123456789
+; 0...OVV....
+; 1...VVV....
+; 2...VVV....
+; 3..........
+; 4..........
+;
+; The V is the viewport, and the O is the "viewport origin", which would be
+; [3 0] in terms of the map's coordinates.
+
 (defn get-viewport-coords
   "Find the top-left coordinates of the viewport in the overall map, centering on the player."
   [game player-location vcols vrows]
@@ -67,7 +82,7 @@
 (defn draw-hud [screen game [ox oy]]
   (let [hud-row (dec (second (s/get-size screen)))
         [x y] (get-in game [:world :entities :player :location])
-        info (str "loc: [" x "-" y "]")
+        info (str "player loc: [" x "-" y "]")
         info (str info " viewport origin: [" ox "-" oy "]")]
     (s/put-string screen 0 hud-row info)))