require 'sdl' require 'bizzieLibrary' require 'bizzieSDL' require 'bizzieMatrix' require 'bizzieRandom' SDL.init SDL::INIT_VIDEO $SDLscreen = SDL::set_video_mode 640, 480, 24, SDL::SRCALPHA puts $black.distance($originNd[4]) BGCOLOR = $SDLscreen.format.mapRGB 0, 0, 0 LINECOLOR = $SDLscreen.format.mapRGB 255, 255, 255 $SDLscreen.flip running = true SDL::Mixer.open() a = SDL::Mixer::Wave.load("testSound.wav") b = SDL::Mixer::Wave.load("testSound2.wav") SDL::Mixer.allocateChannels(20) def playSound end while(running) while event = SDL::Event2.poll case event when SDL::Event2::Quit running = false when SDL::Event2::MouseMotion x = event.x y = event.y when SDL::Event2::KeyDown SDL::Mixer::playChannel(-1, a, 0) puts "yo!" when SDL::Event2::KeyUp SDL::Mixer::playChannel(-1, b, 0) puts "zo!" end end end