Created
August 10, 2019 16:59
-
-
Save jamesmichiemo/153741a1a380d6c9332b758bf031f6d6 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' | |
# check for specific keys | |
# propane graffiti by 8mana | |
# based on code by Casey Reas and Ben Fry | |
class CheckKeys < Propane::App | |
def settings | |
size 120, 120 | |
end | |
def setup | |
sketch_title 'check for specific keys' | |
end | |
def draw | |
background 204 | |
if key_pressed? | |
line 30, 60, 90, 60 if key == 'h' || key == 'H' | |
line 30, 20, 90, 100 if key == 'n' || key == 'N' | |
end | |
line 30, 20, 30, 100 | |
line 90, 20, 90, 100 | |
end | |
end | |
CheckKeys.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment