在def passable?里面,把原来的new_x,new_y修改为:
if d == 6 and (x - x.to_i >= 0.5)
new_x = x + 1
elsif d == 4 and (x - x.to_i <= 0.4)
new_x = x - 1
else
new_x = x
end
if d == 2 and (y - y.to_i >= 0.5)
new_y = y + 1
elsif d == 8 and (y - y.to_i <= 0.4)
new_y = y - 1
else
new_y = y
end
new_x = new_x.to_i
new_y = new_y.to_i
# 主角的坐标与移动目标坐标一致的情况下
if $game_player.x == new_x and $game_player.y == new_y and !self.is_a?(Game_Player)
# 穿透为 ON
unless $game_player.through
# 自己的图形是角色的情况下
if @character_name != ""
# 不能通行
return false
end
end
end
在def passable?里面,把原来的new_x,new_y修改为:
if d == 6 and (x - x.to_i >= 0.5)
new_x = x + 1
elsif d == 4 and (x - x.to_i <= 0.4)
new_x = x - 1
else
new_x = x
end
if d == 2 and (y - y.to_i >= 0.5)
new_y = y + 1
elsif d == 8 and (y - y.to_i <= 0.4)
new_y = y - 1
else
new_y = y
end
new_x = new_x.to_i
new_y = new_y.to_i
# 主角的坐标与移动目标坐标一致的情况下
if $game_player.x == new_x and $game_player.y == new_y and !self.is_a?(Game_Player)
# 穿透为 ON
unless $game_player.through
# 自己的图形是角色的情况下
if @character_name != ""
# 不能通行
return false
end
end
end