Started by Geust, June 05, 2010, 11:46:52 am
e = $game_map.events[id]$game_player.center(e.x, e.y)
p = $game_player$game_player.center(p.x, p.y)
class Game_Event < Game_Character def follow=(condition) @follow = condition if condition $game_player.center(@x, @y) else p = $game_player $game_player.center(p.x, p.y) end end alias follow_update update def update if moving? $game_map.display_x = @real_x - 1064 $game_map.display_y = @real_y - 1064 end follow_update end end
class Game_Map attr_accessor :following def scroll_down(distance) return if following @display_y = [@display_y + distance, (self.height - 15) * 128].min end def scroll_left(distance) return if following @display_x = [@display_x - distance, 0].max end def scroll_right(distance) return if following @display_x = [@display_x + distance, (self.width - 20) * 128].min end def scroll_up(distance) return if following @display_y = [@display_y - distance, 0].max end endclass Game_Event < Game_Character def follow=(condition) @follow = condition if condition $game_player.center(@x, @y) $game_map.following = true else p = $game_player $game_player.center(p.x, p.y) $game_map.following = false end end alias follow_update update def update if moving? $game_map.display_x = @real_x - 1064 $game_map.display_y = @real_y - 1064 end follow_update end end