Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #----------------------------------------------------------------------------
- # AriArk's Game Over Choices
- # Version 1.00
- #----------------------------------------------------------------------------
- # This is my first script, it obviously wont be very good, just adds to title
- # and shut down to the game over screen. It should be customisable though.
- # 1. Go down to the green Create Command List
- # 2. Put another add_command (use example)
- # 3. Then search for "Create Command Window"
- # 4. Put another @command_window.set_handler (use example)
- # 5. Go to the bottom and use the example.
- # Could be a bit complicated because i'm not good at explaining things...
- # Remember to get rid of the hashtags (not up here)
- #----------------------------------------------------------------------------
- class Window_GameEnd < Window_Command
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super(0, 0)
- update_placement
- self.openness = 0
- open
- end
- #--------------------------------------------------------------------------
- # * Get Window Width
- #--------------------------------------------------------------------------
- def window_width
- return 160
- end
- #--------------------------------------------------------------------------
- # * Update Window Position
- #--------------------------------------------------------------------------
- def update_placement
- self.x = (Graphics.width - width) / 2
- self.y = (Graphics.height - height) / 2
- end
- #--------------------------------------------------------------------------
- # * Create Command List (1.Customisable)
- #--------------------------------------------------------------------------
- def make_command_list
- add_command(Vocab::to_title, :to_title)
- add_command(Vocab::shutdown, :shutdown)
- # add_command("Custom1", :custom1)
- end
- end
- class Scene_Gameover < Scene_Base
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- def start
- super
- play_gameover_music
- fadeout_frozen_graphics
- create_background
- create_command_window
- end
- #--------------------------------------------------------------------------
- # * Termination Processing
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_background
- end
- #--------------------------------------------------------------------------
- # * Execute Transition
- #--------------------------------------------------------------------------
- def perform_transition
- Graphics.transition(fadein_speed)
- end
- #--------------------------------------------------------------------------
- # * Play Music on Game Over 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("GameOver")
- 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
- SceneManager.goto(Scene_Title)
- end
- #--------------------------------------------------------------------------
- # * Create Command Window (4.Customisable)
- #--------------------------------------------------------------------------
- def create_command_window
- @command_window = Window_GameEnd.new
- @command_window.set_handler(:to_title, method(:command_to_title))
- @command_window.set_handler(:shutdown, method(:command_shutdown))
- # @command_window.set_handler(:custom1, method(:command_custom1))
- end
- #--------------------------------------------------------------------------
- # * 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
- #--------------------------------------------------------------------------
- # * [Custom1] Command
- #--------------------------------------------------------------------------
- # def command_custom1 # You put the :command from Create Command Window here
- # close_command_window
- # fadeout_all
- # SceneManager.goto(Scene_CustomScene) # You put what scene to call here
- # end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement