File tree 6 files changed +12
-3
lines changed
6 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 98
98
(Particle. (fix-pos np) (fix-vel np nv) ptype))) particles))
99
99
100
100
(defn draw
101
- [canvas window _ [setup particles]]
101
+ [canvas window frame [setup particles]]
102
102
(let [particles (if (c2d/mouse-pressed? window)
103
103
(conj particles (Particle. (c2d/mouse-pos window)
104
104
(Vec2. 0.0 0.0 )
110
110
^ParticleType ptype (.ptype s)]]
111
111
(c2d/set-color canvas (.color ptype))
112
112
(c2d/ellipse canvas (.x p) (.y p) 4 4 ))
113
+ #_(when (= frame 200 ) (c2d/save canvas " results/ex63/plife.jpg" ))
113
114
[setup (move setup particles 0.1 )]))
114
115
115
116
(def window (c2d/show-window {:canvas (c2d/black-canvas csize csize :highest )
116
117
:draw-fn draw
117
118
:background :black
118
- :draw-state (let [setup (random-setup (r/irand 2 5 ))]
119
+ :draw-state (let [setup (random-setup (r/irand 2 6 ))]
119
120
(pp/pprint setup)
120
- [setup (random-particles setup 1000 )])}))
121
+ [setup (random-particles setup 1200 )])}))
121
122
Original file line number Diff line number Diff line change 73
73
:background :black
74
74
:draw-state (repeatedly 350 #(Vec2. (r/grand 3.5 )
75
75
(r/grand 3.5 )))}))
76
+
77
+ (comment (c2d/save window " results/ex64/lenia.jpg" ))
Original file line number Diff line number Diff line change 1
1
; ; https://www.karlsims.com/rd.html
2
+
3
+ ; ; press space to select k and f
4
+ ; ; press m to back to a map
5
+ ; ; left click to seed B
6
+
2
7
(ns ex65-reaction-diffusion
3
8
(:require [fastmath.core :as m]
4
9
[fastmath.random :as r]
116
121
:background :black
117
122
:draw-state (step (setup ))}))
118
123
124
+ (comment (c2d/save window " results/ex65/rd.jpg" ))
You can’t perform that action at this time.
0 commit comments