AdvancED Game Design with Flash-0

AdvancED Game Design with Flash 讀書筆記
這本書不知道要看多久…原文Orz...













p26.專案的資料夾結構

HelloWorld project folder專案資料夾
assets This folder contains the extra things that you use in your project, like images, video, and
sound. 其它需要在這個專案中用到的東西,像圖片、影像、聲音...
deploy This optional folder is used for the final published form that your game takes, such as
part of an HTML file.最後發佈時產生的檔案,例如HTML檔,這個資料不是必要的。
bin This is the destination folder for compiled SWFs. “bin” is short for “binary,” which is another
way of referring to finished, compiled programs. 發佈的SWF檔
src This is the location of your project-specific AS source files. If you’re using Flash Professional, it will
also be the location of your main FLA file.AS程式碼、FLA檔

p26.Flex metadata tag
ex:
[SWF(backgroundColor = "0xFFFFFF",
frameRate = "60", width = "550", height = "400")]
發佈swf時,為swf加入額外的訊息,像背景色、場景大小等...
也可嵌入字型、圖片、聲音等class會用到的元件。

p33.提昇Flash的一些方法
*Bit-block transfer:目前Flash有一個瓶頸,就是顯示物件和影片物件全都放在場景上,使用 bit-block transfer(或稱作blitting)方法,可以立即增進2~5倍的效能,而且不用改太多code (在第六章有相關的教學)
*Streamline your logic
*Use the Vector class for arrays that contain the same data types:若是一組資料的資料型態都相同,使用Vector class來取代 Array class ( Flash Player 10 以上才開始有Vector這個資料型別)
Use uint instead of Math.floor:使用uint取代Math.floor來取得整數,執行速度較快,但不能用在負數
Multiplication is almost twice as fast as division:乘法的執行速度比除法快兩倍(能用乘法就用乘法,ex:
x=x/2
可改寫成:
x=x*0.5
*Use lookup tables as much as possible:儘量使用lookup tables(查找表)(在第六章有相關的教學)
*Avoid creating and destroying objects unnecessarily:非必要時,不要建立或移除物件,如果有物件待會兒可能會再用到,寧願把它的visible設成false暫時先隱藏,而不要先移除,等到用時再新增。(對FlashPlayer而言,暫時隱藏會比重新建立一個物件的效能好)
*Consider object pooling:一開始就先建立好可能要用的物件,要用時再設初值給這些物件。
*Bitwise operations are sometimes faster:使用位元運算子(Bitwise operators) 通常執行速度會快一些。
Category:

1 意見:

Unknown 提到...

想不到竟然 Google 到你的文章~佩服