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

11,136 Responses

  1. Diplomi_rmpi表示:

    можно ли купить аттестаты за 11 можно ли купить аттестаты за 11 .

  2. RogerFaf表示:

    http://fastpillseasy.com/# ed online prescription

  3. RandyFluof表示:

    лучшие фильмы онлайн детективы фильмы 2018 смотреть онлайн

  4. Donaldabula表示:

    Generic Tadalafil 20mg price MaxPillsForMen.com cialis for sale

  5. алкоголизм лечение вывод из запоя ростов алкоголизм лечение вывод из запоя ростов .

  6. BrettTIT表示:

    Cheap Cialis: MaxPillsForMen – Cheap Cialis

  7. RogerFaf表示:

    http://fastpillseasy.com/# low cost ed meds

  8. отели нижнего новгорода в центре города отели нижнего новгорода в центре города .

  9. нижний новгород отели и гостиницы недорого [url=https://otelinizhniinovgorod-ru.ru/]нижний новгород отели и гостиницы недорого[/url] .

  10. Barrybib表示:

    Viagra without a doctor prescription Canada: FastPillsForMen – over the counter sildenafil

  11. PatrickSap表示:

    смотреть фильмы онлайн на планшете смотреть фильмы онлайн в СНГ

  12. вывод из запоя в стационаре ростов-на-дону [url=https://www.vyvod-iz-zapoya-rostov236.ru]https://www.vyvod-iz-zapoya-rostov236.ru[/url] .

  13. вывод из запоя ростов и область вывод из запоя ростов и область .

  14. лучшие отели нижнего новгорода лучшие отели нижнего новгорода .

  15. gtbike.ru [url=www.russianshop.org/vse-obo-vsem/shlagbaumy-perco.html]www.russianshop.org/vse-obo-vsem/shlagbaumy-perco.html[/url] .

  16. RogerFaf表示:

    http://fastpillsformen.com/# Buy Viagra online cheap

  17. Jeromevop表示:

    https://2bsgate.sbs/ – BlackSprut ссылка 2kmp

  18. Donaldabula表示:

    viagra without prescription buy viagra online Buy generic 100mg Viagra online

  19. RichardLog表示:

    What happens to celebrities’ outfits after a red carpet event?
    жесткое гей порно

    Every time a celebrity poses on a red carpet, countless cameras flash, forever immortalizing their outfit, preserving the hundreds or even thousands of hours it has taken to create.

    Sunday night’s Golden Globes were no different, with Zendaya channeling old Hollywood glamor in a saffron Louis Vuitton gown, Angelina Jolie wearing a dazzling crystal chain McQueen dress and Tilda Swinton donning a custom embroidered Chanel jacket.

    Online, such red carpet outfits have long afterlives as they are shared around social media, dissected by influencers and journalists alike. But the real-life fate of the garments themselves is less well-publicized. What happens to them after their moment of fame — where do they go and when are they seen again?
    The afterlives of outfits can take many different forms — some are kept in storage, some are displayed at exhibitions, some wend their way onto the open market and are auctioned, and some are bought by the celebrities wearing them. Occasionally, some don’t even survive the night.

    Over the past two decades, the outfits worn by celebrities at red carpet events have garnered more and more attention, and consequently significance, said Lucy Bishop, a specialist in handbags and fashion at auction house Sotheby’s.

    She pinpoints the Dior chartreuse embroidered gown designed by John Galliano and worn by Nicole Kidman at the 1997 Oscars as one of the earliest turning points that “changed the trajectory of red-carpet dressing,” signaling the start of fashion houses “very publicly partnering with a celebrity and sort of officially dressing them for the red carpet.”

  20. Charlesbot表示:

    http://fastpillseasy.com/# buy ed meds

發佈留言

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