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")}
:def nil
:zoom 3}
:player {:x (- (/ (get-in gamestate [:dimensions :w]) 2) 32)
:y (- (/ (get-in gamestate [:dimensions :h]) 2) 32)
:player {:x (/ (get-in gamestate [:dimensions :w]) 2)
:y (/ (get-in gamestate [:dimensions :h]) 2)
:w 0 :h 0
:d :s
:animation {:ids {:s 778 :n 778
@ -67,7 +67,9 @@
(update-in [:viewport :x] * tw zoom)
(update-in [:viewport :y] * th zoom)
(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))
(defn update-scene [gamestate scenestate]

Loading…
Cancel
Save