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

9,815 Responses

  1. ArmandoDat表示:

    lisinopril 40 coupon: can i buy lisinopril online – lisinopril mexico

  2. JimmieTup表示:

    https://ciprofloxacin.cheap/# buy cipro without rx

  3. MichaelSaw表示:

    ‘A short and significant relationship’: How a piano in a pickup builds connections
    [url=https://sites.google.com/view/metamask-wallet-apps/metamask]Metamask[/url]

    Dozens of internationally renowned recording artists give concerts in Vegas every year, but the musician who connects best with people might be a local troubadour who improvises on a piano in the back of his pickup.

    The maestro, Danny Kean, calls his setup The Traveling Piano, and he has traversed North America sharing music for nearly 20 years.

    Kean’s home base is Las Vegas now, and every time he plays, he invites passersby to climb aboard the truck and tickle the ivory for themselves. Even if people are shy or say they can’t do it, Kean usually convinces them to give it a try, inspiring total strangers to express themselves through the common language of music.

    He estimates more than 100,000 people have played his piano since 2006.

    For most of these impromptu virtuosos, the experience is cathartic — many of them step down from the truck in tears. For Kean, 69, the encounters nourish his soul.

    “I enjoy sharing my music with others, but I enjoy having others share theirs with me just as much,” he said. “My goal is to connect with others by creating a short and significant relationship. Music is a great facilitator for that in every way and on every level.”

    Kean does not accept fees or tips for these musical awakenings, giving away time and energy for nothing in return. He practices philanthropy in other ways, too, providing food and other necessities for the burgeoning population of unhoused individuals in downtown Las Vegas and around the Las Vegas Valley.

    “I love the idea of strangers becoming less afraid of each other,” he said. “This love for humanity drives me to keep doing good.”

  4. Anthonyacawl表示:

    How to survive a bear attack – or better yet, avoid one altogether
    Uniswap

    You’re out for a hike, reveling in glorious nature. Suddenly, you spot a bear. And the bear has spotted you, too. Would you know what to do next?

    Beth Pratt sure would.

    She was once on the Old Gardiner Road Trail in Yellowstone National Park, enjoying her run in wild nature. Her reverie came to an end when she came upon a grizzly bear eating flowers.

    “I stopped. It stood on its hind legs and looked at me. I knew that wasn’t a threatening gesture,” she told CNN Travel. “I’m not kidding, it waved its paw at me as if to say, ‘just go on your way,’ and went back to eating.”

    “And I walked slowly away and put some distance between us, and the encounter ended fine.”

    When it comes to dealing with bears, Pratt does have a thing or two on almost all the rest of us, though.

    She is the California regional executive director for the National Wildlife Federation, a job she’s had for more than 10 years. She worked in Yellowstone for several years – and once saw nine grizzlies in one day there.
    Finally, she lives on the border of Yosemite National Park, and bears will pass through her yard, including this one seen in the footage above in late September 2021.

    You can hear the enthusiasm in Pratt’s voice as she shares her bear bona fides and advice to make sure bear/human encounters are delightful, not dangerous.

    “A wild bear is a beautiful sight to see. It’s incredible to see them in the wild. I never had a bad experience with bears. What I try to get people to feel is respect, not fear, for bears. The animal usually wants to avoid the encounters.”

  5. ArmandoDat表示:

    get cheap clomid without insurance: cost cheap clomid online – clomid cost

  6. Jack Hall表示:

    정말 멋진 블로그 게시물입니다. 귀하의 블로그 게시물에 정말 감사드립니다. 귀하의 게시물을 방문하면 많은 접근 방식을 발견하게 될 것입니다.

  7. Brianmet表示:

    Быстро подсобим не разрешить пиццу в течение Москве недорого. Бесплатная доставка пиццы в течение Москве. Обещать пиццу чтобы хоть какого повода. Выучим пропитание чтобы вы, ваших похожи
    Заказать пиццу пиццерия

  8. Jaimevoink表示:

    buy cytotec pills п»їcytotec pills online buy cytotec

  9. JamesAreft表示:

    They fell in love three decades ago. Now they pilot planes together
    [url=https://sites.google.com/view/aave-protocol/aave ]Aave[/url]

    On their first flight together, Joel Atkinson and Shelley Atkinson couldn’t contain their excitement. They enthused to the flight attendants. They posed for photos. They told passengers via a pre-flight announcement.

    “We made a big deal about it,” Joel tells CNN Travel.

    Then, right before take off, Joel and Shelley sat side by side in the flight deck, just the two of them. They’d come full circle, and were about to embark on an exciting new chapter.

    “It felt amazing,” Shelley tells CNN Travel.

    “As we prepared to take off, I was giddy, euphoric,” says Joel.

    Joel and Shelley met as twentysomethings flying jets in the US Air Force. They became fast friends, then, over time, fell in love.

    Today, they’ve been married for 27 years and counting. They’ve brought up two kids together. And now they’re both pilots for Southwest Airlines. They regularly fly together, with Joel as captain and Shelley as first officer.

    The couple say working together is “amazing.” They treat layovers as “date nights.” They learn from one another’s respective “wisdom and judgment.”

    And no, they don’t argue mid-flight.

    “People ask us, how does it work, flying together?” says Joel. “We know a few pilot couples and some of them fly together, some of them don’t. I’ve heard people say, ‘Oh I could never fly with my wife or my husband.’”

    For Joel and Shelley, working together is seamless – a joy that comes easily to them both.

    “We’re best friends,” says Shelley.

    “There’s just that unspoken bond,” says Joel.

  10. Michaeldib表示:

    Four friends posed for a photo on vacation in 1972. Over 50 years later, they recreated it
    Aerodrome Finance

    In the photo, four young women walk arm in arm, smiling and laughing, on a beach promenade. They’re dressed in mini skirts and flip flops, and there’s what looks like a 1960s Ford Corsair in the background. This is clearly a snapshot from a bygone era, but there’s something about the picture — the womens’ expressions, their laughs — that captures a timeless and universal feeling of joy, youth and adventure.

    For the four women in the photo, Marion Bamforth, Sue Morris, Carol Ansbro and Mary Helliwell, the picture is a firm favorite. Taken over 50 years ago on a group vacation to the English seaside town of Torquay, Devon, the photo’s since become symbolic of their now decades-long friendship. Whenever they see the picture, they’re transported back to the excitement of that first trip together.

    “It’s always been our memory of Torquay,” Sue Morris tells CNN Travel. “The iconic photograph — which is why I got the idea of trying to recreate it.”

    ‘The iconic photograph’
    Bamforth, Morris, Ansbro and Helliwell were 17 when the photo was taken, “by one of these roving photographers that used to roam the promenade and prey on tourists like us,” as Morris recalls it.

    It was the summer of 1972 and the four high school classmates — who grew up in the city of Halifax, in the north of England — were staying in a rented caravan in coastal Devon, in southwest England. It was a week of laughs, staying out late, flirting with boys in fish and chip shops, sunburn, swapping clothes, sharing secrets and making memories by the seaside.

    Fast forward to 2024 and Bamforth, Morris, Ansbro and Helliwell remain firm friends. They’ve been by each other’s sides as they’ve carved out careers, fallen in love, brought up families and gone through heartbreak and grief.

  11. Robertwaymn表示:

    Bug-bitten oolong? The secret behind Taiwan’s rare honey-flavored tea — and where to enjoy it
    Ethena

    As the leaves rustle atop the hills in Nantou, Taiwan’s largest tea-producing area, the farm suddenly comes alive, millions of tiny green bugs hopping into the air.

    While many farmers might frown at the sight of these pests munching on their crops, Lee Ming-cheng, a third-generation tea farmer and maker, can’t hide the broad smile on his sun-kissed face.

    This “green insect fog,” as locals call it, is a sign they’ll have a good harvest of Gui Fei Oolong (also known as Honey Flavor Dong Ding Oolong or Concubine Oolong), a special tea that’s prized for offering a hint of honey flavor.

    And it’s these endemic insects, called Jacobiasca formosana, or tea jassids, that are to thank for it.

    When the jassids feed, the leaves go into defensive mode and produce a sweetened hormone that tastes and smells like honey, creating one of the world’s most intriguing teas: mixiang cha, or honey-fragrance tea.

    The bug-bitten leaves are oxidized and roasted to create a variety of beverages. There’s mixiang black tea (made with fully oxidized leaves) and oolong teas like Oriental Beauty (partially oxidized and not roasted) and the previously mentioned Concubine Tea (partially oxidized and roasted), to name a few.

    Unlike Taiwan’s ubiquitous bubble tea, mixiang tea is still highly limited and largely off-the-radar. But what was once a hidden gem among serious tea lovers is now starting to gain international attention.

  12. Chesterfeank表示:

    You’ve come across a bison in the wild. It’s looking at you. Do you know what to do next?
    Pendle

    A dangerous encounter with a territorial bison and the subsequent viral video were not what Rebecca Clark had in mind when she set out for Caprock Canyons State Park in early October 2022.

    She had been so enamored with Texas’ third-largest state park on her first solo hiking and camping trip there a year earlier that she decided to go back for more. Roughly two hours by car from either Lubbock or the Panhandle city of Amarillo, Caprock attracts visitors with big blue skies, brown and green prairielands and rugged red-rock formations.

    Caprock has another draw – its wild bison herd, about 350 strong in late 2022. But bison, the great symbolic animal of the Great Plains, weren’t on her radar. Until suddenly, they were.

    The Texas resident recounted her experience with CNN’s Ed Lavandera, telling him that she came upon a herd while she was walking a trail back from Lake Theo.

    “I decided to just kind of wait for them to … get across the trail, and then I would pass them.” But they weren’t moving away fast enough for Clark. She said she decided to just walk by them – closer than the recommended safety distance. She was recording the moment on her smartphone.

    In her video, Clark can be heard saying, “Thank you, I appreciate it” as she passes the animals.

    Things got dangerous very quickly when one of the agitated bison took notice. “When I saw him turn, it’s like instantly I knew he was gonna come after me.”

    And that’s exactly what the bison did. Once it charged, the large mammal was upon Clark within two seconds despite her frantic attempt to flee.

    “It was so fast. He hit me in the back, rammed me, hooked me, then flipped me up and face forward into the mesquite bush.”

    And there was Clark. Gored, bleeding and alone. How would she survive?

  13. JimmieTup表示:

    https://cytotec.top/# buy cytotec online

  14. ArmandoDat表示:

    where can i get zithromax over the counter: buy zithromax online cheap – zithromax prescription in canada

  15. Jaimevoink表示:

    buy cytotec pills cytotec pills buy online buy cytotec over the counter

  16. RobertUnmab表示:

    buy clomid no prescription: where to get generic clomid without prescription – where to get generic clomid price

  17. JimmieTup表示:

    https://clomid.store/# where to buy generic clomid online

  18. ArmandoDat表示:

    lisinopril 60 mg tablet: lisinopril 30 mg price – zestril no prescription

  19. вывод из запоя нижний новгород стационар вывод из запоя нижний новгород стационар .

  20. вывод из запоя в стационаре нижний новгород вывод из запоя в стационаре нижний новгород .

發佈留言

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