Advertisement
LiTTleDRAgo

[RGSS] XAS Smooth Scroller

Oct 21st, 2011
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.46 KB | None | 0 0
  1.     #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  2.     # XAS Smooth Scroller
  3.     # Version: 1.01
  4.     #:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:
  5.  
  6.  
  7.     class Game_Player
  8.      
  9.      #--------------------------------------------------------------------------
  10.      # ● Scroll Map Update
  11.      #--------------------------------------------------------------------------
  12.      def scroll_map_update(last_real_x,last_real_y)
  13.         if @real_y - $game_map.display_y > 15*128 - 240*4
  14.           $game_map.scroll_down(@real_y > $game_map.height*128 - 240*4 ?
  15.             (($game_map.height - 15)*128 - $game_map.display_y)/16.0 :
  16.             ((@real_y - $game_map.display_y - 15*128 + 240*4)/16.0))
  17.         end
  18.         if @real_x - $game_map.display_x < 320*4
  19.           $game_map.scroll_left(@real_x < 320*4 ? $game_map.display_x/16.0 :
  20.             (($game_map.display_x + 320*4  - @real_x)/16.0))
  21.         end
  22.         if @real_x - $game_map.display_x > 20*128 - 320*4
  23.           $game_map.scroll_right(@real_x > $game_map.width*128 - 320*4  ?
  24.             (($game_map.width - 20)*128 - $game_map.display_x)/16.0 :
  25.             (@real_x - $game_map.display_x - 20*128 + 320*4 )/16.0)
  26.         end
  27.         if @real_y - $game_map.display_y < 240*4
  28.             $game_map.scroll_up(@real_y < 240*4 ?  $game_map.display_y/16.0 :
  29.           (($game_map.display_y+240*4-@real_y)/16.0))
  30.         end
  31.      end
  32.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement