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

Project1

 找回密码
 注册会员
搜索
查看: 366|回复: 1
打印 上一主题 下一主题

[有事请教] 问个行走图4帧和8帧同时使用后切换出现空白帧的问题

[复制链接]

Lv5.捕梦者

梦石
0
星屑
35228
在线时间
4169 小时
注册时间
2007-12-15
帖子
10072
跳转到指定楼层
1
发表于 2026-4-29 09:08:33 | 只看该作者 |只看大图 回帖奖励 |正序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 89444640 于 2026-4-29 09:15 编辑

是这样我用特殊符号+N后缀行走图表示多帧行走图的脚本以后,(张三□8代表行走图有8帧)出现了一个问题,
比如播放循环动画,正好播放到第5~6帧

然后需要切换回4帧的行走图

因为这时候是自动循环,事件触发以后鬼知道随机播放到第几帧完全无法保证播放到第1~4帧停止,
这时候会如果抽到5~6帧,会出现瞬间闪一下空白,因为4帧行走图没有4以后的,抽到了空,但是程序不能立即切换回4帧行走图的第一帧,问题理论上不大,就是看着不舒服。
更改素材名称,并且把所有4帧行走图,全都改成□8,虽然可以解决,但是工程量过大并且非常麻烦,所有事件都要重写,而且多帧行走我指不定有几帧循环,上面那张就是6帧……
请问有没有其他方法
应该是 Game_Character 2定义的吧

