Skip to content

Instantly share code, notes, and snippets.

@jamesmichiemo
Created August 9, 2019 15:56
Show Gist options
  • Save jamesmichiemo/1bedadc20b53b085450b072c086d34cf to your computer and use it in GitHub Desktop.
Save jamesmichiemo/1bedadc20b53b085450b072c086d34cf to your computer and use it in GitHub Desktop.
processing + propane sketch
#!/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