Skip to content

Commit

Permalink
change marching-squares to use milliseconds since start of sketch
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Aug 5, 2023
1 parent 8879bc2 commit cf27126
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/shimmers/sketches/marching_squares.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,11 @@

(defn setup []
(q/color-mode :hsl 1.0)
{:t 0.0
:n 40})

(defn update-state [state]
(update state :t + 0.002))
{:n 40})

(defn draw [{:keys [n t]}]
(let [sx (/ (q/width) n)
(let [t (/ (q/millis) 50000.0)
sx (/ (q/width) n)
sy (/ (q/height) n)
{:keys [threshold divisor]} @ui-state
m (/ 1 (Math/pow 2 divisor))]
Expand All @@ -46,7 +43,6 @@
(sketch/component
:size [800 800]
:setup setup
:update update-state
:draw draw
:middleware [m/fun-mode framerate/mode])
[ctrl/container
Expand Down

0 comments on commit cf27126

Please sign in to comment.