fix rubbish last commit

master
Josha von Gizycki 6 years ago
parent 9b61fdc888
commit 71160351d1

@ -118,7 +118,8 @@
(get-in gamestate [:dimensions :w])
(get-in gamestate [:dimensions :h]))
(let [scenekey (:scene gamestate)
drawfunc (get-in gamestate [:scenes scenekey :draw])]
scene (get-in gamestate [:scenes scenekey])
drawfunc (:draw scene)]
(drawfunc gamestate scene))
(draw-fps gamestate))

@ -5,10 +5,9 @@
[topdown2d.sprites :as sprites]))
(defn init [gamestate scenestate]
(assoc
(merge
scenestate
:player
{:x (- (/ (get-in gamestate [:dimensions :w]) 2) 32)
{:player {:x (- (/ (get-in gamestate [:dimensions :w]) 2) 32)
:y (- (/ (get-in gamestate [:dimensions :h]) 2) 32)
:w 64 :h 64
:d :s
@ -24,8 +23,7 @@
:last-cycle 0
;; seconds per cycle
:spc 0.08}}}
:viewport
{:image (.getElementById js/document "demo-background")
:viewport {:image (.getElementById js/document "demo-background")
:keep-in {:x 0 :y 0
:w 2239 :h 2235}
:x 1 :y 1
@ -33,7 +31,7 @@
;; pixels per second
:pps 350
:w (get-in gamestate [:dimensions :w])
:h (get-in gamestate [:dimensions :h])}))
:h (get-in gamestate [:dimensions :h])}}))
(defn update-player [gamestate player dir]
(let [old-dir (:d player)
@ -54,7 +52,7 @@
(let [player (:player scenestate)
viewport (:viewport scenestate)
dir (get-in gamestate [:input :dir])]
(assoc scenedata
(assoc scenestate
:player (update-player gamestate player dir)
:viewport (update-viewport gamestate viewport dir))))

Loading…
Cancel
Save