既然得寫點東西, 就在這寫吧
3可能的bug
1.全block, unit動彈不得的情況
2.中途block, unit能走到最近target的地方嗎?
3.弓
先有一個seq
var dir_seq:Array
如target.x >= unit.x
先左,後右
先x後y嗎?
不,以distance決定
然後推進了
對!
個人感覺我的寫法可以改變一點
就是說,我找的不是最快的路徑,
不
這樣會造成unit會走到盡頭才轉彎
like this
if target.x >= unit.x
and target.y >= unit.y
and x distance>y distance
seq is
right
bottom
left
up
result:
1. no-block, 斜者可行曲線
2. 中間有block,
===
想了一個小時
自己的方法有點不行
唉..
明天還是繼續研究一下那些中文網站吧
有點像陷入了pure maths那時候的困境...
對,了解一個新的理論和應用它
沒有留言:
張貼留言