188.99 KB, 下载次数: 65
189.79 KB, 下载次数: 71
def astarmove(to = 0,from = "self") from = @id if from=="self" from = from==0 ? $game_player : $game_map.events[from] to = to==0 ? $game_player : $game_map.events[to] #p from.id,to.id if from.is_a?(Game_Event) unless from.moving? if (from.x-to.x).abs<=1 and (from.y-to.y).abs<=1 else if !@dr @astr = AStar.new($game_map) @astr.set_origin(from.x,from.y) @astr.set_target(to.x,to.y) @dr = @astr.do_search[0..5] else move_dr(@dr.shift) @dr = nil if @dr.empty? end end end end
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |