聖闘士聖矢のアレを作ってみたが、絵心が無いので誰か続き頼む。

このエントリをはてなブックマークに追加このエントリをはてなブックマークに追加このエントリをdel.icio.usに追加このエントリをLivedoor Clipに追加このエントリをLivedoor Clipに追加このエントリをYahoo!ブックマークに追加このエントリをFC2ブックマークに追加このエントリをNifty Clipに追加このエントリをPOOKMARK. Airlinesに追加このエントリをBuzzurl(バザール)に追加このエントリをBuzzurl(バザール)に追加このエントリをChoixに追加このエントリをnewsingに追加このエントリをkwoutに追加
2008年10月7日 火曜日0:11:36

ソースファイル

今回は、短いので全ソース掲載。難しい事は何一つとしてやってない。

/*
 *  Copyright 2008 tarotarorg(http://tarotaro.org)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package org.tarotaro.flash.display
{
    import com.trick7.effects.TeraFire;
    import com.trick7.utils.TeraClock;
    import flash.display.DisplayObject;
    import flash.display.Sprite;
    import flash.events.Event;
   
    /**
     * 聖闘士聖矢黄道十二宮編に出てきた火時計っぽいもの。
     * 背景画像無し。
     * @author 太郎(tarotaro.org)
     */

    [SWF(width="200", height="200", backgroundColor="0", frameRate="30")]
    public class SanctuaryClock extends Sprite
    {
       
        public function SanctuaryClock():void
        {
            if (stage) init();
            else addEventListener(Event.ADDED_TO_STAGE, init);
        }
       
        private function init(e:Event = null):void
        {
            removeEventListener(Event.ADDED_TO_STAGE, init);
            // entry point
            var fires:Array = new Array(12);
            var degree:Number = 0;
            for (var i:uint = 0; i <12; i++) {
                degree = (-90 + 15 + 30 * i) * Math.PI / 180;
                var fire:TeraFire = new TeraFire(85 * Math.cos(degree) + 95,
                                                 85 * Math.sin(degree) + 105,
                                                 60, 60, 0x00CCFF, 0x092DE2);
                fire.phaseRateX = 3;
                fire.phaseRateY = 0;
                fires[i] = fire;
                this.addChild(fires[i]);
            }
           
            //ギリシャの時間
            var clock:TeraClock = new TeraClock(2);
           
            //着く炎と消える炎を判定
            for (i = 0; i <fires.length; i++) {
                fires[i].visible = (i>= clock.hours % 12);
            }

            //時刻に変動があった場合、着く炎と消える炎を再度判定
            clock.addEventListener(TeraClock.HOURS_CHANGED, function(e:Event):void
            {
                for (i = 0; i <fires.length; i++) {
                    fires[i].visible = (i>= clock.hours % 12);
                }
            });
           
        }
       
    }
   
}

  • ページ:
  • 1
  • 2

TrackBack URL :

コメントする

HTML convert time: 1.462 sec.