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

  1. JamesLok表示:

    Slot klasik tetap menjadi favorit banyak orang http://slot88.company/# Slot dengan fitur interaktif semakin banyak tersedia

  2. NevilleSkise表示:

    have a peek at this web-site https://web-sollet.com

  3. Davidnof表示:

    dark web market darknet markets dark web marketplaces

  4. Dannyfut表示:

    darknet markets onion address dark web marketplaces dark web market urls

  5. Gregorydak表示:

    Сауна очищает организм https://sauna-broadway.ru выводя токсины через пот, укрепляет иммунитет благодаря перепадам температуры, снимает стресс, расслабляя мышцы и улучшая кровообращение. Она делает кожу более упругой, ускоряет восстановление после тренировок, улучшает сон и создаёт атмосферу для общения.

  6. DavidCooth表示:

    http://slotdemo.auction/# Kasino di Bali menarik banyak pengunjung

  7. Rodneytus表示:

    darknet market lists onion dark website darkmarket

  8. DavidCooth表示:

    http://slot88.company/# Mesin slot menawarkan pengalaman bermain yang cepat

  9. Aaronbus表示:

    slot demo slot demo Banyak kasino memiliki promosi untuk slot

  10. Williecrady表示:

    Slot klasik tetap menjadi favorit banyak orang https://slot88.company/# Mesin slot menawarkan berbagai tema menarik

  11. Davidnof表示:

    darknet markets onion address darknet market list darkmarket url

  12. MichaelIncap表示:

    bitcoin dark web darknet markets dark web market list

  13. Dollyfut表示:

    darknet markets onion address dark web marketplaces

  14. Rodneytus表示:

    darknet drug market bitcoin dark web darknet markets onion

  15. ThomasThype表示:

    Kasino memastikan keamanan para pemain dengan baik: slot demo pg gratis – slot demo gratis

  16. GreggRom表示:

    A brief history of sunglasses, from Ancient Rome to Hollywood
    кракен

    Sunglasses, or dark glasses, have always guarded against strong sunlight, but is there more to “shades” than we think?

    The pupils of our eyes are delicate and react immediately to strong lights. Protecting them against light — even the brilliance reflected off snow — is important for everyone. Himalayan mountaineers wear goggles for this exact purpose.

    Protection is partly the function of sunglasses. But dark or colored lens glasses have become fashion accessories and personal signature items. Think of the vast and famous collector of sunglasses Elton John, with his pink lensed heart-shaped extravaganzas and many others.

    When did this interest in protecting the eyes begin, and at what point did dark glasses become a social statement as well as physical protection?
    The Roman Emperor Nero is reported as holding polished gemstones to his eyes for sun protection as he watched fighting gladiators.

    We know Canadian far north Copper Inuit and Alaskan Yupik wore snow goggles of many kinds made of antlers or whalebone and with tiny horizontal slits. Wearers looked through these and they were protected against the snow’s brilliant light when hunting. At the same time the very narrow eye holes helped them to focus on their prey.

    In 12th-century China, judges wore sunglasses with smoked quartz lenses to hide their facial expressions — perhaps to retain their dignity or not convey emotions.

  17. Barryanets表示:

    Carrie Underwood slated to perform at Trump’s inauguration
    kraken darknet
    Country music star Carrie Underwood is slated to perform “America the Beautiful” at President-elect Donald Trump’s inauguration, according to a copy of the program obtained by CNN and confirmed by a spokesperson for the inaugural committee.

    “I love our country and am honored to have been asked to sing at the Inauguration and to be a small part of this historic event,” Underwood said in a statement to CNN. “I am humbled to answer the call at a time when we must all come together in the spirit of unity and looking to the future.”

    The presidential oath of office will be administered by Supreme Court Chief Justice John Roberts with Justice Brett Kavanaugh expected to administer the oath of office to Vice President-elect JD Vance.

    Trump’s inauguration as the 47th president of the United States will take place on January 20 at the US Capitol.

    Underwood is a big get for Trump’s inauguration, considering Hollywood’s Trump blackout over the course of his political career.

    In his first term and throughout the past three elections, Trump has struggled to garner support from major Hollywood stars. At the Republican National Convention last year, the two biggest stars onstage with Trump were musician Kid Rock and retired WWE wrestler Hulk Hogan – a far cry from a superstar at the height of their career, like Underwood.

    The Grammy-winning artist is as high-profile as you can get in country music, not only with numerous platinum hits, but also with public-facing, mainstream business associations. Underwood is the face of Sunday Night Football and is set to make her debut this March as a judge on ABC’s “American Idol” – the singing competition show that catapulted her to fame when she won in 2005.

    While many NFL fans will likely applaud Underwood for singing at the inauguration, any time a celebrity aligns themselves with Trump, they run the risk of alienating left-leaning fans and Hollywood allies.

    Underwood has kept her politics under wraps over the course of her career. In her statement, she did not mention Trump by name and kept her focus on unifying the country – still, Underwood’s decision to publicly align with Trump is a big statement for any star, particularly one as private as the singer.

    Historically, Hollywood has always been closely associated with the Democratic Party, but country stars have always been an outlier, leaning more conservative. In recent years, as new singers join the genre, country music has gotten to be more progressive. This past election cycle, country stars like Mickey Guyton and Maren Morris stood with Vice President Kamala Harris.

  18. MichaelIncap表示:

    darkmarket link darknet websites dark market link

  19. Michaelkig表示:

    onion dark website dark websites darknet markets links

  20. DavidCooth表示:

    https://preman69.tech/# Permainan slot bisa dimainkan dengan berbagai taruhan

  21. Williecrady表示:

    Slot dengan tema film terkenal menarik banyak perhatian https://bonaslot.site/# Slot dengan tema film terkenal menarik banyak perhatian

  22. Rodneytus表示:

    darknet markets url dark market darknet markets url

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

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