Project1

标题: "鼠标+待机+显名"不能走斜线[有工程] [打印本页]

作者: 七仙女    时间: 2008-6-24 16:59
提示: 作者被禁止或删除 内容自动屏蔽
作者: hitlerson    时间: 2008-6-24 19:19
  #--------------------------------------------------------------------------
  # ● 向右下移动
  #--------------------------------------------------------------------------
  def move_lower_right
    # 没有固定面向的场合
    unless @direction_fix
      # 朝向是右的情况下适合的面是左面、朝向是上的情况下适合的面是下面
      @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
    end
    # 下→右、右→下 的通道可以通行的情况下
    if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
       (passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
      # 更新坐标
      @x += 1
      @y += 1
      # 增加步数
      increase_steps
    elsif passable?(@x, @y, Input::DOWN) and can_go?(@x + 1, @y + 1)
      unless @direction_fix
        @direction = 2
      end
      @y += 1
      increase_steps
    elsif passable?(@x, @y, Input::RIGHT) and can_go?(@x + 1, @y + 1)
      unless @direction_fix
        @direction = 6
      end
      @x += 1
      increase_steps
    end
  end

看看这个,direction设置的还是2和6,
行走图的切图当然不会对了

     sx = @character.pattern * @cw
     if $c3_总共可用的方向数==8
       case @character.direction
       when 2
         sy = 0 * @ch
       when 4
         sy = 1 * @ch
       when 6
         sy = 2 * @ch
       when 8
         sy = 3 * @ch
       when 1
         sy = 4 * @ch
       when 3
         sy = 5 * @ch
       when 7
         sy = 6 * @ch
       when 9
         sy = 7 * @ch
       end
     else
       sy = (@character.direction - 2) / 2 * @ch
     end
     self.src_rect.set(sx, sy, @cw, @ch)



在这个下面加个方向
   # 下→右、右→下 的通道可以通行的情况下
   if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
      (passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
     # 更新坐标
     @x += 1
     @y += 1
     @direction = 7 #############################  这里
作者: 七仙女    时间: 2008-6-24 19:29
提示: 作者被禁止或删除 内容自动屏蔽
作者: hitlerson    时间: 2008-6-24 19:53
昏....

http://rpg.blue/upload_program/files/显姓名_94737192.rar [LINE]1,#dddddd[/LINE]系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
作者: 肖宋发    时间: 2008-6-25 01:41
#--------------------------------------------------------------------------
# ● 向右下移动
#--------------------------------------------------------------------------
def move_lower_right
   # 没有固定面向的场合
   unless @direction_fix
     # 朝向是右的情况下适合的面是左面、朝向是上的情况下适合的面是下面
     @direction = (@direction == 4 ? 6 : @direction == 8 ? 2 : @direction)
   end
   # 下→右、右→下 的通道可以通行的情况下
   if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
      (passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
     # 更新坐标
     @x += 1
     @y += 1
     # 增加步数
     increase_steps
   elsif passable?(@x, @y, Input::DOWN) and can_go?(@x + 1, @y + 1)
     unless @direction_fix
       @direction = 2
     end
     @y += 1
     increase_steps
   elsif passable?(@x, @y, Input::RIGHT) and can_go?(@x + 1, @y + 1)
     unless @direction_fix
       @direction = 6
     end
     @x += 1
     increase_steps
   end
end

看看这个,direction设置的还是2和6,
行走图的切图当然不会对了

    sx = @character.pattern * @cw
    if $c3_总共可用的方向数==8
      case @character.direction
      when 2
        sy = 0 * @ch
      when 4
        sy = 1 * @ch
      when 6
        sy = 2 * @ch
      when 8
        sy = 3 * @ch
      when 1
        sy = 4 * @ch
      when 3
        sy = 5 * @ch
      when 7
        sy = 6 * @ch
      when 9
        sy = 7 * @ch
      end
    else
      sy = (@character.direction - 2) / 2 * @ch
    end
    self.src_rect.set(sx, sy, @cw, @ch)



在这个下面加个方向
  # 下→右、右→下 的通道可以通行的情况下
  if (passable?(@x, @y, 2) and passable?(@x, @y + 1, 6)) or
     (passable?(@x, @y, 6) and passable?(@x + 1, @y, 2))
    # 更新坐标
    @x += 1
    @y += 1
    @direction = 7 #############################  这里 {/se}





欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1