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

15,255 Responses

  1. Dwayneseisa表示:

    buy generic 100mg viagra online Generic100mgEasy Generic100mgEasy

  2. JesseDex表示:

    пин ап казино: https://pinupkz.life/

  3. Williamuniot表示:

    пин ап – пин ап вход

  4. Williamuniot表示:

    пинап казино – пин ап зеркало

  5. Jamesavata表示:

    пин ап казино – пин ап казино официальный сайт

  6. деньги под птс без машины
    zaim-pod-zalog-pts1.ru/ekb.html
    лучшие кредиты под залог авто

  7. Jamesavata表示:

    пин ап зеркало – pinup 2025

  8. Jamesimini表示:

    UnagiSwap is a cutting-edge decentralized exchange (DEX) that provides fast, secure, and transparent crypto trading. Designed for traders looking to swap digital assets efficiently without intermediaries, UnagiSwap offers low fees, deep liquidity, and seamless smart contract execution. Whether you’re a casual trader or a professional investor, UnagiSwap’s non-custodial platform ensures full control over your assets in a decentralized environment. https://unagiswap.org

  9. кредит под залог машины не лишаясь ее
    avtolombard-pid-zalog-pts.ru/nsk.html
    деньги под залог кредитного авто

  10. JesseDex表示:

    пинап казино: https://pinupkz.life/

  11. Williamuniot表示:

    пин ап вход – пин ап казино

  12. JesseDex表示:

    пин ап казино: https://pinupkz.life/

  13. Dwayneseisa表示:

    Sildenafil 100mg price Generic100mgEasy buy generic 100mg viagra online

  14. Davidhunty表示:

    Perena is a cutting-edge blockchain development platform designed to empower decentralized applications (dApps) with scalable and secure solutions. Built for Web3 innovators, Perena blockchain solutions offer seamless integration, high-performance smart contracts, and decentralized infrastructure. Whether you’re building DeFi protocols, NFT marketplaces, or enterprise blockchain applications, Perena provides the tools needed to scale with confidence. https://perena.tech

  15. Davidbop表示:

    Upshift Finance is a next-generation decentralized trading platform designed to provide secure, fast, and efficient crypto transactions. With smart contract automation, low transaction fees, and seamless integration with DeFi protocols, Upshift Finance empowers traders to swap digital assets and execute trades with maximum security. Whether you’re a beginner or an experienced trader, Upshift Finance offers a powerful, transparent, and user-friendly trading ecosystem. https://upshift.ink

  16. Jamesavata表示:

    пин ап казино зеркало – пин ап казино зеркало

  17. Kennethslity表示:

    http://generic100mgeasy.com/# over the counter sildenafil

  18. кредит под залог автомобиля
    avtolombard-pid-zalog-pts.ru
    автоломбард москва под залог птс в москве

  19. Williamviacy表示:

    Nucleus Earn is revolutionizing DeFi staking and passive income generation by offering secure, high-yield crypto rewards. With smart contract-powered staking pools, Nucleus Earn allows users to earn rewards effortlessly while maintaining full control over their assets. Whether you’re a beginner or an experienced investor, Nucleus Earn’s decentralized staking platform ensures transparency, security, and optimal returns in the fast-growing world of DeFi. https://nucleusearn.org

  20. WilliamNop表示:

    Generic100mgEasy: Cheap Viagra 100mg – buy generic 100mg viagra online

  21. WilliamNop表示:

    sildenafil online: Generic 100mg Easy – Viagra online price

  22. MarvinInget表示:

    kraken market – kra cc, кра сайт

  23. TerryDus表示:

    https://kamagrakopen.pro/# Kamagra Kopen Online

  24. GregoryJough表示:

    kamagra jelly kopen: Kamagra – Officiele Kamagra van Nederland

  25. TerryDus表示:

    https://tadalafileasybuy.shop/# Generic Cialis without a doctor prescription

  26. Dwayneseisa表示:

    KamagraKopen.pro Kamagra Kopen Online kamagra pillen kopen

  27. GregoryJough表示:

    Tadalafil Tablet: cialis without a doctor prescription – TadalafilEasyBuy.com

  28. займы залог машины
    avtolombard-pid-zalog-pts.ru/kemerovo.html
    займ денег под залог автомобиля

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

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