def self.continue return data_system.terms.continue
end
def self.shutdown return data_system.terms.shutdown
end end
b. module Sound
Modul ini memainkan efek suara. Diperoleh dengan efek suara yang
ditentukan dalam Database dari data_system, dan memainkan mereka.
def self.play_cursor data_system.sounds[0].play
end
def self.play_decision data_system.sounds[1].play
end
def self.play_cancel data_system.sounds[2].play
end
Universitas Sumatera Utara
def self.play_buzzer data_system.sounds[3].play
end
def self.play_save data_system.sounds[5].play
end
def self.play_load data_system.sounds[6].play
end
def self.play_shop data_system.sounds[17].play
end end
c. module Cache
Modul ini memuat masing-masing grafis, membuat objek Bitmap, dan mempertahankannya. Modul ini dibuat untuk mempercepat load dan
menghemat memori.
def self.animationfilename, hue load_bitmapGraphicsAnimations, filename, hue
end
Universitas Sumatera Utara
def self.characterfilename load_bitmapGraphicsCharacters, filename
end
def self.facefilename load_bitmapGraphicsFaces, filename
end
def self.parallaxfilename load_bitmapGraphicsParallaxes, filename
end
def self.picturefilename load_bitmapGraphicsPictures, filename
end
def self.systemfilename load_bitmapGraphicsSystem, filename
end
def self.clear cache = {} if cache == nil
cache.clear GC.start
end
Universitas Sumatera Utara
def self.load_bitmapfolder_name, filename, hue = 0 cache = {} if cache == nil
path = folder_name + filename if not cache.include?path or cache[path].disposed?
if filename.empty? cache[path] = Bitmap.new32, 32
else cache[path] = Bitmap.newpath
end end
if hue == 0 return cache[path]
else key = [path, hue]
if not cache.include?key or cache[key].disposed? cache[key] = cache[path].clone
cache[key].hue_changehue end
return cache[key] end
end end
Universitas Sumatera Utara
2. Game Objects a. class Game_Temp
Kelas ini menangani data sementara yang tidak termasuk dengan data simpan. Contoh kelas ini direferensikan oleh game_temp.
attr_accessor :next_scene attr_accessor :map_bgm
attr_accessor :map_bgs attr_accessor :common_event_id
attr_accessor :in_battle attr_accessor :battle_proc
attr_accessor :shop_goods attr_accessor :shop_purchase_only
attr_accessor :name_actor_id attr_accessor :name_max_char
attr_accessor :menu_beep attr_accessor :last_file_index
attr_accessor :debug_top_row attr_accessor :debug_index
attr_accessor :background_bitmap
Universitas Sumatera Utara
def initialize next_scene = nil
map_bgm = nil map_bgs = nil
common_event_id = 0 in_battle = false
battle_proc = nil shop_goods = nil
shop_purchase_only = false name_actor_id = 0
name_max_char = 0 menu_beep = false
last_file_index = 0 debug_top_row = 0
debug_index = 0 background_bitmap = Bitmap.new1, 1
end end
Universitas Sumatera Utara
b. class Game_Switches