设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索

[已解决]}一个场景两个定义两命令窗口光标移动不动

查看数: 416 | 评论数: 1 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2024-7-3 15:07

正文摘要:

本帖最后由 金芒芒 于 2024-7-5 16:43 编辑 RUBY 代码复制#==============================================================================# ■ Scene_chuzhan#--------------------- ...

回复

金芒芒 发表于 2024-7-5 16:42:47
  1. #==============================================================================
  2. # ■ Scene_chuzhan
  3. #------------------------------------------------------------------------------
  4. #  处理菜单画面的类。
  5. #==============================================================================

  6. class Scene_chuzhan
  7.   #--------------------------------------------------------------------------
  8.   # ● 初始化对像
  9.   #     chuzhan_index : 命令光标的初期位置,zhenwei_index = 9
  10.   #--------------------------------------------------------------------------
  11.   def initialize(chuzhan_index = 0)
  12.     @chuzhan_index = chuzhan_index
  13. #    @zhenwei_index = zhenwei_index
  14.     @wait_time = 0
  15.   end
  16.   #--------------------------------------------------------------------------
  17.   # ● 主处理
  18.   #--------------------------------------------------------------------------
  19.   def main
  20.     # 生成地图背景
  21.     @chezhan_TransparentBackground = Spriteset_Map.new
  22.     # 生成出战菜单选项
  23.     @chezhan_IndexCommand = Window_chuzhanCommand.new
  24.     @chezhan_IndexCommand.index = @chuzhan_index
  25.     # 生成阵位列表
  26.     @zhenwei_IndexCommand = Window_zhenweiCommand.new
  27.   #  @zhenwei_IndexCommand.index = false#@zhenwei_index

  28.     # 冻结
  29.     Graphics.transition
  30.     # 不切换场景就一直循环
  31.     update while $scene == self
  32.     # 渐变
  33.     Graphics.freeze
  34.     @chezhan_IndexCommand.dispose
  35.     @zhenwei_IndexCommand.dispose
  36.   end
  37.   #--------------------------------------------------------------------------
  38.   # ● 刷新画面
  39.   #--------------------------------------------------------------------------
  40.   def update
  41.     Graphics.update
  42.     Input.update
  43.     @wait_time -= 1
  44. # if @chezhan_IndexCommand.active == true
  45.     @chezhan_IndexCommand.update
  46.   #  end
  47.     update_chezhan_IndexCommand
  48.   # if @chezhan_IndexCommand.active == false
  49.    #   @zhenwei_IndexCommand.update
  50.    #   update_zhenwei_IndexCommand
  51.    #  end
  52. #   return zhenweiUpdate_IndexCommand if@chezhan_IndexCommand.active
  53. #  return zhenweiUpdate_IndexCommand if @zhenwei_IndexCommand.active =nil

  54. end

  55.   #--------------------------------------------------------------------------
  56.   # ● 刷新画面 (命令窗口被激活的情况下)
  57.   #--------------------------------------------------------------------------
  58.   def update_chezhan_IndexCommand

  59.   # @chezhan_IndexCommand.update
  60.     # 按下 B 键的情况下
  61.     if Input.trigger?(Input::B)
  62.       $scene = Scene_Map.new
  63.       return
  64.     end

  65.     # 按下 C 键的情况下
  66.     if Input.trigger?(Input::C)
  67.       # 命令窗口的光标位置分支
  68.       case  @chezhan_IndexCommand.index
  69.       when 0  # 队组1出生点
  70.         # 演奏确定 SE
  71.         $game_system.se_play($data_system.decision_se)
  72.         # 切换到物品画面
  73.       # $game_switches[队伍1] = true #/ false
  74.        $game_switches[20] = true
  75.        $game_switches[21] = false
  76.        $game_switches[22] = false
  77.        $game_switches[23] = false
  78.        $game_switches[24] = false
  79. #      @chezhan_IndexCommand.active = false
  80. #      @zhenwei_IndexCommand.active = true
  81.        $scene = Scene_zhenwei.new(0)
  82.    #    @zhenwei_IndexCommand.update
  83.       # update_zhenwei_IndexCommand
  84.       # $scene = Scene_chuzhan.new(5)
  85.       when 1  # 队组2出生点
  86.         # 演奏确定 SE
  87.         $game_system.se_play($data_system.decision_se)
  88.         # 激活状态窗口


  89.        $game_switches[20] = false
  90.        $game_switches[21] = true
  91.        $game_switches[22] = false
  92.        $game_switches[23] = false
  93.        $game_switches[24] = false
  94.        $scene = Scene_zhenwei.new(0)
  95.      #  $scene = Scene_chuzhan.new
  96.       when 2  # 队组3出生点
  97.         # 演奏确定 SE
  98.         $game_system.se_play($data_system.decision_se)
  99.         # 激活状态窗口


  100.        $game_switches[20] = false
  101.        $game_switches[21] = false
  102.        $game_switches[22] = true
  103.        $game_switches[23] = false
  104.        $game_switches[24] = false
  105.        @chezhan_IndexCommand.active = false
  106.        @zhenwei_IndexCommand.active = true
  107.       when 3  # 队组4出生点
  108.         # 演奏确定 SE
  109.        $game_system.se_play($data_system.decision_se)


  110.        $game_switches[20] = false
  111.        $game_switches[21] = false
  112.        $game_switches[22] = false
  113.        $game_switches[23] = true
  114.        $game_switches[24] = false
  115.        @chezhan_IndexCommand.active = false
  116.        @zhenwei_IndexCommand.active = true

  117.       when 4  # 队组5出生点
  118.         # 演奏确定 SE
  119.        $game_system.se_play($data_system.decision_se)


  120.        $game_switches[20] = false
  121.        $game_switches[21] = false
  122.        $game_switches[22] = false
  123.        $game_switches[23] = false
  124.        $game_switches[24] = true
  125.        @chezhan_IndexCommand.active = false
  126.        @zhenwei_IndexCommand.active = true

  127.      end

  128.      
  129.       return
  130.     end
  131.   end

  132.   #--------------------------------------------------------------------------
  133.   # ● 刷新画面 (命令窗口被激活的情况下)
  134.   #--------------------------------------------------------------------------
  135.   def update_zhenwei_IndexCommand
  136.       
  137.   #  end
  138.    # update_zhenwei_IndexCommand
  139.     # 按下 B 键的情况下
  140.     if Input.trigger?(Input::B)
  141.       # 演奏取消 SE
  142.       $game_system.se_play($data_system.cancel_se)
  143.       # 切换的地图画面
  144.       $scene = Scene_Map.new
  145.       return
  146.     end
  147.     # 按下 C 键的情况下
  148.     if Input.trigger?(Input::C)
  149.       # 命令窗口的光标位置分支
  150.       case @zhenwei_IndexCommand.index
  151.       when 0  # 队组1出生点
  152.         # 演奏确定 SE
  153.         $game_system.se_play($data_system.decision_se)
  154.         # 切换到物品画面
  155.        # $出战1=[]

  156.       $scene = Scene_zhenwei.new
  157.        # $scene = Scene_chuzhan.new(1)
  158.       when 1  # 队组2出生点
  159.         # 演奏确定 SE
  160.         $game_system.se_play($data_system.decision_se)
  161.         # 激活状态窗口
  162.      #   $出战2=[]
  163.       $scene = Scene_zhenwei.new
  164.       when 2  # 队组3出生点
  165.         # 演奏确定 SE
  166.         $game_system.se_play($data_system.decision_se)
  167.         # 激活状态窗口
  168.        $出战3=[]
  169.      $scene = Scene_chuzhan.new(3)
  170.       when 3  # 队组4出生点
  171.         # 演奏确定 SE
  172.         $game_system.se_play($data_system.decision_se)
  173.        $出战4=[]
  174.         # 激活状态窗口
  175.      $scene = Scene_chuzhan.new(4)

  176.       when 4  # 队组5出生点
  177.         # 演奏确定 SE
  178.         $game_system.se_play($data_system.decision_se)
  179.        $出战5=[]
  180.         # 队组4出生点
  181.       $scene = Scene_chuzhan.new(5)
  182.       when 5  
  183.         $game_system.se_play($data_system.decision_se)
  184.        $出战=[]
  185.       $scene = Scene_chuzhan.new(6)
  186.       when 6  
  187.         $game_system.se_play($data_system.decision_se)
  188.        $出战=[]
  189.       $scene = Scene_chuzhan.new(7)
  190.       when 7  
  191.         $game_system.se_play($data_system.decision_se)
  192.        $出战=[]
  193.       $scene = Scene_chuzhan.new(8)
  194.       when 8  
  195.         $game_system.se_play($data_system.decision_se)
  196.        $出战=[]
  197.       $scene = Scene_chuzhan.new(9)
  198.       when 9  
  199.         $game_system.se_play($data_system.decision_se)
  200.        $出战=[]
  201.        $scene = Scene_chuzhan.new(0)


  202.       end
  203.       return
  204.     end
  205.   end

  206. end
复制代码
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2025-8-15 08:54

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表