Examples of different Quil sketches.
Check src/quil_sketches
folder and it's subfolders. Each .clj
file is a separate sketch. Some of them shows particular Quil feature and some of them are simply beatiful animations. You can start with running them one by one and studying their sources.
Clone repo with examples to you machine:
git clone https://github.com/quil/quil-examples.git
Start REPL:
lein repl
Require selected sketch to run it:
user=> (require 'quil-sketches.gen-art.01-cross-with-circle :reload)
Note:
- you should start sketch namespace with single quote:
'quil-sketches.mouse
:reload
option is needed if you want to run it several times. Otherwise sketch won't run on second and subsequent calls.
Use following command to run selected sketch:
lein run -m quil-sketches.gen-art.01-cross-with-circle
When you close sketch JVM won't exit, so you need to do it manually e.g. using Ctrl+C
combination.
Start LightTable.
Open folder containing the project:
File -> Open folder
Open file containing sketch and evaluate it using following keys combination:
Ctrl+Shift+Enter
Open file with sketch:
emacs src/quil_sketches/gen_art/01_cross_with_circle.clj
Start cider:
M-x cider-jack-in
Evaluate opened file:
C-c C-k
Sketch will open.
You can run other sketches by opening their files and evaluate their contents via C-c C-k
It is simple. You can either modify existing sketch or create new one. To create new sketch first you need to create sketch file e.g. src/quil_sketches/my_super_sketch.clj
and use some existing sketch as initial template (don't forget to modify namespace to quil-sketches.my-super-sketch
).
Happy hacking!