Решение 4-ой задачи:

Спойлер 4:
PHP код:
def test_anim
  $spr 
Sprite.new
  
# Узнаем размеры картинки
  
pic_width Bitmap.new ("Graphics/Pictures/framerate.png").width
  pic_height 
Bitmap.new ("Graphics/Pictures/framerate.png").height 
  
# Задаём начальные координаты вывода и размер квадрата анимации
  
$spr.bitmap Bitmap.new (pic_width/8-1,pic_height)
  
$spr.100
  $spr
.100
  
# Повторяем анимацию 5 раз
  
for j in 0..5
    x 
0
    y 
0
    
for i in 0..7
      $spr
.bitmap.blt (00Bitmap.new ("Graphics/Pictures/framerate.png"),
                       
Rect.new(xypic_width/8-2pic_height)) 
      
+= pic_width/8-# Выбираем следующий кадр из картинки 
      
delay(4)           # Честно стыриная функция
      
$spr.bitmap.clear 
    end
  end
end

def delay
(wait)
    
count Graphics.frame_count
    
while wait count >= Graphics.frame_count
       Graphics
.update
    end
end 
Функция delay подсмотрена из CGI Movies