Skip to content

Instantly share code, notes, and snippets.

View pvinis's full-sized avatar
🔭
hello?

Pavlos Vinieratos pvinis

🔭
hello?
View GitHub Profile
id)
case id
when Gosu::KbUp
@selected = (@selected - 1) % @menu_items.size
when Gosu::KbDown
##sound
@selected = (@selected +
:bottom] = SIZE-WALL_THICKNESS
attr_reader :walls
def initialize(x, y, left, right, top,bottom)
@x,@y,@z = x,y,Z::GRID
@walls = {}
@walls[:le
ICKNESS
attr_reader :walls
def initialize(x, y, left, right
attr_reader :walls
def initialize(x, y, left, right, top,bottom)
@x,@y,@z = x,y,Z::GRID
@walls = {}
require 'gosu'
require './tile'
require './z'
module Visible
NO, YES, ON_HIT, STATES = *0..3
end
class Wall
THICKNESS = 8
"package_name_map": {
"soda-theme": "Theme - Soda"
}
}
def ok
a = []
end
@pvinis
pvinis / face_detector.rb
Created December 7, 2011 12:06
run with "macruby face_detector.rb" or "macruby face_detector.rb https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/304055_10150415385415891_522505890_10347873_1682210515_n.jpg?dl=1" for a photo of me with woody and buzz lightyear :p
framework 'Cocoa'
class NSColor
def toCGColor
color_RGB = colorUsingColorSpaceName(NSCalibratedRGBColorSpace)
## approach #1
# components = Array.new(4){Pointer.new(:double)}
# color_RGB.getRed(components[0],
# green: components[1],
# blue: components[2],
#!/usr/local/bin/macruby
framework 'Cocoa'
framework 'AVFoundation'
# because we love blocks, we make NSTimer blocks :-)
class NSTimer
def self.scheduledTimerWithTimeInterval interval, repeats: repeat_flag, block: block
self.scheduledTimerWithTimeInterval interval,
target: self,
selector: 'executeBlockFromTimer:',