Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #----------------------------------------------------------------------------
- # Map GameOver (encryption friendly)
- #----------------------------------------------------------------------------
- # Created by Joel Wideman
- #----------------------------------------------------------------------------
- # For use with RPG Maker VX Ace, compatibility with other software is unknown
- #----------------------------------------------------------------------------
- # Please credit if you use or modify.
- # You may use in commercial or non-commercial works.
- # You may modify, including translation, and redistribute.
- # Please don't redistribute unaltered.
- #----------------------------------------------------------------------------
- # Overrides: Scene_Gameover and Window_GameEnd
- #----------------------------------------------------------------------------
- # Change the GameOver scene to use the map as background and add a menu to
- # reload the game or quit directly, instead of going to the title screen.
- # You can use an image for the game over text. Image should be named
- # "Game_Over.png" (no quotes) and placed in "Graphics/System/"
- #----------------------------------------------------------------------------
- module JW
- # change this to false to print the text
- MAPGO = true
- end
- class Scene_Gameover < Scene_Base
- #--------------------------------------------------------------------------
- # Override: start
- # Removes the call to fadeout the graphics
- #--------------------------------------------------------------------------
- def start
- super
- play_gameover_music
- create_background
- JW::MAPGO ? create_foreground : draw_game_over
- create_command_window
- end
- #--------------------------------------------------------------------------
- # Override: update
- # Removes the call to go to the title scene
- #--------------------------------------------------------------------------
- def update
- super
- end
- #--------------------------------------------------------------------------
- # Override: create_background
- # Replaces the GameOver image with the background
- #--------------------------------------------------------------------------
- def create_background
- @background_sprite = Sprite.new
- @background_sprite.bitmap = SceneManager.background_bitmap
- @background_sprite.color.set(16, 16, 16, 128)
- end
- #--------------------------------------------------------------------------
- # Create Foreground
- #--------------------------------------------------------------------------
- def create_foreground
- @foreground_sprite = Sprite.new
- @foreground_sprite.bitmap = Cache.system("Game_Over")
- end
- #--------------------------------------------------------------------------
- # Override: dispose_background
- # Changed to free foreground_sprite and background_sprite
- #--------------------------------------------------------------------------
- def dispose_background
- @foreground_sprite.bitmap.dispose
- @foreground_sprite.dispose
- @background_sprite.bitmap.dispose
- @background_sprite.dispose
- end
- #--------------------------------------------------------------------------
- # * Draw Game Over
- #--------------------------------------------------------------------------
- def draw_game_over
- @foreground_sprite = Sprite.new
- @foreground_sprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
- @foreground_sprite.z = 100
- @foreground_sprite.bitmap.font.size = 96
- rect = Rect.new(0, 0, Graphics.width, Graphics.height / 2)
- @foreground_sprite.bitmap.draw_text(rect, "Game Over", 1)
- end
- #--------------------------------------------------------------------------
- # Override: create_command_window
- # Removes cancel and adds continue
- #--------------------------------------------------------------------------
- def create_command_window
- @command_window = Window_GameOver.new
- @command_window.set_handler(:continue, method(:command_continue))
- @command_window.set_handler(:to_title, method(:command_to_title))
- @command_window.set_handler(:shutdown, method(:command_shutdown))
- end
- #--------------------------------------------------------------------------
- # * [Continue] Command
- #--------------------------------------------------------------------------
- def command_continue
- close_command_window
- SceneManager.call(Scene_Load)
- end
- #--------------------------------------------------------------------------
- # Copied from Scene_End
- # Terribly kludgy, but I don't know the right way to do it, if you even can
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- # * Close Command Window
- #--------------------------------------------------------------------------
- def close_command_window
- @command_window.close
- update until @command_window.close?
- end
- #--------------------------------------------------------------------------
- # * [Go to Title] Command
- #--------------------------------------------------------------------------
- def command_to_title
- close_command_window
- fadeout_all
- SceneManager.goto(Scene_Title)
- end
- #--------------------------------------------------------------------------
- # * [Shut Down] Command
- #--------------------------------------------------------------------------
- def command_shutdown
- close_command_window
- fadeout_all
- SceneManager.exit
- end
- end
- class Window_GameOver < Window_GameEnd
- #--------------------------------------------------------------------------
- # * Create Command List
- # Removes cancel and adds continue
- #--------------------------------------------------------------------------
- def make_command_list
- add_command(Vocab::continue, :continue)
- add_command(Vocab::to_title, :to_title)
- add_command(Vocab::shutdown, :shutdown)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement