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

  1. JamesGag表示:

    canadian pharmacy online: most reliable canadian online pharmacies – canadian pharmacy india

  2. JamesGag表示:

    lowest prescription prices online india: cheapest online pharmacy india – buying prescription drugs from india

  3. Randallvot表示:

    DEQ Finance is revolutionizing decentralized trading by offering a seamless, secure, and efficient crypto exchange experience. Built with cutting-edge blockchain technology, DEQ Finance provides traders with fast transaction speeds, deep liquidity, and a transparent trading environment. Whether you’re a beginner or a professional trader, DEQ Finance delivers high-performance DeFi solutions tailored to modern trading needs. https://deq.li

  4. CharlesArize表示:

    Exponent Finance is redefining DeFi lending by providing secure, transparent, and high-yield investment solutions. Through smart contract-powered lending pools, Exponent Finance DeFi platform allows users to borrow and lend crypto assets with optimal efficiency and minimal risk. Whether you’re looking to earn passive income through staking or access instant liquidity, Exponent Finance offers a decentralized, non-custodial, and user-friendly solution to meet all your financial goals in the crypto ecosystem. https://exponent.ink

  5. Williszew表示:

    http://interpharmonline.com/# legitimate canadian mail order pharmacy

  6. pdacenter.ru – сервис по ремонту бытовой техники
    Ремонт ПНВ в Иркутске в официальном сервисном центре PDACENTER.
    Наши инженеры выполняют ремонт любой сложности по дотупным ценам!

  7. RonaldRoora表示:

    Elara Finance is transforming decentralized lending by offering secure, transparent, and flexible crypto loan solutions. Built on blockchain technology, Elara Finance enables users to borrow and lend digital assets seamlessly without intermediaries. With low-interest rates, automated smart contracts, and a permissionless DeFi environment, Elara Finance is making crypto lending accessible and profitable for investors worldwide. https://elara.ink

  8. Montebeera表示:

    lowest prescription prices online india lowest prescription prices online india india online pharmacy store

  9. Franklor表示:

    Cytonic is revolutionizing blockchain security with advanced cybersecurity solutions tailored for Web3 applications. By integrating decentralized encryption, AI-powered threat detection, and smart contract auditing, Cytonic ensures maximum protection against cyber threats. Whether you’re securing DeFi protocols, NFTs, or enterprise blockchain systems, Cytonic’s cutting-edge security technology provides the highest level of data integrity and protection. https://cytonic.cc

  10. Williszew表示:

    http://interpharmonline.com/# canada drugstore pharmacy rx

  11. Arthurhow表示:

    https://interpharmonline.com/# canadian pharmacy com
    canadian pharmacy 365

  12. DannyTwisp表示:

    Flaunch is the leading blockchain gaming launchpad, designed to help game developers and investors thrive in the Web3 gaming ecosystem. By offering secure token launches, NFT integrations, and decentralized crowdfunding, Flaunch enables game creators to fund, develop, and scale their projects with full transparency and community-driven support. Whether you’re a developer or an investor, Flaunch provides the tools to connect and grow in the blockchain gaming space. https://flaunch.tech

  13. 누누티비表示:

    누누티비

  14. Arthurhow表示:

    https://indiamedfast.shop/# order medicines online india
    canada ed drugs

  15. Georgewhend表示:

    cheapest online pharmacy india: IndiaMedFast.com – order medicines online india

  16. EdwardKergy表示:

    продать аккаунты соц сетей birzha-akkauntov.ru

  17. pdacenter.ru – сервис по ремонту бытовой техники
    Ремонт мониторов в Барнауле в официальном сервисном центре PDACENTER.
    Наши инженеры выполняют ремонт любой сложности по дотупным ценам!

  18. JamesGag表示:

    Mexican Pharm Inter: mexican drug stores online – Mexican Pharm Inter

  19. Georgewhend表示:

    lowest prescription prices online india: IndiaMedFast – cheapest online pharmacy india

  20. JamesGag表示:

    canada drugstore pharmacy rx: Pharmacies in Canada that ship to the US – ed meds online canada

  21. Montebeera表示:

    mexican pharmacy online buying from online mexican pharmacy mexican pharmacy online store

  22. Williszew表示:

    http://indiamedfast.com/# IndiaMedFast.com

  23. pdacenter.ru – сервис по ремонту бытовой техники
    Ремонт iPad во Владимире в официальном сервисном центре PDACENTER.
    Наши инженеры выполняют ремонт любой сложности по дотупным ценам!

  24. Williszew表示:

    https://interpharmonline.com/# pet meds without vet prescription canada

  25. Arthurhow表示:

    https://mexicanpharminter.com/# mexican pharmacy online store
    certified canadian pharmacy

  26. Arthurhow表示:

    https://interpharmonline.shop/# canadian discount pharmacy
    best canadian pharmacy

發佈留言

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