if $game_player.x > $game_map.events[3].x
p "左"
end
if $game_player.x < $game_map.events[3].x
p "右"
end
if $game_player.y > $game_map.events[3].y
p "下"
end
if $game_player.y < $game_map.events[3].y
p "上"
end
if end之间调用方法。原理跟事件一样,不过可以简写不少,因为可以复制。 $game_map.events[3] 3表示事件id