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

8,397 Responses

  1. Darrelherse表示:

    en guvenilir slot siteleri: slot siteleri guvenilir – slot casino siteleri

  2. Exclusive Marc Jacobs offers available at the marc jacobs outlet.

  3. Antonethuth表示:

    End of an era: The big change coming to European travel in November
    работа администратором вебкам

    In travel news this week: an accidental megadeal on first-class tickets, the world’s best-connected airport and why now is a good time to plan a trip to Europe. Plus a bit of relief for those of you traveling this Labor Day weekend.

    Goodbye to EU passport stamps
    Paper mementoes of our travels, from boarding cards to even passports themselves, are fast moving into obsolescence.

    The inky, smudgy joy of a fresh passport stamp will be a thing of the past for visitors to the 29 countries of the European Union Schengen Area starting November 10. That’s when the new automated Entry/Exit System (EES) comes into effect.

    It’s separate from the delayed ETIAS visa waiver program, which is due to start in the first half of 2025 and will mean travelers from outside the EU will be charged a €7 entry fee that is valid for three years.

    Destination inspiration
    Get your stamps while you can with these European vacation picks.

    Il dolce far niente – “the sweetness of doing nothing” – has been perfected by Italians on their vacations in southern sweet spots such as Naples, Ischia, Puglia, the Amalfi Coast and Capri. These remarkable photographs by UK photographer Lucy Laucht show how to relax the Italian way.

    In Hungary, the Gresham Palace is the grandest Budapest hotel of them all, having sat in its prime position overlooking the River Danube for more than a century. Here’s how this architectural gem looks in its current incarnation.

    Finally, if you’re considering a longer stay, an idyllic Swedish town is selling off land with prices so low you might think they’re mistakes. But Gotene, 320 kilometers (200 miles) southwest of Stockholm, is indeed selling plots with prices starting at just 1 krona, or 9 US cents, per square meter (11 square feet).

    Aviation news
    An airline accidentally offered a megadeal on first-class tickets, with 300 lucky customers getting savings of 85% off. Here’s what happened next.

    The staff at Australian flag carrier Qantas must have been flat-out like a lizard drinking sorting that mess out. And if you don’t understand that lingo, it’s time to check out our guide to Aussie slang.

    An airport on the edge of southeast Europe has been named the best connected in the world, with more than 300 direct flights to unique destinations. It’s been networking fast, too; it only opened in 2018.

  4. JasonHes表示:

    This city is developing the world’s tallest timber tower, again
    работа для девушек эскорт
    The US city of Milwaukee is already home to the world’s tallest timber tower. But another, even taller, wooden skyscraper could be added to its skyline, designed by Vancouver-based studio Michael Green Architects (MGA).

    The firm recently released plans for the development, which includes a 55-story tower made principally from mass timber — thick, compressed, multilayered panels of solid wood. If built, it would usurp the current world title holder, the 25-story Ascent tower by Korb + Associates Architects, as well as becoming the tallest building in the state of Wisconsin.

    MGA, which specializes in wooden architecture, hopes that the project will set a “new global benchmark for mass timber construction.”

    The project is part of the redevelopment of the Marcus Performing Arts Center, which opened in 1969 and won the Honor Award for Excellence in Architectural Design from the American Institute of Architects in 1970. Led by Neutral, which bills itself as a “regenerative development company,” the redesign will transform what is currently the center’s concrete parking lot into a space with residential units, offices, restaurants, cafes, grocery stores and public plazas. According to MGA, construction will cost an estimated $700 million. The plan is currently going through the city’s approval process, during which it is expected to evolve.

    Why timber?
    While the use of mass timber is steadily increasing worldwide, thanks to changes in building regulations and shifting attitudes towards the material, it has yet to match the sheer height of buildings made of concrete and steel — although a slew of timber high-rises have been proposed in recent years. MGA says its tower design would be approximately 600 feet (182 meters) tall — more than double the 284 feet (87 meter) tall Ascent tower.

    “The race for height is important,” said Michael Green, an architect and founder of MGA. “It’s not about showing off, it’s about showing what’s possible to the public.”

    He argued that the reason timber skyscrapers haven’t yet become mainstream is because climate change hasn’t been at the center of the conversation. “We didn’t really need to challenge the status quo of steel and concrete,” he said. “But because those materials are so hard on the climate, we had to find a different way to build towers and big buildings in general.”

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

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

  7. Explore discounted Marc Jacobs items at the marc jacobs outlet.

  8. Davidged表示:

    CV

  9. Blainelow表示:

    Для тех, кто ищет продажу Озепмпика, доступны аптеки и интернет-магазины с разнообразными предложениями. Препарат на основе семаглутида помогает стабилизировать уровень глюкозы и способствует снижению веса, что делает его отличным выбором для пациентов с диабетом. Узнайте цены на Озепмпик и выберите лучшее предложение. https://t.me/ozempik_kupit11

  10. Samuelalush表示:

    Уборка мусорных квартир https://uborka-zapushchennyh-kvartir.ru/

  11. Shop and save on Marc Jacobs essentials at the marc jacobs outlet.

  12. Профессиональный сервисный центр по ремонту ноутбуков, imac и другой компьютерной техники.
    Мы предлагаем:мастер по ремонту аймаков
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

  13. Aaronwag表示:

    изготовление грз https://dublikaty-gosnomer77.ru/

  14. Donaldlib表示:

    построить дом под ключ недорого https://spbstroymax.ru/

  15. Профессиональный сервисный центр по ремонту сотовых телефонов, смартфонов и мобильных устройств.
    Мы предлагаем: ремонт телефонов по близости
    Наши мастера оперативно устранят неисправности вашего устройства в сервисе или с выездом на дом!

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

  17. Ulcctz表示:

    mebeverine 135 mg tablet – buy pletal sale buy generic pletal over the counter

發佈留言

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