Skip to content

Instantly share code, notes, and snippets.

@mharju
Created July 17, 2012 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mharju/2a31909da1ff277a8384 to your computer and use it in GitHub Desktop.
Save mharju/2a31909da1ff277a8384 to your computer and use it in GitHub Desktop.
How to get stuff added to a global var?
(defn draw []
(let [canvas-center-x (/ (width) 2)
canvas-center-y (/ (height) 2)
rads (radians (frame-count))
color (* 255 (+ 1.0 (sin rads)))
r 100]
(background 128)
(fill color color 0)
(ellipse canvas-center-x canvas-center-y r r)))
(defn mouse-dragged []
(println "mouse Dragged!" (mouse-x) (mouse-y))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment