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