 ;; Object Definitions
 ;;-----------------------------------------------------------------------------
 
-(defrecord Rect [x y width height color])
-(defrecord Line [x1 y1 x2 y2 color])
-(defrecord Frame [x y width height color frame-width])
-
+(defrecord GameBackground [])
+(defrecord GameNet [])
 (defrecord GameStartScreen [])
 (defrecord Paddle [x y width height vy color])
 (defrecord Ball [x y radius vx vy fill-color oob?])

    (.closePath ctx)
    (.restore ctx)))

(extend-type Rect
  IDrawable
  (draw! [{:keys [color x y width height]} ctx]
    (.save ctx)
    (aset ctx "lineWidth" "0.5")
    (aset ctx "fillStyle" color)
    (aset ctx "strokeStyle" "black")
    (.fillRect ctx x y width height)
    (.strokeRect ctx x y width height)
    (.restore ctx)))

(extend-type Frame
  IDrawable
  (draw! [{:keys [color x y width height frame-width]} ctx]
    (.save ctx)
    (aset ctx "lineWidth" (str frame-width))
    (aset ctx "strokeStyle" color)
    (.strokeRect ctx x y width height)
    (.restore ctx)))

;;-----------------------------------------------------------------------------
;; Moveable Objects


        (= :space event)
        (swap! state #(if (= (:mode %) :game-start)
                        (merge % objects {:mode :playing})
                        (assoc % :pause? (not (:pause? %)))))

        :else
