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

4,881 Responses

  1. Thanks for another great post. Where else may anybody get that type of info in such an ideal way of writing? I have a presentation next week, and I’m at the search for such information.

  2. This blog post is excellent, probably because of how well the subject was developed. I like some of the comments too.

  3. whoah this weblog is great i really like studying your articles. Stay up the great work! You already know, lots of persons are looking round for this information, you can aid them greatly.

  4. I dont think Ive caught all the angles of this subject the way youve pointed them out. Youre a true star, a rock star man. Youve got so much to say and know so much about the subject that I think you should just teach a class about it

  5. Loving the info on this website , you have done outstanding job on the blog posts.

  6. Simply want to say your article is as amazing. The clarity in your post is just great and i can assume you’re an expert on this subject. Fine with your permission allow me to grab your feed to keep up to date with forthcoming post. Thanks a million and please keep up the gratifying work.

  7. This is something that will need all of our combined efforts to address.

  8. eltorotips表示:

    It’s time for communities to rally.

  9. Most often since i look for a blog Document realize that the vast majority of blog pages happen to be amateurish. Not so,We can honestly claim for which you writen is definitely great and then your webpage rock solid.

  10. Thank you a lot for sharing this with all folks you actually recognize what you’re speaking about! Bookmarked. Please additionally visit my site =). We can have a hyperlink trade contract among us!

  11. Beneficial Blog! I had been simply just debating that there are plenty of screwy results at this issue you now purely replaced my personal belief. Thank you an excellent write-up.

  12. MSNBC Live表示:

    There is perceptibly a lot to identify about this. I consider you made some good points in features also.

  13. Excenejer表示:

    Optiray 320 ioversol 68 was administered to all patients in a dose of 2 mL kg 1 buy cialis pills

  14. attincife表示:

    Now, I know that some of you dont really like to use SERMs during cycle but I seem to be more gyno prone so I am definately going to use either a SERM or an AI during my cycle, but as of right now, I am definately thinking about incorporating a SERM and an AI proviron into my cycle because of the bad things that I have read about the true AIs Femara, Arimidex, ect buy cialis 10mg CLITORAL ENLARGEMENT

  15. PoemywomY表示:

    The BRAF specific primers used were BRAF F2, GCTACAGAGAAATCTCGATGGAGT and BRAF R3, GGTAACTGTCCAGTCATCAATTCA can i buy cialis without a prescription

  16. PoemywomY表示:

    cialis pills Per sample, reads that overlapped each region in the atlas were counted using the bedtools command multiBamCov 49

  17. Easterpisn表示:

    academic essay writer
    english literature essay help
    essay revision help online

發佈留言

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