Actionscript:三角関数で雪を降らせる

仕事で必要だったので雪が降るスクリプトを作りました。雪らしい横にフラフラする動きはサイン関数を使っています。雪のムービークリップを適当にアタッチしてそれぞれのMCにonEnterFrameでしたりに降りたり横にフラフラする動きをさせています。下のサンプルはフラフラ動く部分を抜き出したものです。リクエストがあればもっと解説します。

→雪のムービーを見る

this.degree += this.xStep;//xStep=横方向への移動スピード
this.radian = Math.PI / 180 * this.degree;
this._x = this.x + this.r * Math.sin(this.radian);//this.r=横の振幅

***** おすすめの参考書 *****
macromedia FLASH ActionScriptスーパーサンプル集
FLASH ActionScript 2.0入門完全ガイド+実践サンプル集 [CD-ROM付]

This entry was posted in FLASH Actionscript. Bookmark the permalink.

2 Responses to Actionscript:三角関数で雪を降らせる

  1. レオ says:

    はじめまして!
    この雪の振るスクリプトを全部教えていただけないでしょうか?
    ファイルのサンプルなど公開していただけると自分でも把握できるのですが・・。
    よろしくお願いいたします。

  2. お願いします says:

    僕もこれのタグを詳しく教えていただきたいのですが・・・・
    もしよろしければ
    めーっるアドレスをお教えいたします
    どうか教えてください

コメントをどうぞ

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>