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.

(RMVX) Error with script

Whenever I try to change to my SubMenu it shows:
http://www2.mediafire.com/imgbnc.php/55a31f9a353ec7b8be3555cbec19679c5g.jpg[/img]
and in my script it show I've defined create_command_window

Why doesn't my script work? [Refer to DEMO for more information.]

Code:
class Scene_SubMenu < Scene_Base

  def initialize(menu_index = 0)
    @menu_index = menu_index

  end

  def start
    super
    create_menu_background
    create_command_window
  end
  
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
  end
  
  def update
    super
    check_input_method
    @command_window.update
    update_command_selection
  end
  
  #--------------------------------------------------------------------------
  # * Checks the Input Method(Left or Right)
  #--------------------------------------------------------------------------
  def check_input_method
    if Input.trigger?(Input::RIGHT)
      $scene = Scene_SubMenu.new
      return
    elsif Input.trigger?(Input::LEFT)
      $scene = Scene_Map.new
      return
    end
    
    def create_command_window
    s0 = Vocab::save
    s1 = Vocab::game_end
    @command_window = Window_Command.new (160, [s0, s1])
    @command_window.index = @menu_index
    @command_window.x = (544 - @command_window.width) / 2
    @command_window.y = (416 - @command_window.height) / 2
  end
  
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Menu.new(6)
    elsif Input.trigger?(Input::C)
      Sound.play_decision
      case @command_window.index
      when 0
        $scene = Scene_File.new(true, false, false)
      when 1
        $scene = Scene_End.new
      end
    end
  end
end
end

Demo: http://www.mediafire.com/?jzmtnczgylo
 

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