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

  1. Dwayneseisa表示:

    Generic100mgEasy buy generic 100mg viagra online Generic100mgEasy

  2. Williamuniot表示:

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

  3. Jamesavata表示:

    пин ап казино – pinup 2025

  4. Starsmu表示:

    Получите консультацию онлайн-психолога в чате прямо сейчас. Чат психологической поддержки. Чат с психологом в телеге.

  5. Risingems表示:

    Психолог онлайн чат. Психологическая и информационная онлайн-помощь. Телеграм психолог.

  6. Shadowjlz表示:

    Психолог онлайн анонимно. Получите консультацию онлайн-психолога в чате прямо сейчас. Чат с психологом в телеге.

  7. деньги под залог птс машины
    avtolombard-11.ru/nsk.html
    автоломбард кредит под птс

  8. Jamesavata表示:

    pinup 2025 – pinup 2025

  9. Dreamuro表示:

    Психолог онлайн анонимно. Помощь психолога онлайн. Получить КОНСУЛЬТАЦИЮ и ПОДДЕРЖКУ профессиональных психологов.

  10. JesseDex表示:

    пин ап: https://pinupkz.life/

  11. Moneydbw表示:

    Психолог онлайн анонимно. Получите консультацию онлайн-психолога в чате прямо сейчас. Получить первую онлайн консультацию психолога чате.

  12. JesseDex表示:

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

  13. Ironxto表示:

    Чат психологической поддержки. Психологическая и информационная онлайн-помощь. Психолог t me.

  14. займ под залог птс авто в москве
    avtolombard-11.ru
    взять деньги под птс автомобиля

  15. Dwayneseisa表示:

    Tadalafil Easy Buy cialis without a doctor prescription cialis without a doctor prescription

  16. Williamuniot表示:

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

  17. Jamesavata表示:

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

  18. Williamuniot表示:

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

  19. Jamesavata表示:

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

  20. займ под птс
    avtolombard-11.ru/kemerovo.html
    займ под залог авто

  21. JesseDex表示:

    пин ап казино официальный сайт: https://pinupkz.life/

  22. Catohp表示:

    Получить первую онлайн консультацию психолога чате. Чат с психологом в телеге. Психолог в телеграм.

  23. WilliamWhesy表示:

    “You have a government that is reckless about what is going to happen to Guyana,” said Melinda Janki, an international lawyer in Guyana who is handling several lawsuits against Exxon. It’s pursuing “a supposed course of development that is actually backward and destructive,” she told CNN.
    kelpdao
    And while plenty of Guyanese people welcome the new oil industry, some say Guyana’s startling economic statistics do not reflect a real-world prosperity for ordinary people, many of whom are struggling with the higher prices accompanying the oil boom. Inflation rose 6.6% in 2023, with prices of some foods shooting up much more rapidly.

    “Since the oil extraction began in Guyana, we have noticed that our cost of living has gone sky high,” said Wintress White, of Red Thread, a non-profit that focuses on improving living conditions for Guyanese women. “The money is not trickling down to the masses,” she told CNN.

    CNN contacted President Ali, the Ministry of Natural Resources and the Ministry of Finance for comment but received no response.
    Guyana, a former Dutch then British colony which gained independence in 1966, is one of only a handful of countries that is a “carbon sink,” meaning it stores more planet-heating pollution than it produces. This is due to its vast rainforest; trees remove carbon dioxide from the atmosphere as they grow.

    The country has protected its biodiversity where others have destroyed theirs, President Ali said in a BBC interview last year. In 2009, the country signed an agreement with Norway, which promised Guyana more than $250 million to preserve its 18.5 million hectares, or nearly 46 million acres, of forests.

    Ali insists the country can balance climate leadership and fossil fuel exploitation. The new oil wealth will allow Guayana to develop, including building climate adaptations such as sea walls, he has said. He has also pointed to the continued failures of wealthy countries, already grown rich on their own fossil fuels, to help poorer countries with climate finance.

    But there are concerns Guyana could fall victim to the “resource curse,” in which vast, new wealth ?can actually make life worse for those who live there.

  24. JesseDex表示:

    пин ап вход: https://pinupkz.life/

  25. Dwayneseisa表示:

    Officiele Kamagra van Nederland kamagra gel kopen Officiele Kamagra van Nederland

  26. Allanref表示:

    A tiny rainforest country is growing into a petrostate. A US oil company could reap the biggest rewards
    kyberswap
    Guyana’s destiny changed in 2015. US fossil fuel giant Exxon discovered nearly 11 billion barrels of oil in the deep water off the coast of this tiny, rainforested country.

    It was one of the most spectacular oil discoveries of recent decades. By 2019, Exxon and its partners, US oil company Hess and China-headquartered CNOOC, had started producing the fossil fuel.? They now pump around 650,000 barrels of oil a day, with plans to more than double this to 1.3 million by 2027.

    Guyana now has the world’s highest expected oil production growth through 2035.

    This country — sandwiched between Brazil, Venezuela and Suriname — has been hailed as a climate champion for the lush, well-preserved forests that carpet nearly 90% of its land. It is on the path to becoming a petrostate at the same time as the impacts of the fossil fuel-driven climate crisis escalate.

    While the government says environmental protection and an oil industry can go hand-in-hand, and low-income countries must be allowed to exploit their own resources, critics say it’s a dangerous path in a warming world, and the benefits may ultimately skew toward Exxon — not Guyana.
    Since Exxon’s transformative discovery, Guyana’s government has tightly embraced oil as a route to prosperity. In December 2019, then-President David Granger said in a speech, “petroleum resources will be utilized to provide the good life for all … Every Guyanese will benefit.”

    It’s a narrative that has continued under current President Mohamed Irfaan Ali, who says new oil wealth will allow Guyana to develop better infrastructure, healthcare and climate adaptation.

  27. Vlskyy表示:

    clarinex without prescription – dapoxetine brand purchase dapoxetine for sale

  28. TerryDek表示:

    The voice of ‘White Lotus’ star Walton Goggins is the lullaby we didn’t know we needed
    jumper exchange
    While his “White Lotus” character Rick has been the source of some stress this season, Walton Goggins is here to soothe us into a state of dreamy sleep to make up for it.

    The actor has partnered with relaxation and meditation app Calm for one of their famed Sleep Stories, lending his smoky voice to a fable titled “The Yard Sale.”

    Goggins announced the Sleep Story on his verified Instagram on Tuesday, writing, “A friend once said to me the first question you ask someone shouldn’t be, ‘How are you?’ but rather, ‘How did you sleep last night?’ I agree.”

    The post included an excerpt from the story, in which Goggins is heard languidly instructing listeners to relax their bodies and get into bed. “You could even climb into a hammock,” he added. “I wouldn’t do that because I’ve never gracefully got in or out of one.”

    In the caption, the actor also wrote that he “wanted to create a Sleep Story that feels dreamlike, helping people slow their minds down by wandering through a yard sale (which happens to be one of my favorite things to do), uncovering hidden treasures.”

    “It’s the Walton Goggins version of counting sheep. I hope you enjoy,” he added.

    Other celebrities who have read bedtime stories in the hopes of putting audiences to sleep include Dolly Parton and the late Jimmy Stewart, whose voice was featured in a Calm Christmas Sleep Story in 2023 thanks to generative AI technology.

    Goggins currently stars on “The White Lotus,” where his character is often the most stressed out and tortured of the ensemble, at one point setting a slew of snakes free.

  29. автоломбард залог птс
    avtolombard-11.ru/kazan.html
    займ денег под залог автомобиля

發佈留言

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