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

  1. Premade Fans表示:

    I have been curious about these trends, and you have really helped me. I have just told a few of my friends about this on FaceBook and they love your content just as much as I do.

  2. baricitinib people also search for baricitinib lilly baricitinib ad jak inhibitor drug tofacitinib and baricitinib

  3. Anthonyadoni表示:

    самоходный ножничный подъемник
    http://nozhnichnyye-podyemniki-dlya-sklada.ru/

  4. metformin 5表示:

    ivermectin for hamsters ivermectin 12 ivermectin (stromectol). how to treat ivermectin poisoning in snakes

  5. aralen 300 mg表示:

    baricitinib covid pneumonia lilly baricitinib markham a. baricitinib: first global approval. drugs. 2017 mar 13. ahead of print] rheumatoid arthritis baricitinib moderate to severe rheumatoid arthritis

  6. diflucan pill online who sells difluican with out a prescription do i need a prescription for diflucan how many diflucan pills do you take for a yeast infection

  7. I will share you blog with my sis.

  8. We can see that we need to develop policies to deal with this trend.

  9. Nice post.Very useful info specifically the last part 🙂 Thank you and good luck.

  10. erowid seroquel seroquel 1200 mg daily side effects of seroquel in elderly what is quetiapine for

  11. Woah this is just an insane amount of information, must of taken ages to compile so thanx so much for just sharing it with all of us. If your ever in any need of related information, just check out my own site!

  12. Write more stories, more chapters.

  13. baclofen davis 3 baclofen para que es el baclofen how much baclofen is safe to drive

  14. oct aralen maculopathy aralen pill aralen toxicity 10-2 does dermatomyositis rash get worse before better when taking aralen

  15. Just wanna admit that this is extremely helpful, Thanks for taking your time to write this.

  16. I¦ll immediately seize your rss feed as I can’t in finding your email subscription hyperlink or newsletter service. Do you have any? Kindly allow me realize so that I may subscribe. Thanks.

  1. 2022-07-05

    writing dissertation and grant proposals https://professionaldissertationwriting.org/

  2. 2022-07-05
  3. 2022-07-06

    uk dissertation writing help quotes https://helpwithdissertationwritinglondon.com/

  4. 2022-07-06

    best dissertation help services https://dissertationwritingcenter.com/

  5. 2022-07-06

    books thesis dissertation help https://dissertationhelpexpert.com/

  6. 2022-07-06

    dissertation data analysis help https://examplesofdissertation.com/

  7. 2022-07-06

    dissertation writing assistance https://writing-a-dissertation.net/

  8. 2022-07-06
  9. 2022-07-06
  10. 2022-07-06

    law dissertation writing service https://customdissertationwritinghelp.com/

  11. 2022-07-07
  12. 2022-07-07
  13. 2022-07-07
  14. 2022-07-07

    doctoral dissertation help usa https://customthesiswritingservices.com/

發佈回覆給「High paying Jobs in Canada」的留言 取消回覆

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