$> brew install sdl2
and optionally:
$> brew install sdl2_image
$> brew install sdl2_mixer
$> brew install sdl2_gfx
$> brew install sdl2_ttf
| module Collisions | |
| def self.aabb_rect_vs_rect(rect1,rect2) | |
| rect1[0] < rect2[0] + rect2[2] && | |
| rect1[0] + rect1[2] > rect2[0] && | |
| rect1[1] < rect2[1] + rect2[3] && | |
| rect1[1] + rect1[3] > rect2[1] | |
| end | |
| def self.resolve_collisions_with_rects(position,size,velocity,rects) | |
| # First round of collision testing that will teel us ... |
| module KeyMap | |
| def self.set(mapping) | |
| mapping.each_pair do |command,key| | |
| GTK::KeyboardKeys.send :alias_method, command, key | |
| end | |
| end | |
| def self.unset(mapping) | |
| mapping.each_pair do |command,key| | |
| GTK::KeyboardKeys.send :undef_method, command |