利用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,211 Responses

  1. DavidRuils表示:

    amoxicillin for sale online: amoxicillin 500 mg tablet – amoxicillin order online

  2. JamesGonRy表示:

    http://prednisoneall.shop/# prednisone 10 mg brand name

  3. RobertRix表示:

    http://zithromaxall.shop/# zithromax cost australia

  4. DavidrAilk表示:

    can i purchase clomid price can you buy generic clomid no prescription how to buy generic clomid

  5. JamesGonRy表示:

    http://clomidall.com/# where to get generic clomid pills

  6. RobertRix表示:

    http://prednisoneall.com/# prednisone tablet 100 mg

  7. RobertRix表示:

    https://amoxilall.shop/# how to get amoxicillin over the counter

  8. DavidrAilk表示:

    amoxicillin 500 mg capsule where to buy amoxicillin pharmacy can you buy amoxicillin uk

  9. DavidrAilk表示:

    buy zithromax online with mastercard generic zithromax 500mg india zithromax for sale usa

  10. RobertRix表示:

    http://clomidall.shop/# buying generic clomid without insurance

  11. RobertRix表示:

    http://prednisoneall.shop/# purchase prednisone canada

  12. Danielfes表示:

    May I simply just say what a relief to find an individual who genuinely understands what they’re discussing on the web. You certainly understand how to bring an issue to light and make it important. More and more people must read this and understand this side of the story. I was surprised you aren’t more popular given that you definitely have the gift.

    http://u-tec.kr/bbs/board.php?bo_table=free&wr_id=35489

  13. RobertRix表示:

    https://prednisoneall.com/# prednisone brand name in usa

  14. DavidrAilk表示:

    order prednisone online no prescription 15 mg prednisone daily fast shipping prednisone

  15. GeraldSkese表示:

    india pharmacy mail order: indianpharmacy com – indian pharmacies safe

  16. Charlesutisa表示:

    mexican pharmaceuticals online: mexican pharmacy – mexico drug stores pharmacies

  17. MichaelFedly表示:

    https://indianpharmacy.icu/# indian pharmacy paypal

  18. RobertVex表示:

    online pharmacy canada: Licensed Canadian Pharmacy – canadian discount pharmacy

  19. GeraldSkese表示:

    mexican border pharmacies shipping to usa: buying from online mexican pharmacy – mexican border pharmacies shipping to usa

  20. MichaelFedly表示:

    https://indianpharmacy.icu/# Online medicine order

  21. Edwardalorp表示:

    Online medicine home delivery indian pharmacy delivery buy medicines online in india

  22. GeraldSkese表示:

    best canadian online pharmacy: Prescription Drugs from Canada – canadian pharmacy ratings

  23. Edwardalorp表示:

    india pharmacy Healthcare and medicines from India п»їlegitimate online pharmacies india

  24. Charlesutisa表示:

    global pharmacy canada: Large Selection of Medications – canadian discount pharmacy

  25. GeraldSkese表示:

    mexican mail order pharmacies: mexico pharmacy – mexican pharmaceuticals online

  26. GeraldSkese表示:

    canadian neighbor pharmacy: Large Selection of Medications – canadapharmacyonline

  27. GeraldSkese表示:

    mexico pharmacy: mexico pharmacy – best online pharmacies in mexico

  28. Edwardalorp表示:

    buy prescription drugs from india Generic Medicine India to USA Online medicine order

  29. Charlesutisa表示:

    п»їbest mexican online pharmacies: Mexican Pharmacy Online – mexican drugstore online

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

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