rows of inventory items.

This commit is contained in:
2014-11-29 18:05:30 -08:00
parent ed78efdd0d
commit 17121a0481

View File

@@ -59,8 +59,12 @@
:show-screen (fn [{items :items} [entities]]
(assoc entities :start-showing? true
:items (for [[item index] (map vector items (range))
:let [x (+ (* 79 4) (* index (* 24 4)))
y (* 4 180)
:let [row (int (/ index 8))
column (mod index 8)
base-x (* 79 4)
base-y (* 180 4)
x (+ base-x (* column (* 24 4)))
y (- base-y (* row (* 24 4)))
item-width 16
offset-x (+ x (/ item-width 2))
offset-y (+ y (/ item-width 2))