#==============================================================================
# ■ 弹性滚动地图 V 1.00 BY SLICK
#------------------------------------------------------------------------------
#  处理主角的类。事件启动的判定、以及地图的滚动等功能。
# 本类的实例请参考 $game_player。
# 我:。。。这个黄金版已经被改的面目全非了
#==============================================================================
class Game_Player < Game_Character
 
  MOVESPEA = 0.70
  OFF_SW = 1  # 打开这个开关就停用弹性滚动
 
  alias sny46_160817_update_scroll update_scroll
  def update_scroll(last_real_x, last_real_y)
    if $game_switches[OFF_SW]
      return sny46_160817_update_scroll(last_real_x, last_real_y)
    end
    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)
    movespeb = (2 ** (@move_speed+1))*MOVESPEA
    movesped = movespeb / Graphics.width
    movespec = movespeb / Graphics.height
    tmp=center_x-ax2
    $game_map.scroll_left(movesped*tmp) if tmp>0
    $game_map.scroll_right(-movesped*tmp) if tmp<0
    tmp=center_y-ay2
    $game_map.scroll_up(movespec*tmp) if tmp>0
    $game_map.scroll_down(-movespec*tmp) if tmp<0    
  end  
end