SHARE
TWEET

Untitled

a guest Aug 22nd, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env jruby
  2. # frozen_string_literal: false
  3. require 'propane'
  4.  
  5. # check for specific keys  
  6. # propane graffiti by 8mana
  7. # based on code by Casey Reas and Ben Fry
  8.  
  9. class CheckKeys < Propane::App
  10.   def settings
  11.     size 120, 120
  12.   end
  13.  
  14.   def setup
  15.     sketch_title 'check for specific keys'
  16.   end
  17.  
  18.   def draw
  19.     background 204
  20.     if key_pressed?
  21.       line 30, 60, 90, 60 if key == 'h' || key == 'H'
  22.       line 30, 20, 90, 100 if key == 'n' || key == 'N'
  23.     end
  24.     line 30, 20, 30, 100
  25.     line 90, 20, 90, 100
  26.   end
  27. end
  28.  
  29. CheckKeys.new
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top