【初心者】課題をクリアしていくスレ【講習会】at GAMEDEV【初心者】課題をクリアしていくスレ【講習会】 - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドのURL■項目テキスト155:Ruby/SDL@課題3赤い四角 04/06/26 17:32 jYUMekjC.net require 'sdl' SDL.init( SDL::INIT_VIDEO ) screen = SDL.setVideoMode( 640, 480, 16, SDL::SWSURFACE ) screen.fillRect( 0, 0, 320, 240, [ 255, 0, 0 ] ) screen.updateRect( 0, 0, 0, 0 ) loop do while event = SDL::Event2.poll case event when SDL::Event2::Quit, SDL::Event2::KeyDown exit end end end 156:Ruby/SDL@課題4sin波形 04/06/26 18:50 jYUMekjC.net require 'sdl' SDL.init( SDL::INIT_VIDEO ) screen = SDL.setVideoMode( 640, 480, 16, SDL::SWSURFACE ) count=0.0 while count < 6.28 x=count*100 y=Math.sin(count)*100+240 screen.putPixel(x,y,[255,0,0]) count=count+0.01 end screen.updateRect( 0, 0, 0, 0 ) loop do while event = SDL::Event2.poll case event when SDL::Event2::Quit, SDL::Event2::KeyDown exit end end end 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch