Created
August 3, 2019 16:51
-
-
Save jamesmichiemo/98f6fd064bd17e206733801a18ef08d3 to your computer and use it in GitHub Desktop.
processing + propane sketch
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
| #!/usr/bin/env jruby | |
| # frozen_string_literal: false | |
| require 'propane' | |
| # easing does it | |
| # propane graffiti by 8mana | |
| # based on code by Casey Reas and Ben Fry | |
| class Easing < Propane::App | |
| def settings | |
| size 220, 120 | |
| end | |
| def setup | |
| sketch_title 'easing does it' | |
| $x = 0 | |
| $easing = 0.01 | |
| $diameter = 12 | |
| end | |
| def draw | |
| targetX = mouseX | |
| $x += (targetX - $x) * $easing | |
| ellipse $x, 40, 12, 12 | |
| puts targetX.to_s + " : " + $x.to_s | |
| end | |
| end | |
| Easing.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment