Advertisement
AriArk

AriArk's Game Over Choices

Sep 3rd, 2013
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.36 KB | None | 0 0
  1. #----------------------------------------------------------------------------
  2. # AriArk's Game Over Choices
  3. # Version 1.00
  4. #----------------------------------------------------------------------------
  5. # This is my first script, it obviously wont be very good, just adds to title
  6. # and shut down to the game over screen. It should be customisable though.
  7. # 1. Go down to the green Create Command List
  8. # 2. Put another add_command (use example)
  9. # 3. Then search for "Create Command Window"
  10. # 4. Put another @command_window.set_handler (use example)
  11. # 5. Go to the bottom and use the example.
  12. # Could be a bit complicated because i'm not good at explaining things...
  13. # Remember to get rid of the hashtags (not up here)
  14. #----------------------------------------------------------------------------
  15.  
  16. class Window_GameEnd < Window_Command
  17. #--------------------------------------------------------------------------
  18. # * Object Initialization
  19. #--------------------------------------------------------------------------
  20. def initialize
  21. super(0, 0)
  22. update_placement
  23. self.openness = 0
  24. open
  25. end
  26. #--------------------------------------------------------------------------
  27. # * Get Window Width
  28. #--------------------------------------------------------------------------
  29. def window_width
  30. return 160
  31. end
  32. #--------------------------------------------------------------------------
  33. # * Update Window Position
  34. #--------------------------------------------------------------------------
  35. def update_placement
  36. self.x = (Graphics.width - width) / 2
  37. self.y = (Graphics.height - height) / 2
  38. end
  39. #--------------------------------------------------------------------------
  40. # * Create Command List (1.Customisable)
  41. #--------------------------------------------------------------------------
  42. def make_command_list
  43. add_command(Vocab::to_title, :to_title)
  44. add_command(Vocab::shutdown, :shutdown)
  45. # add_command("Custom1", :custom1)
  46. end
  47. end
  48. class Scene_Gameover < Scene_Base
  49. #--------------------------------------------------------------------------
  50. # * Start Processing
  51. #--------------------------------------------------------------------------
  52. def start
  53. super
  54. play_gameover_music
  55. fadeout_frozen_graphics
  56. create_background
  57. create_command_window
  58. end
  59. #--------------------------------------------------------------------------
  60. # * Termination Processing
  61. #--------------------------------------------------------------------------
  62. def terminate
  63. super
  64. dispose_background
  65. end
  66. #--------------------------------------------------------------------------
  67. # * Execute Transition
  68. #--------------------------------------------------------------------------
  69. def perform_transition
  70. Graphics.transition(fadein_speed)
  71. end
  72. #--------------------------------------------------------------------------
  73. # * Play Music on Game Over Screen
  74. #--------------------------------------------------------------------------
  75. def play_gameover_music
  76. RPG::BGM.stop
  77. RPG::BGS.stop
  78. $data_system.gameover_me.play
  79. end
  80. #--------------------------------------------------------------------------
  81. # * Fade Out Frozen Graphics
  82. #--------------------------------------------------------------------------
  83. def fadeout_frozen_graphics
  84. Graphics.transition(fadeout_speed)
  85. Graphics.freeze
  86. end
  87. #--------------------------------------------------------------------------
  88. # * Create Background
  89. #--------------------------------------------------------------------------
  90. def create_background
  91. @sprite = Sprite.new
  92. @sprite.bitmap = Cache.system("GameOver")
  93. end
  94. #--------------------------------------------------------------------------
  95. # * Free Background
  96. #--------------------------------------------------------------------------
  97. def dispose_background
  98. @sprite.bitmap.dispose
  99. @sprite.dispose
  100. end
  101. #--------------------------------------------------------------------------
  102. # * Get Fade Out Speed
  103. #--------------------------------------------------------------------------
  104. def fadeout_speed
  105. return 60
  106. end
  107. #--------------------------------------------------------------------------
  108. # * Get Fade In Speed
  109. #--------------------------------------------------------------------------
  110. def fadein_speed
  111. return 120
  112. end
  113. #--------------------------------------------------------------------------
  114. # * Transition to Title Screen
  115. #--------------------------------------------------------------------------
  116. def goto_title
  117. fadeout_all
  118. SceneManager.goto(Scene_Title)
  119. end
  120. #--------------------------------------------------------------------------
  121. # * Create Command Window (4.Customisable)
  122. #--------------------------------------------------------------------------
  123. def create_command_window
  124. @command_window = Window_GameEnd.new
  125. @command_window.set_handler(:to_title, method(:command_to_title))
  126. @command_window.set_handler(:shutdown, method(:command_shutdown))
  127. # @command_window.set_handler(:custom1, method(:command_custom1))
  128. end
  129. #--------------------------------------------------------------------------
  130. # * Close Command Window
  131. #--------------------------------------------------------------------------
  132. def close_command_window
  133. @command_window.close
  134. update until @command_window.close?
  135. end
  136. #--------------------------------------------------------------------------
  137. # * [Go to Title] Command
  138. #--------------------------------------------------------------------------
  139. def command_to_title
  140. close_command_window
  141. fadeout_all
  142. SceneManager.goto(Scene_Title)
  143. end
  144. #--------------------------------------------------------------------------
  145. # * [Shut Down] Command
  146. #--------------------------------------------------------------------------
  147. def command_shutdown
  148. close_command_window
  149. fadeout_all
  150. SceneManager.exit
  151. end
  152. #--------------------------------------------------------------------------
  153. # * [Custom1] Command
  154. #--------------------------------------------------------------------------
  155. # def command_custom1 # You put the :command from Create Command Window here
  156. # close_command_window
  157. # fadeout_all
  158. # SceneManager.goto(Scene_CustomScene) # You put what scene to call here
  159. # end
  160. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement