Created
March 20, 2014 14:18
-
-
Save quephird/9664748 to your computer and use it in GitHub Desktop.
A quickly written implementation using quil of this: http://pastebin.com/Wf9EZenN. I did it without looking at their code first.
This file contains hidden or 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 fun-with-quil.acid-rain | |
(:use quil.core)) | |
(def screen-w 1920) | |
(def screen-h 1080) | |
(defn setup [] | |
(smooth) | |
(no-stroke) | |
(background 0)) | |
(defn draw [] | |
(let [possible-colors [[255 0 0] [0 255 0] [0 0 255]] | |
drop-c (possible-colors (rand-int (count possible-colors))) | |
drop-w (+ 25 (random 75)) | |
drop-x (random screen-w) | |
drop-y (random screen-h)] | |
(fill 0 0 0 5) | |
(rect 0 0 screen-w screen-h) | |
(push-matrix) | |
(display-filter :blur 0.6) | |
(translate drop-x drop-y) | |
(apply fill drop-c) | |
(ellipse 0 0 drop-w drop-w) | |
(pop-matrix))) | |
(sketch | |
:title "acid rain" | |
:setup setup | |
:draw draw | |
:renderer :java2d | |
:size [screen-w screen-h]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment