Jump to content
Rpg²S Forum

*Menù di gameover


Luigi
 Share

Recommended Posts

Autore: Dark_Ruby

Descrizione: questo script permette di inserire un piccolo menù al game over
http://i35.photobucket.com/albums/d194/rubymatt/GameoverMenu.jpg

Istruzioni: rimpiazzate la classe scene_gameover con questo codice

 

#==============================================================================
# ** Window_Gameover
#------------------------------------------------------------------------------
# This window displays the window that you see above your gameover choices.
# Edited by Dark_Ruby
#==============================================================================

class Window_Gameover < Window_Base
	def initialize
		super(0, 0, 420, 64)
		self.contents = Bitmap.new(width - 32, height - 32)
		refresh
	end
	def refresh
		self.contents.clear
		self.contents.font.color = system_color
		self.contents.draw_text(4, 0, 380, 32, "You were annihilated... your quest ends here.") #Edit the text here to fit your game.
	end
end
#==============================================================================
# ** Scene_Gameover
#------------------------------------------------------------------------------
# This class performs game over screen processing.
# Edited by Dark_Ruby
#==============================================================================
class Scene_Gameover
	def main
		@sprite = Sprite.new
		@sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)
		$game_system.bgm_play(nil)
		$game_system.bgs_play(nil)
		$game_system.me_play($data_system.gameover_me)
		Graphics.transition(120)
		loop do
			Graphics.update
			Input.update
			update
			if $scene != self
				break
			end
		end
		Graphics.freeze
		@sprite.bitmap.dispose
		@sprite.dispose
		Graphics.freeze
		if $BTEST
			$scene = nil
		end
	end
	def update
		if Input.trigger?(Input::C)
			$scene = Scene_GameoverMenu.new
		end
	end
end
#==============================================================================
# ** Scene_GameoverMenu
#------------------------------------------------------------------------------
# This class performs game over menu processing
# Created by Dark_Ruby
#==============================================================================
class Scene_GameoverMenu
	def main
		@sprite = Sprite.new
		@sprite.bitmap = RPG::Cache.gameover($data_system.gameover_name)
		s1 = "Load Game"
		s2 = "Return to Title"
		s3 = "Exit"
		@command_window = Window_Command.new(192, [s1, s2, s3])
		@command_window.x = 240
		@command_window.y = 240
		@command_window.back_opacity = 160
		@continue_enabled = false
		for i in 0..3
			if FileTest.exist?("Save#{i+1}.rxdata")
				@continue_enabled = true
			end
		end
		if @continue_enabled
			@command_window.index = 0
		else
			@command_window.disable_item(0)
			@command_window.index = 1
		end
		@gameover_window = Window_Gameover.new
		@gameover_window.x = 120
		@gameover_window.y = 176
		@gameover_window.back_opacity = 160
		$game_system.bgm_play($data_system.title_bgm)
		Audio.me_stop
		Audio.bgs_stop
		Graphics.transition
		loop do
			Graphics.update
			Input.update
			update
			if $scene != self
				break
			end
		end
		Graphics.freeze
		@command_window.dispose
		@gameover_window.dispose
		@sprite.bitmap.dispose
		@sprite.dispose
	end
	def update
		@command_window.update
		@gameover_window.update
		if Input.trigger?(Input::C)
			case @command_window.index
			when 0 #Load a previous game
				command_continue
			when 1 #Return to title screen
				$game_system.se_play($data_system.decision_se)
				$scene = Scene_Title.new
			when 2 #End game
				command_shutdown
			end
		end
	end
	def command_continue
		unless @continue_enabled
			$game_system.se_play($data_system.buzzer_se)
			return
		end
		$game_system.se_play($data_system.decision_se)
		$scene = Scene_Load.new
	end
	def command_shutdown
		$game_system.se_play($data_system.decision_se)
		Audio.bgm_fade(800)
		Audio.bgs_fade(800)
		Audio.me_fade(800)
		$scene = nil
	end
end #of Scene_GameoverMenu

 

 

Link to comment
Share on other sites

  • 1 year later...

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
 Share

×
×
  • Create New...