RUBY 代码复制
  1. #==============================================================================
  2. # ■ Game_Character (分割定义 2)
  3. #------------------------------------------------------------------------------
  4. #  处理角色的类。本类作为 Game_Player 类与 Game_Event
  5. # 类的超级类使用。
  6. #【动画N】已被覆盖,用 □N 表示4帧以上动画
  7. #==============================================================================
  8.  
  9. class Game_Character
  10.   attr_accessor :anime_speed
  11.   #--------------------------------------------------------------------------
  12.   # ● 刷新画面
  13.   #--------------------------------------------------------------------------
  14.   def update
  15.     # 跳跃中、移动中、停止中的分支
  16.     if jumping?
  17.       update_jump
  18.     elsif moving?
  19.       update_move
  20.     else
  21.       update_stop
  22.     end
  23.     # 动画计数超过最大值的情况下
  24.     # ※最大值等于基本值减去移动速度 * 1 的值
  25.     if @anime_count > MOVESPEEDLIST[Integer(@move_speed)]
  26.       # 停止动画为 OFF 并且在停止中的情况下
  27.       if not @step_anime and @stop_count > 0
  28.         # 还原为原来的图形
  29.         @pattern = @original_pattern
  30.       # 停止动画为 ON 并且在移动中的情况下
  31.       else
  32.         # 更新图形
  33.         @pattern = (@pattern + 1) % max_frame
  34.       end
  35.       # 清除动画计数
  36.       @anime_count = 0
  37.     end
  38.     # 等待中的情况下
  39.     if @wait_count > 0
  40.       # 减少等待计数
  41.       @wait_count -= 1
  42.       return
  43.     end
  44.     # 强制移动路线的场合
  45.     if @move_route_forcing
  46.       # 自定义移动
  47.       move_type_custom
  48.       return
  49.     end
  50.     # 事件执行待机中并且为锁定状态的情况下
  51.     if @starting or lock?
  52.       # 不做规则移动
  53.       return
  54.     end
  55.     # 如果停止计数超过了一定的值(由移动频度算出)
  56.     if @stop_count > (40 - @move_frequency * 2) * (6 - @move_frequency)
  57.       # 移动类型分支
  58.       case @move_type
  59.       when 1  # 随机
  60.         move_type_random
  61.       when 2  # 接近
  62.         move_type_toward_player
  63.       when 3  # 自定义
  64.         move_type_custom
  65.       when 4 #毛玉诱饵
  66.         #接近事件(YOU_ER)
  67.       when 5 #追杀
  68.         move_type_toward_player#往事件移动(0)
  69.       when 6 #避开
  70.         move_away_from_player
  71.       when 7 #回程
  72.         往坐标移动(self.原位[0],self.原位[1])
  73.       end
  74.     end
  75.   end
  76.   #--------------------------------------------------------------------------
  77.   # ● 更新画面 (跳跃)
  78.   #--------------------------------------------------------------------------
  79.   def update_jump
  80.     # 跳跃计数减 1
  81.     @jump_count -= 1
  82.     # 计算新坐标
  83.     @real_x = (@real_x * @jump_count + @x * 128) / (@jump_count + 1)
  84.     @real_y = (@real_y * @jump_count + @y * 128) / (@jump_count + 1)
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● 更新画面 (移动)
  88.   #--------------------------------------------------------------------------
  89.   def update_move
  90.     # 移动速度转换为地图坐标系的移动距离
  91.     distance = 2 ** @move_speed
  92.     # 理论坐标在实际坐标下方的情况下
  93.     if @y * 128 > @real_y
  94.       # 向下移动
  95.       @real_y = [@real_y + distance, @y * 128].min
  96.     end
  97.     # 理论坐标在实际坐标左方的情况下
  98.     if @x * 128 < @real_x
  99.       # 向左移动
  100.       @real_x = [@real_x - distance, @x * 128].max
  101.     end
  102.     # 理论坐标在实际坐标右方的情况下
  103.     if @x * 128 > @real_x
  104.       # 向右移动
  105.       @real_x = [@real_x + distance, @x * 128].min
  106.     end
  107.     # 理论坐标在实际坐标上方的情况下
  108.     if @y * 128 < @real_y
  109.       # 向上移动
  110.       @real_y = [@real_y - distance, @y * 128].max
  111.     end
  112.     # 移动时动画为 ON 的情况下
  113.     if @walk_anime
  114.       # 动画计数增加 1.5
  115.       @anime_count += 1.5
  116.     # 移动时动画为 OFF、停止时动画为 ON 的情况下
  117.     elsif @step_anime
  118.       # 动画计数增加 1
  119.       @anime_count += 1
  120.     end
  121.   end
  122.   #--------------------------------------------------------------------------
  123.   # ● 更新画面 (停止)
  124.   #--------------------------------------------------------------------------
  125.   def update_stop
  126.     # 停止时动画为 ON 的情况下
  127.     if @step_anime
  128.       # 动画计数增加 1
  129.       @anime_count += 1
  130.     # 停止时动画为 OFF 并且、现在的图像与原来的不同的情况下
  131.     elsif @pattern != @original_pattern
  132.       # 动画计数增加 1.5
  133.       @anime_count += 1.5
  134.     end
  135.     # 事件执行待机中并且不是锁定状态的情况下
  136.     # ※缩定、处理成立刻停止执行中的事件
  137.     unless @starting or lock?
  138.       # 停止计数增加 1
  139.       @stop_count += 1
  140.     end
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # ● 移动类型 : 随机
  144.   #--------------------------------------------------------------------------
  145.   def move_type_random
  146.     if @领地 != nil
  147.       if @x < @领地[0] or @y < @领地[1] or @x > @领地[2] or @y > @领地[3]
  148.         往坐标移动(self.原位[0],self.原位[1])
  149.         return
  150.       end
  151.     end
  152.     # 随机 0~5 的分支
  153.     case rand(6)
  154.     when 0..3  # 随机
  155.       move_random
  156.     when 4  # 前进一步
  157.       move_forward
  158.     when 5  # 暂时停止
  159.       @stop_count = 0
  160.     end
  161.   end
  162.   #--------------------------------------------------------------------------
  163.   # ● 移动类型 : 接近
  164.   #--------------------------------------------------------------------------
  165.   def move_type_toward_player
  166.     # 求得与主角坐标的差
  167.     # 当开关212重力开关打开时判定位置
  168.     sx = @x - $game_player.x
  169.     a = $game_switches[212] ? 1 : 0
  170.     sy = @y - $game_player.y - a
  171.     # 求得差的绝对值
  172.     abs_sx = sx > 0 ? sx : -sx
  173.     abs_sy = sy > 0 ? sy : -sy
  174.     # 如果纵横共计离开 20 个元件
  175.     if sx + sy >= 20
  176.       # 随机
  177.       move_random
  178.       return
  179.     end
  180.     # 随机 0~5 的分支
  181.     case rand(6)
  182.     when 0..3  # 接近主角
  183.       move_toward_player
  184.     when 4  # 随机
  185.       move_random
  186.     when 5  # 前进一步
  187.       move_forward
  188.     end
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ● 移动类型 : 自定义
  192.   #--------------------------------------------------------------------------
  193.   def move_type_custom
  194.     # 如果不是停止中就中断
  195.     if jumping? or moving?
  196.       return
  197.     end
  198.     # 如果在移动指令列表最后结束还没到达就循环执行
  199.     while @move_route_index < @move_route.list.size
  200.       # 获取移动指令
  201.       command = @move_route.list[@move_route_index]
  202.       # 指令编号 0 号 (列表最后) 的情况下
  203.       if command.code == 0
  204.         # 选项 [反复动作] 为 ON 的情况下
  205.         if @move_route.repeat
  206.           # 还原为移动路线的最初索引
  207.           @move_route_index = 0
  208.         end
  209.         # 选项 [反复动作] 为 OFF 的情况下
  210.         unless @move_route.repeat
  211.           # 强制移动路线的场合
  212.           if @move_route_forcing and not @move_route.repeat
  213.             # 强制解除移动路线
  214.             @move_route_forcing = false
  215.             # 还原为原始的移动路线
  216.             @move_route = @original_move_route
  217.             @move_route_index = @original_move_route_index
  218.             @original_move_route = nil
  219.           end
  220.           # 清除停止计数
  221.           @stop_count = 0
  222.         end
  223.         return
  224.       end
  225.       # 移动系指令 (向下移动~跳跃) 的情况下
  226.       if command.code <= 14
  227.         # 命令编号分支
  228.         case command.code
  229.         when 1  # 向下移动
  230.           move_down
  231.         when 2  # 向左移动
  232.           move_left
  233.         when 3  # 向右移动
  234.           move_right
  235.         when 4  # 向上移动
  236.           move_up
  237.         when 5  # 向左下移动
  238.           move_lower_left
  239.         when 6  # 向右下移动
  240.           move_lower_right
  241.         when 7  # 向左上移动
  242.           move_upper_left
  243.         when 8  # 向右上
  244.           move_upper_right
  245.         when 9  # 随机移动
  246.           move_random
  247.         when 10  # 接近主角
  248.           move_toward_player
  249.         when 11  # 远离主角
  250.           move_away_from_player
  251.         when 12  # 前进一步
  252.           move_forward
  253.         when 13  # 后退一步
  254.           move_backward
  255.         when 14  # 跳跃
  256.           jump(command.parameters[0], command.parameters[1])
  257.         end
  258.         # 选项 [无视无法移动的情况] 为 OFF 、移动失败的情况下
  259.         if not @move_route.skippable and not moving? and not jumping?
  260.           return
  261.         end
  262.         @move_route_index += 1
  263.         return
  264.       end
  265.       # 等待的情况下
  266.       if command.code == 15
  267.         # 设置等待计数
  268.         @wait_count = command.parameters[0] * 2 - 1
  269.         @move_route_index += 1
  270.         return
  271.       end
  272.       # 朝向变更系指令的情况下
  273.       if command.code >= 16 and command.code <= 26
  274.         # 命令编号分支
  275.         case command.code
  276.         when 16  # 面向下
  277.           turn_down
  278.         when 17  # 面向左
  279.           turn_left
  280.         when 18  # 面向右
  281.           turn_right
  282.         when 19  # 面向上
  283.           turn_up
  284.         when 20  # 向右转 90 度
  285.           turn_right_90
  286.         when 21  # 向左转 90 度
  287.           turn_left_90
  288.         when 22  # 旋转 180 度
  289.           turn_180
  290.         when 23  # 从右向左转 90 度
  291.           turn_right_or_left_90
  292.         when 24  # 随机变换方向
  293.           turn_random
  294.         when 25  # 面向主角的方向
  295.           turn_toward_player
  296.         when 26  # 背向主角的方向
  297.           turn_away_from_player
  298.         end
  299.         @move_route_index += 1
  300.         return
  301.       end
  302.       # 其它指令的场合
  303.       if command.code >= 27
  304.         # 命令编号分支
  305.         case command.code
  306.         when 27  # 开关 ON
  307.           $game_switches[command.parameters[0]] = true
  308.           $game_map.need_refresh = true
  309.         when 28  # 开关 OFF
  310.           $game_switches[command.parameters[0]] = false
  311.           $game_map.need_refresh = true
  312.         when 29  # 更改移动速度
  313.           @move_speed = command.parameters[0]
  314.         when 30  # 更改移动频度
  315.           @move_frequency = command.parameters[0]
  316.         when 31  # 移动时动画 ON
  317.           @walk_anime = true
  318.         when 32  # 移动时动画 OFF
  319.           @walk_anime = false
  320.         when 33  # 停止时动画 ON
  321.           @step_anime = true
  322.         when 34  # 停止时动画 OFF
  323.           @step_anime = false
  324.         when 35  # 朝向固定 ON
  325.           @direction_fix = true
  326.         when 36  # 朝向固定 OFF
  327.           @direction_fix = false
  328.         when 37  # 穿透 ON
  329.           @through = true
  330.         when 38  # 穿透 OFF
  331.           @through = false
  332.         when 39  # 在最前面显示 ON
  333.           @always_on_top = 1
  334.         when 40  # 在最前面显示 OFF
  335.           @always_on_top = 0
  336.         when 41  # 更改图形
  337.           @tile_id = 0
  338.           @character_name = command.parameters[0]
  339.           @character_hue = command.parameters[1]
  340.           if @original_direction != command.parameters[2]
  341.             @direction = command.parameters[2]
  342.             @original_direction = @direction
  343.             @prelock_direction = 0
  344.           end
  345.           if @original_pattern != command.parameters[3]
  346.             @pattern = command.parameters[3]
  347.             @original_pattern = @pattern
  348.           end
  349.         when 42  # 不更改不透明度
  350.           @opacity = command.parameters[0]
  351.         when 43  # 更改合成方式
  352.           @blend_type = command.parameters[0]
  353.         when 44  # 演奏 SE
  354.           $game_system.se_play(command.parameters[0])
  355.         when 45  # 脚本
  356.           result = eval(command.parameters[0])
  357.         end
  358.         @move_route_index += 1
  359.       end
  360.     end
  361.   end
  362.   #--------------------------------------------------------------------------
  363.   # ● 增加步数
  364.   #--------------------------------------------------------------------------
  365.   def increase_steps
  366.     # 清除停止步数
  367.     @stop_count = 0
  368.   end
  369.  
  370.   def 接近事件(id)
  371.     # 求得与主角坐标的差
  372.     sx = @x - $game_map.events[id].x
  373.     sy = @y - $game_map.events[id].y
  374.     # 求得差的绝对值
  375.     abs_sx = sx > 0 ? sx : -sx
  376.     abs_sy = sy > 0 ? sy : -sy
  377.     # 如果纵横共计离开 20 个元件
  378.     if sx + sy >= 20
  379.       # 随机
  380.       move_random
  381.       return
  382.     end
  383.     # 随机 0~5 的分支
  384.     case rand(6)
  385.     when 0..3  # 接近主角
  386.       往事件移动(id)
  387.     when 4  # 随机
  388.       move_random
  389.     when 5  # 前进一步
  390.       move_forward
  391.     end
  392.   end
  393.  
  394.   def 往事件移动(id)
  395.     x,y = 事件(id).x,事件(id).y
  396.     sx = @x - x
  397.     sy = @y - y
  398.     # 求得差的绝对值
  399.     abs_sx = sx.abs
  400.     abs_sy = sy.abs
  401.     # 横距离与纵距离相等的情况下
  402.     if abs_sx == abs_sy
  403.       # 随机将边数增加 1
  404.       rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
  405.     end
  406.     # 横侧距离长的情况下
  407.     if abs_sx > abs_sy
  408.       智能前进(sx > 0 ? 4 : 6,[x,y])
  409.     # 竖侧距离长的情况下
  410.     else
  411.       智能前进(sy > 0 ? 8 : 2,[x,y])
  412.     end
  413.   end
  414.   #--------------------------------------------------------------------------
  415.   # ● 可以通行的情况下前进,否则向随机方向转换
  416.   #--------------------------------------------------------------------------
  417.   def 智能前进(direction,xy= nil)
  418.     d = direction == 0 ? @direction : direction
  419.     case d
  420.     when 8 ;turn_up
  421.     when 6 ;turn_right
  422.     when 4 ;turn_left
  423.     when 2 ;turn_down
  424.     end
  425.     unless moving?
  426.       if passable?(@x, @y, d)
  427.         @ex_d = 0
  428.         move_forward
  429.       else
  430.         找路(direction,xy)
  431.       end
  432.     end
  433.   end
  434.  
  435.   def 找路(d,xy)
  436.     if @ex_d != 0
  437.       if passable?(@x,@y,@ex_d)
  438.         case @ex_d
  439.         when 2 ; move_down
  440.         when 4 ; move_left
  441.         when 6 ; move_right
  442.         when 8 ; move_up
  443.         end
  444.       else
  445.         @ex_d = 0
  446.       end
  447.     else
  448.       case d
  449.       when 2,8
  450.         x,y,n = @x,@y,0
  451.         while passable?(x,y,4)
  452.           x -= 1
  453.           if passable?(x,y,d)
  454.             n -= 1000
  455.             break
  456.           end
  457.           n += 1
  458.         end
  459.         x,y,m = @x,@y,0
  460.         while passable?(x,y,6)
  461.           x += 1
  462.           if passable?(x,y,d)
  463.             m -= 1000
  464.             break
  465.           end
  466.           m += 1
  467.         end
  468.         if n < m
  469.           @ex_d = 4
  470.         else
  471.           @ex_d = 6
  472.         end
  473.       when 4,6
  474.         x,y,n = @x,@y,0
  475.         while passable?(x,y,2)
  476.           y += 1
  477.           if passable?(x,y,d)
  478.             n -= 1000
  479.             break
  480.           end
  481.           n += 1
  482.         end
  483.         x,y,m = @x,@y,0
  484.         while passable?(x,y,8)
  485.           y -= 1
  486.           if passable?(x,y,d)
  487.             m -= 1000
  488.             break
  489.           end
  490.           m += 1
  491.         end
  492.         if n < m
  493.           @ex_d = 2
  494.         else
  495.           @ex_d = 8
  496.         end
  497.       end
  498.     end
  499.   end
  500.  
  501.   def 往坐标移动(x,y,启动=0)
  502.     sx = @x - x
  503.     sy = @y - y
  504.     # 坐标相等情况下
  505.     if sx == 0 and sy == 0
  506.       if self.is_a?(Game_Event) and 启动 != 0 and @启动 != nil
  507.         if not jumping?
  508.           k(K到目标)
  509.           start
  510.         end
  511.       end
  512.       @启动 = nil
  513.       return
  514.     end
  515.     @启动 = true
  516.     # 求得差的绝对值
  517.     abs_sx = sx.abs
  518.     abs_sy = sy.abs
  519.     # 横距离与纵距离相等的情况下
  520.     if abs_sx == abs_sy
  521.       # 随机将边数增加 1
  522.       rand(2) == 0 ? abs_sx += 1 : abs_sy += 1
  523.     end
  524.     # 横侧距离长的情况下
  525.     if abs_sx > abs_sy
  526.       智能前进(sx > 0 ? 4 : 6,[x,y])
  527.     # 竖侧距离长的情况下
  528.     else
  529.       智能前进(sy > 0 ? 8 : 2,[x,y])
  530.     end
  531.   end
  532.   #------------------------------------------------------------
  533.   def 路线(*ary) #[x,y,0智1直],"表达式",:循环
  534.     return if @hp.nil?
  535.     if ary[@hp].is_a?(Array)
  536.       @hp += 1 if goto(ary[@hp])
  537.     elsif ary[@hp].is_a?(String)
  538.       eval(ary[@hp]) ; @hp += 1
  539.     elsif ary[@hp] == :循环
  540.       @hp = 0
  541.     else
  542.       if @list.any?{|i| i.code == 118 and i.parameters[0].include?("&")}
  543.         @hp = :终点启动 ;start
  544.       else
  545.         @hp = nil
  546.       end
  547.     end
  548.   end
  549.   def goto(ary) #[x,y,直行]
  550.     if ary[2] == 1
  551.       return to坐标(ary) == 2
  552.     else
  553.       return 绕路前进(ary)
  554.     end
  555.   end
  556.   def to坐标(ary,绕=false) #[x,y,直行] #返回 不通0 ;通1 ;终点2
  557.     sx = (@x - ary[0]).to_i ;sy = (@y - ary[1]).to_i
  558.     m = 0 ; m = 1 ifand !ary[0].f? and 事件(0).a_xy == ary[0,2]
  559.     a,b = sx.abs,sy.abs
  560.     return 2 if a + b <= m
  561.     (rand(2) == 0 ? a += 1 : b += 1) if a == b
  562.     return (move_dir?(a > b ? (sx > 0 ? 4 : 6) : (sy > 0 ? 8 : 2)) ? 1 : 0)
  563.   end
  564.  
  565.   def 此路(rx,ry,dir) # rx ry :穷举的数值曲线,返回可通行的距离
  566.     x,y = @x,@y ; n = 0
  567.     nd = ry == 0 ? (rx < 0 ? 4 : 6) : (ry < 0 ? 8 : 2)
  568.     while !passable?(x,y,dir)
  569.       return [9999,nd] if !passable?(x,y,nd) #探路方向不通
  570.       x += rx ; y += ry ; n += 1
  571.     end
  572.     return [n,nd] #[距离,方向]
  573.   end
  574.   def 靠左探索?(ad,bd) #ad前进方向,bd目标方向,获得按左还是右探索
  575.     case ad
  576.     when 2 ;return bd == 6
  577.     when 4 ;return bd == 2
  578.     when 6 ;return bd == 8
  579.     when 8 ;return bd == 4
  580.     end
  581.   end
  582.   def 摸墙方向
  583.     case @摸墙[3]
  584.     when 2 ;return @摸墙[1] ? 6 : 4
  585.     when 4 ;return @摸墙[1] ? 2 : 8
  586.     when 6 ;return @摸墙[1] ? 8 : 2
  587.     when 8 ;return @摸墙[1] ? 4 : 6
  588.     end
  589.   end
  590.  
  591.   def 绕路前进(ary)
  592.     if @摸墙 != nil
  593.       摸墙探索(ary)
  594.       return false
  595.     end
  596.     sx = (@x - ary[0]).to_i ; sy = (@y - ary[1]).to_i ; a,b = sx.abs,sy.abs
  597.     m = ary[0].f? ? 0 : 事件(0).a_xy == ary[0,2] ? 1 : 0
  598.     return true if a + b <= m #到达目的地
  599.     (rand(2) == 0 ? a += 1 : b += 1) if a == b
  600.     dir = (a > b ? (sx > 0 ? 4 : 6) : (sy > 0 ? 8 : 2))
  601.     return false if move_dir?(dir) #可前进
  602.     #[0目的坐标线,1靠左探索?,2目的方向,3探索方向]
  603.     @摸墙 = [[[nil,@y+1],[@x-1,nil],[@x+1,nil],[nil,@y-1]][dir / 2 - 1]]
  604.     nd = 确定探索方向(dir,ary)
  605.     @摸墙.push(靠左探索?(nd,dir),dir,nd)
  606.     return false
  607.   end
  608.  
  609.   def 确定探索方向(dir,ary)
  610.     f = [[1,0],[0,1],[0,1],[1,0]][dir / 2 - 1] #寻找最近的通路
  611.     a = 此路(f[0],f[1],dir) ; b = 此路(-f[0],-f[1],dir)
  612.     if a[0] == b[0]
  613.       sx = (@x - ary[0]).to_i ; sy = (@y - ary[1]).to_i
  614.       return ([4,6].include?(dir) ? (sy < 0 ? 2 : 8) : (sx < 0 ? 6 : 4))
  615.     end
  616.     return (a[0] < b[0] ? a[1] : b[1])
  617.   end
  618.  
  619.   def 摸墙探索(ary) #[0目的坐标线,1靠左探索?,2目的方向,3探索方向]
  620.     (@摸墙 = nil ; return) if @x==@摸墙[0][0] or @y==@摸墙[0][1] #到达目标线
  621.     if @摸墙[1] != nil and move_dir?(a = 摸墙方向,false) #摸墙方向可通行
  622.       @摸墙[1] = nil if a == @摸墙[2] #是目的方向
  623.       @摸墙[3] = a #改变探索方向
  624.       return
  625.     end
  626.     return if move_dir?(@摸墙[3]) #探索方向可前进
  627.     if @摸墙[1].nil?
  628.       @摸墙[3] = 确定探索方向(@摸墙[3],ary)
  629.       @摸墙[1] = 靠左探索?(@摸墙[2],@摸墙[3])
  630.       return
  631.     end
  632.     return if move_dir?(10 - a) #换个方向可通行
  633.   end
  634. end

Lv4.逐梦者

梦石
0
星屑
8026
在线时间
1051 小时
注册时间
2012-4-3
帖子
1283

开拓者

2
发表于 2026-5-21 22:34:56 手机端发表。 | 只看该作者
可以在当前事件行走图改变的时候,加一句:@pattern = 0。(这个pattern数值是行走图对应帧,值为0时是第1帧。)
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2026-6-4 12:03

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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