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

Project1

 找回密码
 注册会员
搜索

地图限制事件更新?

查看数: 3478 | 评论数: 1 | 收藏 1
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2017-1-14 23:22

正文摘要:

如图,所有的事件都是同一设置,但是根据当前画面显示的位置的不同会造成显示的错乱 是哪里限制了事件的更新?

回复

百里_飞柳 发表于 2017-1-14 23:38:04
game_event类中的第84-105行有如下设置
  #--------------------------------------------------------------------------
  # ● 自动移动的更新
  #--------------------------------------------------------------------------
  def update_self_movement
    if near_the_screen? && @stop_count > stop_count_threshold
      case @move_type
      when 1;  move_type_random
      when 2;  move_type_toward_player
      when 3;  move_type_custom
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 判定是否在画面的可视区域內
  #     dx : 从画面中央开始计算,左右有多少个图块。
  #     dy : 从画面中央开始计算,上下有多少个图块。
  #--------------------------------------------------------------------------
  def near_the_screen?(dx = 12, dy = 8)
    ax = $game_map.adjust_x(@real_x) - Graphics.width / 2 / 32
    ay = $game_map.adjust_y(@real_y) - Graphics.height / 2 / 32
    ax >= -dx && ax <= dx && ay >= -dy && ay <= dy
  end

所以事件的自定义移动路线会因为考虑到效率而超出地图画面外的不刷新。

评分

参与人数 1梦石 +1 收起 理由
VIPArcher + 1 我很赞同

查看全部评分

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

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

GMT+8, 2025-7-20 03:20

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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