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

4,664 Responses

  1. Cthrinepisn表示:

    best college essay editing service
    custom essays writing
    custom essay company

  2. Gun for sale表示:

    The information shared is of top quality which has to get appreciated at all levels. Well done…

  3. Going Here表示:

    You certainly deserve a round of applause for your post and more specifically, your blog in general. Very high quality material!

  4. Visit Link表示:

    Just came from google to your website have to say thanks.

  5. Leilahpisn表示:

    higher english critical essay help
    online essay service
    national junior honor society essay help

  6. Leilahpisn表示:

    help with an essay
    college application essay writing help
    buy an essay cheap

  7. This information is critically needed, thanks.

  8. A friend of mine advised this site. And yes. it has some useful pieces of info and I enjoyed scaning it. Therefore i would love to drop you a quick note to express my thank. Take care

  9. Twylapisn表示:

    help on writing an essay
    help writing a compare and contrast essay
    essay writer website

  10. Twylapisn表示:

    custom essay org
    pay for someone to write my essay
    mba application essay writing service

  11. Took me time to read the material, but I truly loved the article. It turned out to be very useful to me.

  12. Dronapisn表示:

    us essay writers
    college essay community service
    helping others essays

  13. Dronapisn表示:

    essay help forum
    cheap essay help online
    law essay writing service

  14. Are grateful for this blog post, it’s tough to find good information and facts on the internet

  15. Charopisn表示:

    write my essay help
    write my essay online
    essay writer generator

  16. Charopisn表示:

    best cheap essay writing service
    top 10 essay writing services
    buy an essay online cheap

  17. Thanks for discussing the issues and covering them in a well written format.

  18. Write more stories, more chapters.

  19. I cannot thank you more than enough for the blogposts on your website. I know you set a lot of time and energy into these and truly hope you know how deeply I appreciate it. I hope I’ll do a similar thing person sooner or later.

  20. Rhiamonpisn表示:

    best essay writing service website
    looking for someone to write my essay
    essay writing services scams

  21. Rhiamonpisn表示:

    help me write my college essay
    college admission essay service
    essay help sydney

  22. Antoniepisn表示:

    academic essay writing service
    college application essay help online
    help me write a compare and contrast essay

  23. Antoniepisn表示:

    essay write service
    essay writers review
    professional essay writer

  24. I appreciate, cause I found just what I was looking for. You’ve ended my four day long hunt! God Bless you man. Have a great day. Bye -.

  25. Your resources are well developed.

  26. Tammiepisn表示:

    write my essay for me no plagiarism
    essay writer helper
    pay someone to write my essay

  27. Tammiepisn表示:

    admissions essay help
    i need someone to write my essay
    custom essays no plagiarism

  28. Pennypisn表示:

    tok essay help
    essay writing service scams
    who will write my essay

發佈留言

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