Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #----------------------------------------------------------------------------
- # AriArk's Game Over Choices
- # Version 1.20
- #----------------------------------------------------------------------------
- # This is my first script, it obviously wont be very good, just adds to title
- # and shut down to the game over screen. You can add your own choices too.
- #----------------------------------------------------------------------------
- #----------------------------------------------------------------------------
- # CUSTOM SETTINGS
- #----------------------------------------------------------------------------
- # Where it says one letter in green (x, y), put whatever there. You must
- # remember those letters. Don't change if you only want to title and shutdown.
- #----------------------------------------------------------------------------
- class Window_Gameoverchoice < Window_Command
- #----------------------------------------------------------------------------
- def make_command_list
- # add_command("Text Shown", :x) # Example
- add_command(Vocab::to_title, :to_title)
- add_command(Vocab::shutdown, :shutdown)
- end
- end
- #----------------------------------------------------------------------------
- class Scene_Gameover < Scene_Base
- #----------------------------------------------------------------------------
- def create_command_window
- @command_window = Window_Gameoverchoice.new
- # @command_window.set_handler(:x, method(:comand_y)) # Example
- @command_window.set_handler(:to_title, method(:command_to_title))
- @command_window.set_handler(:shutdown, method(:command_shutdown))
- end
- #----------------------------------------------------------------------------
- # Copy paste this underneath to make more
- #----------------------------------------------------------------------------
- def command_y
- close_command_window
- fadeout_all
- SceneManager.goto(Scene_z) # You put what scene to call here
- end
- end
- #----------------------------------------------------------------------------
- # END OF CUSTOM SETTINGS
- #----------------------------------------------------------------------------
- # DO NOT EDIT ANYTHING BELOW IF YOU DO NOT KNOW RUBY!!!
- #----------------------------------------------------------------------------
- class Window_Gameoverchoice < Window_Command
- def initialize
- super(0, 0)
- update_placement
- self.openness = 0
- open
- end
- def window_width
- return 160
- end
- def update_placement
- self.x = (Graphics.width - width) / 2
- self.y = (Graphics.height - height) / 2
- end
- end
- class Scene_Gameover < Scene_Base
- def start
- super
- play_gameover_music
- fadeout_frozen_graphics
- create_background
- create_command_window
- end
- def terminate
- super
- dispose_background
- end
- def perform_transition
- Graphics.transition(fadein_speed)
- end
- def play_gameover_music
- RPG::BGM.stop
- RPG::BGS.stop
- $data_system.gameover_me.play
- end
- def fadeout_frozen_graphics
- Graphics.transition(fadeout_speed)
- Graphics.freeze
- end
- def create_background
- @sprite = Sprite.new
- @sprite.bitmap = Cache.system("GameOver")
- end
- def dispose_background
- @sprite.bitmap.dispose
- @sprite.dispose
- end
- def fadeout_speed
- return 60
- end
- def fadein_speed
- return 120
- end
- def goto_title
- fadeout_all
- SceneManager.goto(Scene_Title)
- end
- def close_command_window
- @command_window.close
- update until @command_window.close?
- end
- def command_to_title
- close_command_window
- fadeout_all
- SceneManager.goto(Scene_Title)
- end
- def command_shutdown
- close_command_window
- fadeout_all
- SceneManager.exit
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement