蝙蝠群飛夜

前言: 此課程主要是利用if的條件式 ,來控制蝙蝠衍生的數量,並且在Movie Clip及Scene都加入Motion Guide,變成自我路徑與公有路徑的雙重執行,造成蝙蝠群眾飛行的亂中有序之效果。

步驟 1

產生一個Movie Clip,命名為"拍動翅膀",在"拍動翅膀"的編輯介面中的同一Layer圖層畫3種不同狀態的蝙蝠,造成有拍動翅膀的感覺(只需畫兩個簡單對立的三角形即可),如 圖 1 所示

步驟 2

 

再產生一個Movie Clip,命名為"bat",在"bat"的編輯介面中,打開Library,把"拍動翅膀"拉進來,做一段有路徑 Motion Guide的動畫(設定遵循路線方向 Orient to path direction),如 圖 2 所示

步驟 3

 

在"bat"的編輯介面的Frame1的Frame Properties之Actions,做以下設定

Set Variable: "scale" = Random(10)-100
Set Property (_target, X Position) = ../:x+Random(300)-6
Set Property (_target, X Scale) = scale

步驟 4

 

產生一個 Movie Clip,命名為"bataction",在"bat"的編輯介面中,打開Library,把"bat"拉進來,並且執行 Modify / Instance ,在Instance Properties的對話框的Instance Name 分別給予命名"bat",將時間延長為3個Frame。

再插入新的Layer2圖層,並分別在Frame1、2、3都插入Blank Keyframe。

選擇Frame 1的Frame Properties之Actions,做以下設定

Set Variable: "i" = 1
Set Variable: "max" = 90
Set Variable: "x" = GetProperty("bat",_x)

選擇Frame 2的Frame Properties之Actions,做以下設定

If (i<=max)
 Duplicate Movie Clip ("bat", "bat"&i, i)
 Set Variable: "i" = i+1
End If

選擇Frame 3的Frame Properties之Actions,做以下設定

If (i<=max)
 Duplicate Movie Clip ("bat", "bat"&i, i)
 Set Variable: "i" = i+1
End If
Go to and Play (2)

步驟 5

 

回到Scene場景來,打開Library,把"bataction"拉進來,做一段有路徑 Motion Guide的動畫。
插入一個Layer,命名為"背景夜空",確定它為最下面的圖層,畫一個漸層的天空及淡黃色的月亮。如 圖 3所示

 

執行 Control / Test Movie 預覽其效果

下載原始檔


回課程目錄