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.

A simple pause exit script Eddited by me :)

y 65

Member

=begin
                       No credits required i got idea from another script

Pause feature
Dash feature via space bar
Change lead character via q a s d
                                  Aliasing
================================================================================                                 
Game_Map                        y65_gamemap update
Game_Player                     y65_gameplayer update
Game_Player                     y65_gameplayer_gamecharacter update
================================================================================
=end
class Game_Map
  alias y65_gamemap update
  def update
    y65_gamemap
    if Input.trigger?(Input::R) # Keyboard |W|
      $scene = Scene_Pause.new
    else
      $game_system.bgm_play(@map.bgm)# for Return to map music
    end
  end
end

class Scene_Pause
   def main
    @spriteset_map = Spriteset_Map.new
    @pause = Pause_Window.new
    @pause.x = -17
    @pause.y = -17
    @pause.height = 1150
    @pause.width = 1150
    @pause.opacity = 0
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @pause.dispose
  end

  def update
    if Input.trigger?(Input::R) # keyboard  |W|
      $scene = Scene_Map.new
      Audio.bgm_stop
    elsif
      Input.trigger?(Input::B) #keyboard  |ESC| or |X|
        $scene = Pause_Quit_Option.new
    end
  end
end

class Pause_Quit_Option
  def main
    @mw = MW.new
    @mw.x = -26         # Picture Positioning X
    @mw.y = -26          # Picture Positioning Y
    @mw.height = 1150    #Picture size X
    @mw.width = 1150     # Picture size Y
    @mw.opacity = 100   
    s1 = "Go away"
    s2 = "Stay"
    @command_window = Window_Command.new(192, [s1, s2])
    @command_window.back_opacity = 50
    @command_window.x = 50 - @command_window.width / 3
    @command_window.y = 50
  Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @command_window.dispose
    @mw.dispose
  end
  def update
    @command_window.update
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0 
        command_Sad
      when 1 
        command_Yay
      when 2     
      end
    end
  end
#------------------------------------------------------------------------------#
#--------------------Quits the game to start over or shutdown-------------#
#------------------------------------------------------------------------------#
  def command_Sad  #NOOOOZ :(
    $scene = Scene_Title.new
  end
#------------------------------------------------------------------------------#
#---------------------Returns you back to the pause screen---------------------#
#------------------------------------------------------------------------------#
  def command_Yay
    $scene = Scene_Pause.new
  end
end
#------------------------------------------------------------------------------#
# Used for displaying the quit message after pressing B (ESC,X) while paused.
#------------------------------------------------------------------------------#
class MW < Window_Base
  def initialize
    super(470, 470, 470, 470)
    self.contents = RPG::Cache.picture("quit") #The Quiting picture You can draw
                                               #One
  end
end
#------------------------------------------------------------------------------#
# display pause script  change "" to the name of your graphic.
#------------------------------------------------------------------------------#
class Pause_Window < Window_Base
  def initialize
    super(470, 470, 470, 470)
    self.contents = RPG::Cache.picture("Pause") # Name of picture you can draw
                                                #One
    Audio.bgm_play("Audio/BGM/Pause", 100, 100) # see below notes titled NOTES
  end
end
#Can Choose own BGM just name it Pause
class Game_Player
  alias y65_gameplayer update

  def update
    y65_gameplayer
    if Input.press?(Input::C) # keyboard  |SPACE|, |ENTER| and |C|
      @move_speed = 3.5  #Dash speed
    else
      @move_speed = 3     #Normal speed after dash
    end
   y65_gameplayer
end
end

class Font_Type_Size_Bold
  begin
    Font.default_name = "Arial" #Font
    Font.default_size = 18       # Size
    Font.default_bold = true     #Bold or no
  end
end

class Game_Player < Game_Character
  alias y65_gameplayer_gamecharacter update

  def update
    y65_gameplayer_gamecharacter
    if Input.trigger?(Input::L) #keyboard  |Q|
     actor = $game_party.actors[0]
     @character_name = actor.character_name
   end
   if Input.trigger?(Input::Z) # keyboard  |D|
     actor = $game_party.actors[1]
     @character_name = actor.character_name
   end
   if Input.trigger?(Input::Y) # keyboard  |S|
     actor = $game_party.actors[2]
     @character_name = actor.character_name
   end
   if Input.trigger?(Input::X) # keyboard |A|
     actor = $game_party.actors[3]
     @character_name = actor.character_name
   end
end
end

For A Bmg in pause screen Name it pause and put it in audio/Bmg folder
For pause picture you can draw and name it Pause
For quit picture you can also draw one and name it quit
No laughing at my 2 second pictures >:)

BMG i use
http://www.mediafire.com/?jtdttnn2wyx

Pictures i use warning dont laugh at them :)
http://www.mediafire.com/?59vtgslxmkw
http://www.mediafire.com/?0xqjdnwg3bz

Demo Below

http://www.mediafire.com/?bnoytmoymdn


Plz comment :) first script and it was done by looking at old scripts i already had aquired
 

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