Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement