注册会员 登录
Project1 返回首页

喵呜喵5的树洞 https://rpg.blue/?291206 [收藏] [复制] [分享] [RSS]

日志

【脚本】地图卷动频率修改

热度 1已有 1008 次阅读2014-7-15 15:39 |个人分类:脚本

=begin
===============================================================================
  地图卷动频率修改 By喵呜喵5
===============================================================================

【说明】

  默认情况下,当地图的大小足够时,地图会强制进行卷动以保持玩家的位置永远在屏幕中心。
  
  这个脚本修改了卷动的频率,当玩家处在画面中心的正方形区域时地图都不会自动卷动。
  
  脚本兼容性极差,所以把脚本放在其他插件脚本之上吧。
  
  使用这个脚本可能会产生各种奇怪的BUG,因此连我自己都不用这个脚本【喂!
  
=end
$m5script = {} if $m5script.nil?
$m5script["M5MapOrz"] = true
class Game_Player
  def update_scroll(last_real_x, last_real_y)
#==============================================================================
# 设定部分
#==============================================================================

    degree  = 1
    
    # 正方形区域的大小,数字越大区域越大
    
#==============================================================================
# 设定结束
#==============================================================================    
    ax1 = $game_map.adjust_x(last_real_x)
    ay1 = $game_map.adjust_y(last_real_y)
    ax2 = $game_map.adjust_x(@real_x)
    ay2 = $game_map.adjust_y(@real_y)
    $game_map.scroll_down (ay2 - ay1) if ay2 > ay1 && ay2 > center_y + degree
    $game_map.scroll_left (ax1 - ax2) if ax2 < ax1 && ax2 < center_x - degree
    $game_map.scroll_right(ax2 - ax1) if ax2 > ax1 && ax2 > center_x + degree
    $game_map.scroll_up   (ay1 - ay2) if ay2 < ay1 && ay2 < center_y - degree
  end
end
1

鸡蛋

鲜花

刚表态过的朋友 (1 人)

评论 (0 个评论)

facelist doodle 涂鸦笔

您需要登录后才可以评论 登录 | 注册会员

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

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

GMT+8, 2024-5-15 07:35

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

返回顶部