Sign in to follow this  
Followers 0
Fegarur

Men? Game Over

7 posts in this topic

Descripción:
Cuando mueres, en la pantalla de Game Over saldrán opciones para decidir qué hacer. Esas opciones serán:
1.- Cargar
2.- Salir
3.- Título

Screens:
Versión 1
user posted image

Versión 2
user posted image


Demo:
Descargar el Demo aquí

Recursos necesarios:
(Sólo versión 2)

Pega estas imágenes en la carpeta Titles de tu proyecto. Nómbralas 1, 2 y 3.
1. [SPOILER]user posted image[/SPOILER]
2. [SPOILER]user posted image[/SPOILER]
3. [SPOILER]user posted image[/SPOILER]

Script:
Reemplaza tu Scene_Gameover con:

Versión 1[SPOILER]
CODE
#================================Metal Forest inc==============================
#=====================================Presents=================================
# ** Scene_Gameover menu
# ** Created by xLeD
#------------------------------------------------------------------------------
#  This class performs game over screen processing.
#==============================================================================

class Scene_Gameover
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make game over graphic
@sprite = Sprite.new
@sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)
# Stop BGM and BGS
$game_system.bgm_play(nil)
$game_system.bgs_play(nil)
# Play game over ME
$game_system.me_play($data_system.gameover_me)
# Execute transition
Graphics.transition(120)
# Make command window
s1 = "     Cargar"
s2 = "    Salir"
s3 = "  Pantalla de Título"
@command_window = Window_Command.new(267, [s1, s2, s3])
@command_window.x = 345 - @command_window.width / 2
@command_window.y = 332 - @command_window.height / 2
@command_window.contents_opacity = 0
@command_window.back_opacity = 0
@command_window.opacity = 0
# 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
# Prepare for transition
Graphics.freeze
# Dispose of game over graphic
@sprite.bitmap.dispose
@sprite.dispose
@command_window.dispose
# Execute transition
Graphics.transition(40)
# Prepare for transition
Graphics.freeze
# If battle test
if $BTEST
$scene = nil
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update command window
@command_window.update
if @command_window.contents_opacity <= 255
@command_window.contents_opacity += 2.5
@command_window.back_opacity += 2.5
@command_window.opacity += 0
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0  # to load menu
command_to_load
when 1  # quit game
command_shutdown
when 2  # back to title screen
command_menu
end
return
end
end
#--------------------------------------------------------------------------
# * Process When Choosing [To Load] Command
#--------------------------------------------------------------------------
def command_to_load
# 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)
# Switch to title screen
$scene = Scene_Load2.new
end
#--------------------------------------------------------------------------
# * Process When Choosing [Shutdown] Command
#--------------------------------------------------------------------------
def command_shutdown
# 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
#--------------------------------------------------------------------------
# *  Process When Choosing [menu] Command
#--------------------------------------------------------------------------
def command_menu
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Switch to menu screen
$scene = Scene_Title.new(5)
end
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
[/SPOILER]

Versión 2[SPOILER]
CODE
#================================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
[/SPOILER]

Instrucciones:
+ El script funcionará en cuanto lo coloques.
+ Puedes cambiar las imágenes de la segunda versión mientras respetes el nombre de la imagen.

Crédito:
+ Script creado por: xLeD
+ Ayuda de: ccoa Edited by Fegarur
0

Share this post


Link to post
Share on other sites
el script esta bueno lo unico q no me gusta son las fuentes del de la segunda version como puedo poner las q yo quiera???? huh.gif
0

Share this post


Link to post
Share on other sites
ps haces tus propias imagenes y ya y las cambias por las que estan aqui.
0

Share this post


Link to post
Share on other sites
^buen script ?podria ponerse otras opciones?
0

Share this post


Link to post
Share on other sites
¿Otras opciones? Como Game Over me parece que así está bien...
0

Share this post


Link to post
Share on other sites
ya solo pregunto si se pueden poner otras dry.gif
0

Share this post


Link to post
Share on other sites
Supongo que sí... pero tendrías que currártelo, claro.
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0