Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[VX] Simple Gameover Menu

This is my first script that works, and it's only a simple script that adds a menu to the gameover screen that allows the player to choose between loading a game (which goes back to the title menu, aswell as playing that music) going to the title screen and shutting down.

Copy and paste into a new script in the 'Materials' section.

http://i231.photobucket.com/albums/ee20 ... Script.png[/img]

Code:
#============================================================================
# VX Scene_Gameover edit by CociCookie
#----------------------------------------------------------------------------
#     Includes a menu on the Game Over screen for loading or going to title
#============================================================================
class Scene_Gameover
  def create_command_window
    s1 = Vocab::continue
    s2 = Vocab::to_title
    s3 = Vocab::shutdown
    @command_window = Window_Command.new(172, [s1, s2, s3])
    @command_window.x = (544 - @command_window.width) / 2
    @command_window.y = 288
    @command_window.openness = 255
  end
# -----
  def start
    super
    RPG::BGM.stop
    RPG::BGS.stop
    $data_system.gameover_me.play
    Graphics.transition(120)
    Graphics.freeze
    create_gameover_graphic
    create_command_window
  end
# -----
  def update
    super
    @command_window.update
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0 #Load Game
        $scene = Scene_File.new(false, true, false)
        close_command_window
      when 1 #To Title
        $scene = Scene_Title.new
        close_command_window
      when 2 #Shutdown
        $scene = nil
      Graphics.fadeout(120)
    end
  end
# -----
  def close_command_window
    @command_window.close
    begin
      @command_window.update
      Graphics.update
    end until @command_window.openness == 0
  end
  end
end
 
Ok, I've found that it messes up slightly with the HUD in Vlad's ABS topic, when using shutdown, it fades into the map before exiting. And that is it's only problem!
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top