Hello Please help! I am trying to make a pacman game in Mz and I found a script:
class Game_Player < Game_Character
attr_accessor :lock
def update_scroll(last_real_x, last_real_y)
if $lock!=1
ax1 = $game_map.adjust_x(last_real_x)
ay2 = $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
$game_map.scroll_left (ax1 - ax2) if ax2 < ax1 && ax2 < center_x
$game_map.scroll_right (ax2 - ax1) if ax2 > ax1 && ax2 > center_x
$game_map.scroll_up (ay1 - ay2) if ay2 > ay1 && ay2 > center_y
end
end
end
to move the character from the left side to the right side of the screen just have no idea how to add it!
Thanks!
class Game_Player < Game_Character
attr_accessor :lock
def update_scroll(last_real_x, last_real_y)
if $lock!=1
ax1 = $game_map.adjust_x(last_real_x)
ay2 = $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
$game_map.scroll_left (ax1 - ax2) if ax2 < ax1 && ax2 < center_x
$game_map.scroll_right (ax2 - ax1) if ax2 > ax1 && ax2 > center_x
$game_map.scroll_up (ay1 - ay2) if ay2 > ay1 && ay2 > center_y
end
end
end
to move the character from the left side to the right side of the screen just have no idea how to add it!
Thanks!