Skip to content

Commit

Permalink
Add in a reset rampup
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Feb 7, 2024
1 parent e07fc6a commit 2292997
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/shimmers/sketches/display_tree.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,16 @@
[make-rect-growth 1]])]
(assoc screen :animation (mk-anim display)))))

(defn update-displays [displays _t]
(let [i (dr/random-int (count displays))]
(defn update-displays [displays t]
(let [i (dr/random-int (count displays))
ramp (Math/pow 2 (* 4 (tm/smoothstep* 0.8 1.0 (mod (/ t 50.0) 1.0))))]
(println ramp)
(update displays i
(fn [s]
(case (dr/weighted {:divide 32
:add-animation 48
:combine 8
:collapse 2
:combine (* 8 ramp)
:collapse (* 2 ramp)
:nothing 4096})
:divide (subdivide s)
:combine (combine s)
Expand Down

0 comments on commit 2292997

Please sign in to comment.