利用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...

16,164 Responses

  1. ArmandoSausy表示:

    http://edpill.top/# best ed meds online

  2. Philiputipt表示:

    buy prescription drugs online without doctor buying prescription drugs in canada purchasing prescription drugs online

  3. Harveyicofs表示:

    http://onlinepharmacyworld.shop/# cheapest pharmacy to fill prescriptions without insurance

  4. Philiputipt表示:

    pharmacy online no prescription best online pharmacy without prescriptions meds online without prescription

  5. ArmandoSausy表示:

    http://medicationnoprescription.pro/# meds online without prescription

  6. Harveyicofs表示:

    http://edpill.top/# best ed meds online

  7. MatthewSox表示:

    buy medication online no prescription: online pharmacies no prescription usa – no prescription drugs

  8. MatthewSox表示:

    canada prescription drugs online: buy prescription online – best no prescription online pharmacy

  9. ArmandoSausy表示:

    https://edpill.top/# ed pills online

  10. Philiputipt表示:

    online pharmacy discount code legal online pharmacy coupon code drugstore com online pharmacy prescription drugs

  11. ArmandoSausy表示:

    http://medicationnoprescription.pro/# online medication without prescription

  12. Bwpotf表示:

    buy clarinex pills for sale – buy ventolin 2mg without prescription ventolin inhalator uk

  13. Austinnet表示:

    erectile dysfunction medications online: online ed drugs – ed treatment online

  14. ArmandoSausy表示:

    http://medicationnoprescription.pro/# online medicine without prescription

  15. Austinnet表示:

    canadian pharmacy world coupon: pharmacy no prescription required – canadian online pharmacy no prescription

  16. HarveyLaree表示:

    http://medicationnoprescription.pro/# buying prescription drugs from canada online

  17. MatthewSox表示:

    online meds without prescription: best online pharmacy no prescription – online pharmacy not requiring prescription

  18. Philiputipt表示:

    prescription online canada prescription drugs online canada online no prescription pharmacy

  19. Philiputipt表示:

    promo code for canadian pharmacy meds online pharmacy no prescription needed international pharmacy no prescription

  20. HarveyLaree表示:

    https://onlinepharmacyworld.shop/# online pharmacy prescription

  21. MatthewSox表示:

    canadian prescription pharmacy: canadian pharmacy discount coupon – online pharmacy no prescription needed

  22. ArmandoSausy表示:

    http://medicationnoprescription.pro/# canadian prescription

  23. Michaelhig表示:

    zithromax online usa no prescription: zithromax purchase online – can you buy zithromax over the counter in mexico

  24. JosephBix表示:

    https://prednisonea.store/# canine prednisone 5mg no prescription

  25. Michaelhig表示:

    1250 mg prednisone: prednisone pill – cheap generic prednisone

  26. BryanAgist表示:

    amoxicillin buy online canada: buy amoxicillin 250mg – can you buy amoxicillin over the counter in canada

  27. Jameswaw表示:

    prednisone 50 mg for sale prednisone 50 mg prices where can i buy prednisone

  28. BrainDer表示:

    https://prednisonea.store/# cost of prednisone 5mg tablets

  29. BryanAgist表示:

    average cost of generic zithromax: zithromax – generic zithromax azithromycin

  30. Michaelhig表示:

    amoxicillin 50 mg tablets: amoxicillin in india – medicine amoxicillin 500mg

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

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