         [keyboard-event-key kbd-chan] (utils/events->chan js/window
                                                           EventType.KEYDOWN
                                                           (chan 1))
+        [resize-event-key resize-chan] (utils/events->chan js/window
+                                                           EventType.RESIZE
+                                                           (chan 1))
         fullscreen-key (events/listen js/window
                                       EventType.KEYDOWN
                                       (partial fullscreen-handler canvas))]

    (utils/insert-image-assets! image-assets)
    (setup-game-audio)
    (go-loop [last-state nil]
      (let [[v c] (alts! [kbd-chan rafchan control-chan])]
        (condp = c
          kbd-chan (do
                     (keyboard-handler v)
                     (recur last-state))


;; events->chan on keyboard -> println the event (check it's not duplicated)

(defn calculate-canvas-size
  [canvas]
  (let [body (utils/get-first-elem "body")
        window-width (.-clientWidth body)
        window-height (.-clientHeight body)
        game-ratio (/ game-width game-height)
        dw (/ window-width game-width)
        dh (/ window-height game-height)]
    (if (>= dh dw)
      [window-width (/ window-width game-ratio)]
      [(* window-height game-ratio) window-height])))

(defn resize-canvas
  [canvas]
  (let [[new-width new-height] (calculate-canvas-size canvas)]
    (utils/set-element-style canvas
                             {:width (int new-width)
                              :height (int new-height)})))

(defn fullscreen-handler
  [canvas e]
  (when (= (.-keyCode e)
