Created
April 14, 2012 09:20
-
-
Save indy/2383086 to your computer and use it in GitHub Desktop.
a1215
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns work.a1215-cljs-orbit | |
(:use [art.canvas :only (filled-rect filled-circle)] | |
[art.util :only (canvas-2d-animation)])) | |
(defn draw | |
[ctx] | |
(let [time (* (. (js/Date.) (getTime)) 0.002) | |
x (+ 128 (* 96 (. js/Math sin time))) | |
y (+ 128 (* 96 (. js/Math cos (* 0.9 time))))] | |
(-> ctx | |
(filled-rect 0 0 255 255 "rgb(245,245,245)") | |
(filled-circle x y 10 "rgb(255,0,0)")))) | |
(defn ^:export main [] | |
(canvas-2d-animation draw)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment