Created
August 9, 2019 15:56
-
-
Save jamesmichiemo/1bedadc20b53b085450b072c086d34cf to your computer and use it in GitHub Desktop.
processing + propane sketch
This file contains 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
#!/usr/bin/env jruby | |
# frozen_string_literal: false | |
require 'propane' | |
# the bounds of a circle | |
# propane graffiti by 8mana | |
# based on code by Casey Reas and Ben Fry | |
class CircleBounds < Propane::App | |
def settings | |
size 240, 120 | |
end | |
def setup | |
sketch_title 'the bounds of a circle' | |
$x = 120 | |
$y = 60 | |
$radius = 12 | |
ellipseMode RADIUS | |
end | |
def draw | |
background 204 | |
d = dist mouseX, mouseY, $x, $y | |
if d < $radius | |
$radius += 1 | |
fill 0 | |
else | |
fill 255 | |
end | |
ellipse $x, $y, $radius, $radius | |
end | |
end | |
CircleBounds.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment