Skip to content

Instantly share code, notes, and snippets.

@jamesmichiemo
Created August 10, 2019 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesmichiemo/153741a1a380d6c9332b758bf031f6d6 to your computer and use it in GitHub Desktop.
Save jamesmichiemo/153741a1a380d6c9332b758bf031f6d6 to your computer and use it in GitHub Desktop.
processing + propane sketch
#!/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