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

7,783 Responses

  1. WilliamTeath表示:

    gГјnstige online apotheke: europa apotheke – internet apotheke

  2. Roberthep表示:

    comprare farmaci online all’estero farmacia online comprare farmaci online all’estero

  3. RalphSnize表示:

    beste online-apotheke ohne rezept: beste online-apotheke ohne rezept – medikament ohne rezept notfall

  4. Roberthep表示:

    pharmacie en ligne france pas cher pharmacie en ligne france livraison internationale Pharmacie sans ordonnance

  5. RalphSnize表示:

    eu apotheke ohne rezept: gГјnstige online apotheke – п»їshop apotheke gutschein

  6. AntoniaSut表示:

    medikamente rezeptfrei: online apotheke versandkostenfrei – online apotheke

  7. WilliamTeath表示:

    online apotheke deutschland: beste online-apotheke ohne rezept – gГјnstige online apotheke

  8. AntoniaSut表示:

    farmacias online seguras: farmacia online barata – farmacia online españa envío internacional

  9. WilliamTeath表示:

    Pharmacie sans ordonnance: acheter mГ©dicament en ligne sans ordonnance – pharmacie en ligne fiable

  10. Donaldcoums表示:

    ohne rezept apotheke: online apotheke gГјnstig – medikament ohne rezept notfall

  11. Roberthep表示:

    beste online-apotheke ohne rezept [url=https://euapothekeohnerezept.com/#]online apotheke preisvergleich[/url] online apotheke deutschland

  12. Roberthep表示:

    online apotheke deutschland europa apotheke online apotheke deutschland

  13. VernonRib表示:

    https://euapothekeohnerezept.com/# ohne rezept apotheke

  14. Roberthep表示:

    pharmacie en ligne sans ordonnance pharmacie en ligne france pas cher acheter mГ©dicament en ligne sans ordonnance

  15. VernonRib表示:

    https://eufarmacieonline.shop/# Farmacia online miglior prezzo

  16. Donaldcoums表示:

    pharmacie en ligne pas cher: pharmacie en ligne france fiable – pharmacie en ligne livraison europe

  17. AntoniaSut表示:

    Farmacia online migliore: acquisto farmaci con ricetta – comprare farmaci online all’estero

  18. WilliamTeath表示:

    farmacia online envГ­o gratis: farmacia online barata – farmacias online baratas

  19. VernonRib表示:

    http://eumedicamentenligne.com/# pharmacie en ligne sans ordonnance

  20. WilliamTeath表示:

    Farmacie online sicure: farmacia online – comprare farmaci online all’estero

  21. AntoniaSut表示:

    online apotheke rezept: online apotheke versandkostenfrei – shop apotheke gutschein

  22. WilliamTeath表示:

    apotheke online: beste online-apotheke ohne rezept – eu apotheke ohne rezept

  23. Donaldcoums表示:

    farmacia online barata: farmacia online barata y fiable – farmacias online seguras en espaГ±a

  24. Roberthep表示:

    farmacias online seguras en espaГ±a farmacias online seguras en espaГ±a п»їfarmacia online espaГ±a

  25. Sbmuro表示:

    treatment for uti opportunity – treatment for uti throw treatment for uti unknown

  26. Roberthep表示:

    farmacia online espaГ±a envГ­o internacional farmacia online barata farmacias online seguras en espaГ±a

  27. AntoniaSut表示:

    pharmacie en ligne france pas cher: acheter m̩dicament en ligne sans ordonnance РAchat m̩dicament en ligne fiable

  28. WilliamTeath表示:

    Pharmacie sans ordonnance: pharmacie en ligne pas cher – pharmacie en ligne avec ordonnance

發佈留言

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