Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.87 KB | None | 0 0
  1. module Introcredits
  2.  
  3.   @@images = []
  4.  
  5.   class Image
  6.     def initialize(name, id)
  7.       @id = id
  8.       @finished = false
  9.       @start = rand(120)-60
  10.       $game_screen.pictures[@id].show(name, 0, @start, 0, 100, 100, 0, 0)
  11.       $game_screen.pictures[@id].move(40, 0, 0, 0, 100, 100, 255, 0)
  12.       @wait = 121
  13.     end
  14.    
  15.     def update
  16.       @wait -= 1
  17.       if @wait == 101
  18.         $game_screen.pictures[@id].move(80, 0, -@start, 0, 100, 100, 0, 0)
  19.       elsif @wait <= 0
  20.         $game_screen.pictures[@id].erase
  21.         @finished = true
  22.       end
  23.     end
  24.    
  25.     def finished?
  26.       return @finished
  27.     end
  28.   end
  29.  
  30.   def self.update
  31.     del = []
  32.     @@images.each { |img|
  33.       img.update
  34.       del.push(img) if img.finished?
  35.     }
  36.     @@images -= del
  37.   end
  38.  
  39.   def self.show_pic(name, id)
  40.     @@images.push(Image.new(name, id))
  41.   end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement