|
|
@ -138,6 +138,7 @@
|
|
|
|
then, it calls itself again with a delay according to the target fps"
|
|
|
|
then, it calls itself again with a delay according to the target fps"
|
|
|
|
[gamestate]
|
|
|
|
[gamestate]
|
|
|
|
(let [newstate (update-step gamestate)]
|
|
|
|
(let [newstate (update-step gamestate)]
|
|
|
|
|
|
|
|
(set! (.-imageSmoothingEnabled (:ctx gamestate)) false)
|
|
|
|
(draw-step newstate)
|
|
|
|
(draw-step newstate)
|
|
|
|
(when-not @reloaded
|
|
|
|
(when-not @reloaded
|
|
|
|
(.setTimeout js/window
|
|
|
|
(.setTimeout js/window
|
|
|
@ -150,13 +151,9 @@
|
|
|
|
(defn init-scenes
|
|
|
|
(defn init-scenes
|
|
|
|
"initiates the scene data maps using their respective init functions"
|
|
|
|
"initiates the scene data maps using their respective init functions"
|
|
|
|
[]
|
|
|
|
[]
|
|
|
|
(aset (:ctx gamestate)
|
|
|
|
(as-> (:canvas gamestate) c
|
|
|
|
"imageSmoothingEnabled"
|
|
|
|
(set! (.-width c) (get-in gamestate [:dimensions :w]))
|
|
|
|
false)
|
|
|
|
(set! (.-height c) (get-in gamestate [:dimensions :h])))
|
|
|
|
(aset (:canvas gamestate)
|
|
|
|
|
|
|
|
"width" (get-in gamestate [:dimensions :w]))
|
|
|
|
|
|
|
|
(aset (:canvas gamestate)
|
|
|
|
|
|
|
|
"height" (get-in gamestate [:dimensions :h]))
|
|
|
|
|
|
|
|
(update gamestate
|
|
|
|
(update gamestate
|
|
|
|
:scenes
|
|
|
|
:scenes
|
|
|
|
#(reduce
|
|
|
|
#(reduce
|
|
|
|