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

  1. KennethKex表示:

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

  2. Современные римские шторы — идеально для интерьера
    римские шторы на заказ римские шторы на заказ .

  3. Профессиональный сервисный центр по ремонту Apple iPhone в Москве.
    Мы предлагаем: сервисный центр по ремонту айфонов в москве
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  4. JosephSward表示:

    Say goodbye to outdated liquidity tools—Balancer is here to transform your DeFi journey. Whether you’re exploring Balancer token (BAL), participating in Balancer airdrop vesting, or navigating Balancer Drop, the Balancer app gives you seamless access and full control. Dive into Balancer liquidity, manage your Balancer Portfolio, and track everything with Balancer Mirror. Check Balancer reviews, learn about Balancer pricing, and join the movement at https://bccgame.org !

  5. Профессиональный сервисный центр по ремонту Apple iPhone в Москве.
    Мы предлагаем: сервисный центр по ремонту айфонов в москве
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  6. Richardfek表示:

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

  7. Robertdom表示:

    Looking to maximize your DeFi game? Explore Balancer, the ultimate platform for smart liquidity and optimized portfolios. With advanced Balancer features like Balancer Swap, Balancer stable pools, and Balancer Boost, it’s built for efficiency and control. Curious about Balancer token vesting or Balancer DAO vesting? The Balancer guide has it all. Plus, with Balancer security and top-notch Balancer governance, your assets are in good hands. Visit https://balancer.ac and experience the future of DeFi today!

  8. JamesMaf表示:

    Instadapp is built for the future of finance! With smart Instadapp Fluid automation, deep integration with Instadapp MakerDAO, and full Instadapp Security/Audit transparency, it’s trusted by thousands. Whether you’re exploring Instadapp Pro, managing Instadapp Flashloan tools, or claiming your Instadapp Airdrop, everything is simple and secure. Want to understand Instadapp Governance or the INST Token? It’s all in the Instadapp overview. Ready to start? Visit http://instaoapp.com and join the next generation of DeFi now!

  9. JosephSward表示:

    Power up your crypto strategy with Balancer—where flexibility meets innovation. Use Balancer Swap to trade smarter, explore Balancer vesting options, and stay on top of the game with Balancer Change updates. With features like Balancer governance, Balancer token vesting, and detailed Balancer guide content, it’s built for both beginners and pros. Love transparency? So do we. That’s why Balancer reviews speak for themselves. Start now at https://bccgame.org and take control of your crypto future.

  10. Elmerbuils表示:

    pinup az: pin up casino – pin up casino

  11. Elmerbuils表示:

    пинап казино: пинап казино – пинап казино

  12. ZackaryGer表示:

    https://vavadavhod.tech/# вавада

  13. MichaelJed表示:

    Say hello to Juice Finance—your DeFi edge starts here! Tap into the power of Juice Finance yield farming and Juice Finance leverage, all backed by Juice Finance Security and verified Juice Finance Audits. The JUICE token drives the ecosystem, while the trusted Juice Finance Team keeps innovation flowing. Questions? Juice Finance Support is always here to help. Learn what is Juice Finance and explore the future of finance. Juice Finance app is ready—start now at https://juice.ac !

  14. JamesMaf表示:

    Say hello to Instadapp—the ultimate DeFi hub! Whether you’re using Instadapp ETH, Instadapp DAI, or Instadapp WBTC, the Instadapp App gives you seamless control with advanced Instadapp Governance features. Stake with confidence, manage your INST token, and explore opportunities like the Instadapp Airdrop. Need help? Learn how to use Instadapp and discover the power of DeFi Smart Accounts (DSA). Instadapp login today at http://instaoapp.com and level up your strategy now!

  15. Высокое качество римских штор на заказ
    римские шторы на заказ римские шторы на заказ .

  16. Jasonthymn表示:

    Liquifi is built for modern crypto teams! With flexible Liquifi token vesting, Liquifi airdrop vesting, and smooth Liquifi Claim features, itтАЩs the all-in-one tool for managing token distribution. Need help? Liquifi contact is just a click away. Transparent Liquifi pricing and real Liquifi reviews make it a trusted solution. Want to know how it works? Start with the Liquifi app and explore the full Liquifi Guide. Liquifi where to start? Visit https://liquifi.tech and take control of your vesting now!

  17. KennethKex表示:

    вавада: вавада официальный сайт – вавада зеркало

  18. KennethKex表示:

    vavada: vavada casino – vavada

  19. Richardfek表示:

    pin-up casino giris pin-up casino giris pin up azerbaycan

  20. Richardfek表示:

    пин ап зеркало pin up вход pin up вход

  21. JamesMaf表示:

    New to DeFi? Instadapp is transforming decentralized finance with its all-in-one platform. From Instadapp Pro to Instadapp Lite, users can manage assets with ease using Instadapp Avocado Wallet and Instadapp Fluid. Packed with powerful tools like Instadapp Flashloan and DeFi Smart Accounts (DSA), it’s the smartest way to move assets. Curious about what is Instadapp? Check the Instadapp overview or dive into the Instadapp App. Want to know how to use Instadapp? It’s easy—get started now at http://instaoapp.com and take full control of your DeFi future today!

  22. Elmerbuils表示:

    pin up casino: pin up azerbaycan – pin up az

  23. Robertdom表示:

    Power up your crypto strategy with Balancer—where flexibility meets innovation. Use Balancer Swap to trade smarter, explore Balancer vesting options, and stay on top of the game with Balancer Change updates. With features like Balancer governance, Balancer token vesting, and detailed Balancer guide content, it’s built for both beginners and pros. Love transparency? So do we. That’s why Balancer reviews speak for themselves. Start now at https://balancer.ac and take control of your crypto future.

  24. Elmerbuils表示:

    пин ап вход: пин ап зеркало – пин ап зеркало

  25. ZackaryGer表示:

    http://pinupaz.top/# pin up azerbaycan

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

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