那就另找士兵?
那是每一round運算時間是2xnxm,現在是<2xnxm
可能能降低至nxm,快了一半。
那就用第二種方法吧。
可能的bug?目標死了,那就另找目標吧。
需要雙方都有這個尋找嗎?還是一方就行?
因為近是雙面的,你離a近代表a離你也近。
那就。。
電腦依靠玩家士兵的距離感來決定該殺誰?
bug可能出於次序問題。
1. a find path
2. if the old distance is same or shorter, just remain. else, find a new one.
3. a walk, random at walk up or left
4. yeah, b gotta find path too, otherwise, there must be bug
then the sequence of units is another problem now.
it cannot say all units attack together.
the sequence base on the sequence of putting units.
if defense, then how?
the athogithm of defense is base on grid.
that need recursive function.
yeah, that will work.
and then the computer's ai?
how to put units?
i guess i will give it limited numbers of units.
actually players vs me.
and then the campign story?
that needs lots of drawing.
2010年12月25日 星期六
2010年12月16日 星期四
又搞了一個晚上
這晚搞的還是drag and drop
不過加了更多功能
麻煩的是用戶把war zone上的物件扔掉
flash沒有一個內設的function可把物件的listen全移除
最後終於找到一段自寫的recurise function來解決這問題
高興
不過加了更多功能
麻煩的是用戶把war zone上的物件扔掉
flash沒有一個內設的function可把物件的listen全移除
最後終於找到一段自寫的recurise function來解決這問題
高興
2010年12月15日 星期三
這幾天終於開始動工
之前一直忙考試的事,一直把fyp荒廢(罪惡感。。)
終於開始正式的搞。
計劃了一陣子,決定從programming開始搞。
今天搞drag n drop然後建立unit的部份。
進展挺好的。
一晚的時間完成了近100行code。
重拾很多技巧。
當然包括flash中class的運用。
這感覺真好,不斷解決困難的感覺。
終於開始正式的搞。
計劃了一陣子,決定從programming開始搞。
今天搞drag n drop然後建立unit的部份。
進展挺好的。
一晚的時間完成了近100行code。
重拾很多技巧。
當然包括flash中class的運用。
這感覺真好,不斷解決困難的感覺。
訂閱:
文章 (Atom)