利用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. Homerphest表示:

    cialis softabs online price of cialis 20 mg costa rica cialis sale

  2. tube表示:

    Nice Post. It’s really a very good article. I noticed all your important points. Thanks.

  3. cam表示:

    My brother suggested I might like this websiteHe was once totally rightThis post truly made my dayYou can not imagine simply how a lot time I had spent for this information! Thanks!

  4. free表示:

    Advanced reading here!

  5. video表示:

    I think this is among the so much vital info for me. And i’m happy reading your article. But wanna remark on few common issues, The site style is wonderful, the articles is really excellent : D. Just right job, cheers

  6. Homerphest表示:

    brand cialis online cialis purchase cialis online cheap

  7. video表示:

    The start of a fast-growing trend?

  8. video表示:

    Its wonderful as your other blog posts : D, regards for putting up.

  9. Homerphest表示:

    where to buy generic cialis buying cialis online order cialis online nb canada

  10. Homerphest表示:

    cialis online no prescription australia tadalafil without a doctor’s prescription generic cialis black

  11. Homerphest表示:

    rx online cialis cialis for sale online cialis recreational use

  12. MichaelPieno表示:

    where can i buy viagra over the counter viagra price 100mg viagra

  13. MichaelPieno表示:

    buy viagra online canada viagra tablets for men where can i buy viagra over the counter

  14. EddieLip表示:

    stromectol for humans for sale stromectol 12 mg tablets stromectol for humans for sale

  15. EddieLip表示:

    ivermectin dosage for cats ear mites stromectol tablets for humans stromectol tablets for humans

  16. EddieLip表示:

    ivermectin is effective against which organisms? stromectol tablets for humans stromectol for humans for sale

  17. EddieLip表示:

    ivermectin for lyme ivermectin cream 1 stromectol for humans for sale

  18. Johnnyden表示:

    price for viagra viagra viagra tablets for men

  19. Johnnyden表示:

    ivermectin without a doctor prescription stromectol for sale prescribing stromectol

  20. kqvelatg表示:

    erythromycin for fish tanks what is erythromycin ophthalmic ointment used for

  21. Johnnyden表示:

    tadalafil tadalafil 20 mg buy online buy tadalafil online

  22. Johnnyden表示:

    generic tadalafil 20mg india tadalafil 10mg price cialis

  23. Johnnyden表示:

    viagra where to buy sildenafil citrate tablets 100 mg viagra pills

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

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