이 스크립트는 게임 데이터를 날아가고 게임을 끄게 하는 것입니다.
이 스크립트는 Scenes 또는 장면 처리에 만드셔야 합니다.
#==============================================================================
# ** Scene_GG
#------------------------------------------------------------------------------
# 게임 항복을 처리하는 스크립트입니다.
#==============================================================================
class Scene_GG < Scene_Base
#--------------------------------------------------------------------------
# * Start Processing
#--------------------------------------------------------------------------
def start
super
play_gameover_music
fadeout_frozen_graphics
create_background
end
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
def terminate
super
dispose_background
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
goto_title if Input.trigger?(:C)
end
#--------------------------------------------------------------------------
# * Execute Transition
#--------------------------------------------------------------------------
def perform_transition
Graphics.transition(fadein_speed)
end
#--------------------------------------------------------------------------
# * Play Music on GG Screen
#--------------------------------------------------------------------------
def play_gameover_music
RPG::BGM.stop
RPG::BGS.stop
$data_system.gameover_me.play
end
#--------------------------------------------------------------------------
# * Fade Out Frozen Graphics
#--------------------------------------------------------------------------
def fadeout_frozen_graphics
Graphics.transition(fadeout_speed)
Graphics.freeze
end
#--------------------------------------------------------------------------
# * Create Background
#--------------------------------------------------------------------------
def create_background
@sprite = Sprite.new
@sprite.bitmap = Cache.system("YouAreGG")
end
#--------------------------------------------------------------------------
# * Free Background
#--------------------------------------------------------------------------
def dispose_background
@sprite.bitmap.dispose
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Get Fade Out Speed
#--------------------------------------------------------------------------
def fadeout_speed
return 60
end
#--------------------------------------------------------------------------
# * Get Fade In Speed
#--------------------------------------------------------------------------
def fadein_speed
return 120
end
#--------------------------------------------------------------------------
# * Transition to Title Screen
#--------------------------------------------------------------------------
def goto_title
fadeout_all
SaveManager.delete_all
SceneManager.exit
end
GG 스크린(/Graphics/System에 복사하세요.
파일은 첨부되어있습니다.
GG 처리할떄 SceneManager.goto(Scene_GG)
그 다음 스크립트는 Materials 아래 삽입 후 적으세요.
module SaveManager
extend self
def delete_all
arr = Dir["Save[0-9][0-9].rvdata2"]
arr.each do |i|
File.delete(i) if File.exist?(i)
end
end
end