for i in 1..20
if $game_map.events.direction == 2
x = $game_player.x
y = $game_player.y
x1 = $game_map.events.x
y1 = $game_map.events.y
if (x - x1).abs ** 2 + (
y - y1).abs ** 2 <= 25 and (y - y1) >= 0
$game_switches[202+(6*(i-1))]=true
break
end;end;end