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

  1. BrainDer表示:

    https://azithromycina.pro/# buy zithromax 1000mg online

  2. Michaelhig表示:

    amoxicillin order online: buy amoxicillin online without prescription – can you purchase amoxicillin online

  3. JosephBix表示:

    https://azithromycina.pro/# order zithromax without prescription

  4. Jameswaw表示:

    can you buy zithromax over the counter in canada zithromax buy zithromax 500 mg lowest price pharmacy online

  5. DomenicEcoff表示:

    where to buy generic clomid prices: how can i get clomid prices – can i order generic clomid without rx

  6. Jameswaw表示:

    50 mg prednisone canada pharmacy prednisone 10 mg can you buy prednisone over the counter in usa

  7. BrainDer表示:

    http://prednisonea.store/# prednisone 50 mg canada

  8. Michaelhig表示:

    where can i get cheap clomid without dr prescription: can i get cheap clomid now – order cheap clomid pills

  9. JosephBix表示:

    https://amoxicillina.top/# buy cheap amoxicillin

  10. Michaelhig表示:

    amoxicillin 500 mg tablet: purchase amoxicillin 500 mg – amoxicillin 500mg capsule

  11. BrainDer表示:

    http://azithromycina.pro/# zithromax 250mg

  12. Michaelhig表示:

    can i buy zithromax over the counter: buy zithromax 1000mg online – zithromax 500

  13. Jameswaw表示:

    can i purchase clomid price buying generic clomid where to buy cheap clomid without insurance

  14. BryanAgist表示:

    zithromax online usa no prescription: zithromax z-pak price without insurance – zithromax buy

  15. BryanAgist表示:

    how to buy clomid without a prescription: can you buy generic clomid online – where to buy cheap clomid without insurance

  16. Michaelhig表示:

    buy zithromax online fast shipping: zithromax 250mg – generic zithromax medicine

  17. Jameswaw表示:

    875 mg amoxicillin cost buy amoxicillin 250mg where can i buy amoxicillin online

  18. Jameswaw表示:

    where to buy cheap clomid without insurance order generic clomid how to buy generic clomid without prescription

  19. Michaelhig表示:

    amoxicillin generic brand: order amoxicillin online uk – buy amoxicillin 500mg capsules uk

  20. Michaelhig表示:

    stromectol 3 mg dosage: ivermectin australia – stromectol 3 mg tablet

  21. Jameswaw表示:

    canadian pharmacy amoxicillin can you buy amoxicillin over the counter canada amoxicillin 500mg prescription

  22. Michaelhig表示:

    order cheap clomid without rx: where buy clomid prices – where can i buy generic clomid without insurance

  23. DomenicEcoff表示:

    minocycline manufacturer: ivermectin 5ml – ivermectin cream 1

  24. DomenicEcoff表示:

    amoxicillin canada price: amoxicillin online no prescription – where to buy amoxicillin 500mg

  25. JosephBix表示:

    https://amoxicillina.top/# cost of amoxicillin 875 mg

  26. Michaelhig表示:

    buying prednisone on line: prednisone where can i buy – prednisone

  27. Jameswaw表示:

    prednisone 5 mg tablet cost prednisone cream over the counter prednisone cheap

  28. Jameswaw表示:

    buy zithromax 500mg online cheap zithromax pills zithromax buy online

  29. Michaelhig表示:

    where can i buy amoxicillin over the counter uk: where can i buy amoxicillin without prec – amoxicillin 500 mg tablet price

  30. JosephBix表示:

    https://clomida.pro/# can i order cheap clomid without a prescription

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

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