player position

master
Josha von Gizycki 6 years ago
parent eb924c7a54
commit faeccbecde

@ -17,8 +17,8 @@
{:map-def {:images {:pokelike (by-id "demoscene-tileset")} {:map-def {:images {:pokelike (by-id "demoscene-tileset")}
:def nil :def nil
:zoom 3} :zoom 3}
:player {:x (- (/ (get-in gamestate [:dimensions :w]) 2) 32) :player {:x (/ (get-in gamestate [:dimensions :w]) 2)
:y (- (/ (get-in gamestate [:dimensions :h]) 2) 32) :y (/ (get-in gamestate [:dimensions :h]) 2)
:w 0 :h 0 :w 0 :h 0
:d :s :d :s
:animation {:ids {:s 778 :n 778 :animation {:ids {:s 778 :n 778
@ -67,7 +67,9 @@
(update-in [:viewport :x] * tw zoom) (update-in [:viewport :x] * tw zoom)
(update-in [:viewport :y] * th zoom) (update-in [:viewport :y] * th zoom)
(assoc-in [:player :w] (- tw 2)) (assoc-in [:player :w] (- tw 2))
(assoc-in [:player :h] (- th 2)))) (assoc-in [:player :h] (- th 2))
(update-in [:player :w] - (/ tw 2))
(update-in [:player :h] - (/ th 2))))
scenestate)) scenestate))
(defn update-scene [gamestate scenestate] (defn update-scene [gamestate scenestate]

Loading…
Cancel
Save