 
 (enable-console-print!)
 
-;;-----------------------------------------------------------------------------
 ;; Constants
-;;-----------------------------------------------------------------------------
 
 (def SCALE-W 800)
 (def SCALE-H 450)

  [el type fn]
  (.addEventListener el type fn false))

;;-----------------------------------------------------------------------------
;; Object Definitions
;;-----------------------------------------------------------------------------

(defrecord GameBackground [])
(defrecord GameNet [])
(defrecord GameStartScreen [])
(defrecord GameOverScreen [])
(defrecord Paddle [x y width height vy color])
(defrecord Ball [x y radius vx vy fill-color])
(defrecord Score [score x y font color align])

;;-----------------------------------------------------------------------------
;; Drawable Objects
;;-----------------------------------------------------------------------------

(defprotocol IDrawable
  (draw! [_ ctx]))

   :game-over  (GameOverScreen.)
   :score-1    (Score. 0 (- MID_W 75) 60 SCORE_FONT SCORE_COLOR "right")
   :score-2    (Score. 0 (+ MID_W 75) 60 SCORE_FONT SCORE_COLOR "left")
   :paddle-1   (Paddle. 10 (- SCALE-H 120) 10 100 10 PLAYER_1_COLOR :right)
   :paddle-2   (Paddle. (- SCALE-W 20) 10 10 100 10 PLAYER_2_COLOR :left)
   :ball       (Ball. 400 225 13 3 2 "lime")})

(defonce state
