module Mask
def self.circle(x,y,r)
bottom_x = x
bottom_y = y
top_x = x
top_y = y
loop do
for i in -r...r
# check the bottom half circle
if self.passable?(bottom_x+i,bottom_y)
bottom_y - 1
r - 1
if top_y < y + r
@bottom = true
end
else
@bottom = false
end
# check the top half circle
if self.passable?(top_x+i,top_y)
top_y + 1
r - 1
if top_y > y+r
@top = true
end
else
@top = false
end
if @bottom = true and @top == true
return true
else return false
end
end
end
end
def self.passable?(x,y)
if $game_map.pixel_passable?(x,y,0, nil,"Tileset")
return true
else
return false
end
end
end