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.

Menu script not working, please help.[Review]

Ok for my menu i want windows to change when you press left and right. My script below is not changing windows when i press left and right. There will be five windows when the script is done. Can someone take a look at this and help me?

Code:
#==============================================================================

# ** Scene_Menu_SoBe

#------------------------------------------------------------------------------

#  Menu System

#==============================================================================

 

class Scene_Menu_SoBe

  #--------------------------------------------------------------------------

  # * Scene Processing

  #--------------------------------------------------------------------------

  def main

    # Make sprite set

    @spriteset = Spriteset_Map.new

    # Fraction Window

    @Frac = Window_Frac.new

    @Frac.visible = false

    # Item Window

    @Items = Window_Items.new

    @Items.visible = false

    # Transition run

    Graphics.transition

    # Main loop

    loop do

      # Update game screen

      Graphics.update

      # Update input information

      Input.update

      # Frame update

      update

      # Abort loop if screen is changed

      if $scene != self

        break

      end

    end

    # Prepare for transition

    Graphics.freeze

    # Dispose of sprite set

    @spriteset.dispose

    @Frac.dispose

    @Items.dispose

  end

  #--------------------------------------------------------------------------

  # * Frame Update

  #--------------------------------------------------------------------------

  def update

    # Update sprite set

    @spriteset.update

    @Frac.update

    @Items.update

    @Items.visible = true

    # If B button was pressed

    if Input.trigger?(Input::B)

      # Play cancel SE

      $game_system.se_play($data_system.cancel_se)

      # Switch to map screen

      $scene = Scene_Map.new

      return

    end

    # If R button was pressed

    if Input.trigger?(Input::R)

      # Play cursor SE

      $game_system.se_play($data_system.cursor_se)

      if @Frac.visible = true

        @Frac.visible = false

        @Items.visible = true

        return

      end

      if @Items.visible = true

       @Frac.visible = true

       @Items.visible = false

       return

      end

     return

    end

    # If L button was pressed

    if Input.trigger?(Input::L)

      # Play cursor SE

      $game_system.se_play($data_system.cursor_se)

      if @Items.visible = true

        @Items.visible = false

        @Frac.visible = true

       return

      end

     if @Frac.visible = true

      @Frac.visible = false

      @Items.visible = true

      return

     end

     return

    end

  end

 end
 

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