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

3,804 Responses

  1. Easterpisn表示:

    custom written essays
    buy an essay
    essay writing help

  2. This is something that will need all of our combined efforts to address.

  3. Vivienepisn表示:

    college essay help long island
    best essay writers review
    buy a essay

  4. Vivienepisn表示:

    personal essay help
    essay writing services us
    how to be a better essay writer

  5. casino online表示:

    When I read an article on this topic, casino online the first thought was profound and difficult, and I wondered if others could understand.. My site has a discussion board for articles and photos similar to this topic. Could you please visit me when you have time to discuss this topic?

  6. kora online表示:

    I know this is not exactly on topic, but i have a blog using the blogengine platform as well and i’m having issues with my comments displaying. is there a setting i am forgetting? maybe you could help me out? thank you.

  7. XsaYpvdLiZgt表示:

    On this site all known monedigo and very good and trust!

  8. Ginniepisn表示:

    essay title help
    cheap essay papers
    buy cheap essay online

  9. Ginniepisn表示:

    do my essay for cheap
    essay writing service law school
    custome essay

  10. Nice i really enjoyed reading your blogs. Keep on posting. Thanks

  11. XsaYdddLiZgt表示:

    On this site u can buy all known monedigo for very good price!

  12. gacorslot表示:

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

  13. Admitle表示:

    what are the side effects of lasix Гў That said, neither the MPC nor the FPC canafford to be complacent

  14. ascetacle表示:

    Patients with mandibular asymmetry require special consideration related to correction of the deformity lasix to torsemide conversion

  15. piopary表示:

    024 Epub 2009 Jan 20 lasix generic

  16. piopary表示:

    The waist hip ratio also decreased significantly compared with placebo lasix drug interactions Some contaminants, such as heavy metals, including arsenic, cadmium, lead, and mercury, and pesticides, may be introduced from the environment

  17. scb99表示:

    That is really fascinating, You’re an excessively skilled blogger. I’ve joined your rss feed and look forward to in the hunt for extra of your magnificent post. Additionally, I’ve shared your website in my social networks!

  18. Ginniepisn表示:

    custom essay writing service org
    admission essay writing service
    buy essay online for cheap

  19. Ginniepisn表示:

    buy an essay paper
    buy essays online reviews
    best online essay writer

  20. Your resources are well developed.

  21. Hello there I am so delighted I found your weblog, I really found you by mistake, while I was searching on Google for something else, Anyhow I am here now and would just like to say cheers for a remarkable post and a all round exciting blog (I also love the theme/design), I don’t have time to browse it all at the moment but I have book-marked it and also included your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the superb work.

  22. I’d like to be able to write like this, but taking the time and developing articles is hard…. Takes a lot of effort.

  23. I’ve been looking for photos and articles on this topic over the past few days due to a school assignment, baccarat online and I’m really happy to find a post with the material I was looking for! I bookmark and will come often! Thanks 😀

  24. have already been reading ur blog for a couple of days. really enjoy what you posted. btw i will be doing a report about this topic. do you happen to know any great websites or forums that I can find out more? thanks a lot.

  25. Thanks for posting this. Looking for these resources 😀

  26. Cthrinepisn表示:

    professional essay writers
    help with college essays
    custom essay writing services reviews

  27. I am glad to talk with you and you give me great help

發佈回覆給「หวย24ชม」的留言 取消回覆

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