# HG changeset patch # User Steve Losh # Date 1342237933 14400 # Node ID 9d6dd2ef87e5c98507b7fe297e0afe4e129fb74f # Parent e2ed8ba084a054de5cf8c6749d2085a6437a3ac6 Add a bit of a comment. diff -r e2ed8ba084a0 -r 9d6dd2ef87e5 src/caves/ui/drawing.clj --- 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)))