[RGSS] Game Over Menu
2 participantes
Página 1 de 1
[RGSS] Game Over Menu
Em muitos jogos de RPG, quando a Tela de Game Over aparece, São disponibilizadas opções,Load, Exit Game e Main Menu, para facilitar a vida do player. Eu achei um script que faz isso, agora preste atenção:
-Copie as Imgs abaixo, cole-as na pasta Titles de seu jogo:
(Nomeie-as como 1,2 e 3 de acordo com a ordem)
1-
2-
3-
E cole o script abaixo, a cima de Main
-Copie as Imgs abaixo, cole-as na pasta Titles de seu jogo:
(Nomeie-as como 1,2 e 3 de acordo com a ordem)
1-
2-
3-
E cole o script abaixo, a cima de Main
- Código:
#================================Metal Forest inc==============================
#=====================================Presents=================================
# ** Scene_Gameover menu V.2
# ** Created by xLeD
# ** Special Credits goes to ccoa
#------------------------------------------------------------------------------
# This class performs game over screen processing.
#==============================================================================
class Scene_Gameover
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make game over graphic
$game_system.bgm_play(nil)
$game_system.bgs_play(nil)
# Play game over ME
$game_system.me_play($data_system.gameover_me)
# Slow Fade in
# NEW CODE
@back_sprite = Sprite.new
# transition between images, set to 0 if none
@transition_frames = 10
@delta = 255 / @transition_frames = 5
@wait = 0
#END NEW CODE
# NEW CODE
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.title("1")
@index = 1
Graphics.transition(120)
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Stop BGM and BGS
#Fade in
Graphics.transition(120)
# Make system object
$game_system = Game_System.new
# Make title graphic
@sprite = Sprite.new
# Prepare for transition
Graphics.freeze
# Dispose of title graphic
@sprite.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# NEW CODE
if @wait > 0
if @wait == 0
@sprite.bitmap = RPG::Cache.title(@index.to_s)
@sprite.opacity = 255
else
@sprite.opacity -= @delta
end
@wait -= 1
return
end
# if directional buttons are pressed
if Input.trigger?(Input::LEFT) or Input.trigger?(Input::UP)
$game_system.se_play($data_system.cursor_se)
if @index == 1
@index = 3
else
@index -= 1
end
@wait = @transition_frames
@back_sprite.bitmap = RPG::Cache.title(@index.to_s)
end
if Input.trigger?(Input::RIGHT) or Input.trigger?(Input::DOWN)
$game_system.se_play($data_system.cursor_se)
if @index == 3
@index = 1
else
@index += 1
end
@wait = @transition_frames
@back_sprite.bitmap = RPG::Cache.title(@index.to_s)
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by index
case @index
when 1 # New game
command_Load
when 2 # Continue
command_Exit_Game
when 3 # Shutdown
command_Back_to_Titlescreen
end
end
# END NEW CODE
end
#--------------------------------------------------------------------------
# * Command: New Game
#--------------------------------------------------------------------------
def command_Load
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Goes to the load menu
$scene = Scene_Load2.new
end
#--------------------------------------------------------------------------
# * Command: Continue
#--------------------------------------------------------------------------
def command_Exit_Game
#Play decision SE
$game_system.se_play($data_system.decision_se)
# Fade out BGM, BGS, and ME
Audio.bgm_fade(800)
Audio.bgs_fade(800)
Audio.me_fade(800)
# Shutdown
$scene = nil
end
#--------------------------------------------------------------------------
# * Command: Shutdown
#--------------------------------------------------------------------------
def command_Back_to_Titlescreen
$game_system.se_play($data_system.decision_se)
# Goes to the Titlescreen
$scene = Scene_Title.new
end
#==============================================================================
# ** Scene_Load
#------------------------------------------------------------------------------
# This class performs load screen processing.
#==============================================================================
class Scene_Load2 < Scene_File
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
# Remake temporary object
$game_temp = Game_Temp.new
# Timestamp selects new file
$game_temp.last_file_index = 0
latest_time = Time.at(0)
for i in 0..3
filename = make_filename(i)
if FileTest.exist?(filename)
file = File.open(filename, "r")
if file.mtime > latest_time
latest_time = file.mtime
$game_temp.last_file_index = i
end
file.close
end
end
super("Which file would you like to load?")
end
#--------------------------------------------------------------------------
# * Decision Processing
#--------------------------------------------------------------------------
def on_decision(filename)
# If file doesn't exist
unless FileTest.exist?(filename)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play load SE
$game_system.se_play($data_system.load_se)
# Read save data
file = File.open(filename, "rb")
read_save_data(file)
file.close
# Restore BGM and BGS
$game_system.bgm_play($game_system.playing_bgm)
$game_system.bgs_play($game_system.playing_bgs)
# Update map (run parallel process event)
$game_map.update
# Switch to map screen
$scene = Scene_Map.new
end
#--------------------------------------------------------------------------
# * Cancel Processing
#--------------------------------------------------------------------------
def on_cancel
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to title screen
$scene = Scene_Gameover.new
end
#--------------------------------------------------------------------------
# * Read Save Data
# file : file object for reading (opened)
#--------------------------------------------------------------------------
def read_save_data(file)
# Read character data for drawing save file
characters = Marshal.load(file)
# Read frame count for measuring play time
Graphics.frame_count = Marshal.load(file)
# Read each type of game object
$game_system = Marshal.load(file)
$game_switches = Marshal.load(file)
$game_variables = Marshal.load(file)
$game_self_switches = Marshal.load(file)
$game_screen = Marshal.load(file)
$game_actors = Marshal.load(file)
$game_party = Marshal.load(file)
$game_troop = Marshal.load(file)
$game_map = Marshal.load(file)
$game_player = Marshal.load(file)
# If magic number is different from when saving
# (if editing was added with editor)
if $game_system.magic_number != $data_system.magic_number
# Load map
$game_map.setup($game_map.map_id)
$game_player.center($game_player.x, $game_player.y)
end
# Refresh party members
$game_party.refresh
end
end
end
Crhonos- Número de Mensagens : 118
Idade : 30
Especialidade : Eventos
Data de inscrição : 01/12/2008
RMB Games
Nível de Reputação: 2
Reputação:
(19/100)
Gamescore:
(0/0)
Re: [RGSS] Game Over Menu
A imagem 2 não apareceu aqui. Anyway, +1 Reputação.
Dark Dudu- Número de Mensagens : 385
Idade : 30
Localização : São Vicente - SP
Especialidade : Eventos
Data de inscrição : 01/12/2008
RMB Games
Nível de Reputação: 2
Reputação:
(61/100)
Gamescore:
(0/0)
Tópicos semelhantes
» [RGSS]Crhonos Rotation Menu
» [RGSS]New Game+
» [RGSS2] Menu Compacto por LB [v1.0.0]
» [RGSS]Multiplayer System 2.5
» [RGSS] GTA Loading
» [RGSS]New Game+
» [RGSS2] Menu Compacto por LB [v1.0.0]
» [RGSS]Multiplayer System 2.5
» [RGSS] GTA Loading
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos