利用Box2D+WCK賦予Flash物理特性 萬有引力

這已經是第五篇Box2D+WCK的介紹文章了,前面幾篇文章如果各位有注意應該會發現,所有範例的萬有引力都跟現在我們生活的環境一樣,物件像是被地心引力給吸引著都會往下方掉落,其實我們在使用這個模組的時候,也可以改變這樣的萬有引力,讓這些物件不要往下掉落而是往我們所指定的方向移動,馬老師在這邊大概製作了三種不同類型的萬有引力範例,分述如下:

1.容器型萬有引力:這個萬有引力是利用一個封閉的空間來繪製的。

Capsule Gravity

大概的製作步驟如下:

我們可以在World元件中繪製一個如下圖的形狀:

Capsule Gravity Zone

接下來將他轉換成一個影片片段,在類別的部分輸入gravity.GravityCapsule的名稱,如下圖所示:

Capsule Gravity Symbol

接下來把這個元件拖曳到World元件裡面就可以了。

2.放射狀萬有引力:這種萬有引力是以往內或往外放射狀的方式存在。

Radial Gravity

我們可以在World元件中繪製一個如下圖的形狀:

Radial Gravity Zone

接下來將他轉換成一個影片片段,在類別的部分輸入gravity.GravityRadial的名稱,如下圖所示:

Radial Gravity Symbol

接下來把這個元件拖曳到World元件裡面就可以了。

3.正弦萬有引力:就是三角函數的sin。

Sine Gravity

我們可以在World元件中繪製一個如下圖的形狀:

Sine Gravity Zone

接下來將他轉換成一個影片片段,在類別的部分輸入gravity.GravitySine的名稱,如下圖所示:

Sine Gravity Symbol

接下來把這個元件拖曳到World元件裡面就可以了。

同樣的也讓大家可以下載以上的三個範例檔,範例檔為CS5格式,下載後要重新設定來源路徑和元件庫路徑喔!希望這個範例對大家有所幫助,如果還有疑問,也可以在這邊回應唷~

You may also like...

17,785 Responses

  1. Richardorele表示:

    zithromax: buy azithromycin zithromax – zithromax online australia

  2. Henryfet表示:

    drug prices prednisone: prednisone 80 mg daily – non prescription prednisone 20mg

  3. Charleselila表示:

    generic doxycycline: buy doxycycline for dogs – buy doxycycline without prescription uk

  4. Henryfet表示:

    neurontin 400mg: buy cheap neurontin online – neurontin brand name 800 mg

  5. Charleselila表示:

    prednisone 2.5 tablet: prednisone otc uk – buying prednisone without prescription

  6. Billyved表示:

    https://zithromaxa.store/# zithromax online no prescription

  7. Charleselila表示:

    neurontin 100 mg caps: neurontin 1800 mg – 600 mg neurontin tablets

  8. Billyved表示:

    https://prednisoned.online/# prednisone online pharmacy

  9. Billyved表示:

    http://doxycyclinea.online/# order doxycycline 100mg without prescription

  10. MarvinRoave表示:

    by prednisone w not prescription [url=http://prednisoned.online/#]prednisone 5093[/url] india buy prednisone online

  11. Henryfet表示:

    online doxycycline: doxycycline medication – odering doxycycline

  12. MarvinRoave表示:

    zithromax capsules 250mg where can i get zithromax over the counter how to get zithromax online

  13. MarvinRoave表示:

    2000 mg neurontin neurontin without prescription how to get neurontin cheap

  14. Henryfet表示:

    doxycycline without a prescription: generic doxycycline – doxycycline hyclate 100 mg cap

  15. Richardorele表示:

    amoxicillin 500mg price in canada: cost of amoxicillin 30 capsules – amoxicillin online purchase

  16. Billyved表示:

    https://gabapentinneurontin.pro/# neurontin brand name 800 mg

  17. Richardorele表示:

    buy doxycycline: doxycycline 50 mg – doxycycline 150 mg

  18. Billyved表示:

    https://prednisoned.online/# 3000mg prednisone

  19. Richardorele表示:

    price of neurontin: buy cheap neurontin – neurontin 600 mg tablet

  20. MarvinRoave表示:

    where can you get amoxicillin [url=http://amoxila.pro/#]medicine amoxicillin 500[/url] amoxicillin order online

  21. Charleselila表示:

    doxycycline 100mg tablets: doxycycline 150 mg – order doxycycline

  22. MarvinRoave表示:

    zithromax 500mg price buy zithromax canada zithromax drug

  23. WilliamThity表示:

    reputable mexican pharmacies online: mexico drug stores pharmacies – mexican mail order pharmacies

  24. Felipevon表示:

    http://pharmindia.online/# india pharmacy

  25. DavidThynC表示:

    mexican drugstore online best online pharmacies in mexico mexican pharmacy

  26. WilliamThity表示:

    mexican border pharmacies shipping to usa: mexican drugstore online – best online pharmacies in mexico

  27. DonaldFrown表示:

    no prescription medication: cheap drugs no prescription – buy pills without prescription

  28. Felipevon表示:

    http://pharmworld.store/# drugstore com online pharmacy prescription drugs

  29. DavidThynC表示:

    prescription drugs canada buy online [url=https://pharmcanada.shop/#]canadian pharmacy 24 com[/url] canadian pharmacy mall

發佈回覆給「Felipevon」的留言 取消回覆

發佈留言必須填寫的電子郵件地址不會公開。