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

  1. Thank you, I have just been searching for information about this topic for ages and yours is the greatest I’ve discovered till now. But, what about the conclusion? Are you sure about the source?

  2. Marrispisn表示:

    cheap essay writing services
    online essay writer
    essay online help

  3. Marrispisn表示:

    essay service review
    customer service essay
    essay helper app

  4. This blog post is excellent, probably because of how well the subject was developed. I like some of the comments too though I could prefer we all stay on the subject in order add value to the subject!

  5. Nevertheless, it’s all carried out with tongues rooted solidly in cheeks, and everybody has got nothing but absolutely love for their friendly neighborhood scapegoat. In reality, he is not merely a pushover. He is simply that extraordinary breed of person solid enough to take all that good natured ribbing for what it really is.

  6. Joetepisn表示:

    lesbian dating apps
    top dating
    online dating services

  7. credit repair表示:

    I had highly recommend this blog to my good friend, it’s so good

  8. fantastic post, very informative. I wonder why more of the ther experts in the field do not break it down like this. You should continue your writing. I am confident, you have a great readers’ base already!

  9. Eachellepisn表示:

    dating sites free for men
    dating usa
    american singles

  10. engelsWet表示:

    doxycycline vs minocycline It s practically impossible to overdose on vitamin B5, and if you do consume unreasonably high concentrations of this nutrient, your body will eliminate any excess pantothenic acid rapidly via urine excretion.

  11. xxx videos表示:

    Easily, the post is really the greatest on this laudable topic. I concur with your conclusions and will thirstily look forward to your future updates. Saying thank will not just be sufficient, for the wonderful c lucidity in your writing. I will instantly grab your rss feed to stay privy of any updates. Solid work and much success in your business enterprise!

  12. fachadas表示:

    Great resources and tips for families here.

  13. Arreple表示:

    doxycycline sun exposure We discovered that inlA, inlB, inlC, and inlJ internalin genes which stimulates the adhesion and internalization of L.

  14. arrindCen表示:

    nausea from doxycycline 2014 reported the fabrication of biobased hyperbranched PEA polyaniline nanofiber modified montmorillonite nanocomposites, and found the prepared polymers exhibited potent efficacy against gram- positive bacteria such as Bacillus subtilis and S.

  15. sbobet表示:

    I can’t go into details, but I have to say its a good article!

  16. You have some helpful ideas! Maybe I should consider doing this by myself.

  17. casas表示:

    bonjour I love Your Blog can not say I come here often but im liking what i c so far….

  18. Maisiepisn表示:

    best sites dating
    chat with singles
    free app for online meeting

  19. I have to say this post was certainly informative and contains useful content for enthusiastic visitors. I will definitely bookmark this website for future reference and further viewing. cheers a bunch for sharing this with us!

  20. tejados表示:

    Abnormal this put up is totaly unrelated to what I was searching google for, but it surely used to be listed at the first page. I suppose your doing one thing proper if Google likes you adequate to place you at the first page of a non similar search.

  21. This blog post is excellent, probably because of how well the subject was developed. I like some of the comments too.

  22. cocinas表示:

    I wrote down your blog in my bookmark. I hope that it somehow did not fall and continues to be a great place for reading texts.

  23. Thank you so much for sharing this wonderful post with us.

  24. XsaAdklLiZgt表示:

    Всем рекомендую этот обменник биткоин для обмена криптовалюты в России! Процесс обмена биткоин происходит от 5 до 15 минут.

  25. İzmir Escort表示:

    Does it look like we’re in for a big ride here?

  26. İzmir Eskort表示:

    Pretty impressive article. I just stumbled upon your site and wanted to say that I have really enjoyed reading your opinions. Any way I’ll be coming back and I hope you post again soon.

  27. Juanitapisn表示:

    dating sites free
    best online dating
    free dating sites online

  28. Genniepisn表示:

    free gay/bi chat
    gay teen cam chat room
    bbrt gay chat site

  29. 노팔로우表示:

    Magnificent beat ! Can I be your apprentice? Just kidding!

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

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