forked from: みきマスオ

by ProjectNya forked from みきマスオ (diff: 61)
♥0 | Line 46 | Modified 2011-04-04 19:46:28 | MIT License
play

ActionScript3 source code

/**
 * Copyright ProjectNya ( http://wonderfl.net/user/ProjectNya )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/f1wb
 */

// forked from say's みきマスオ
// forked from say's わかめちゃん
// forked from ProjectNya's 教材:矩形(四角)を描こう!
package {
    import flash.display.Sprite;
    import flash.display.Shape;
    import flash.filters.DropShadowFilter;

    public class Main extends Sprite {
        private var masuo:Masuo;

        public function Main() {
            init();
        }

        private function init():void {
            masuo = new Masuo();
            addChild(masuo);
            masuo.x = 232;
            masuo.y = 232;
            //
            masuo.filters = [new DropShadowFilter(20, 90, 0x000000, 0.5, 10, 16, 1, 1, false, false, false)];
            //
            var ribbon:Masuo = new Masuo(0xFF0066);
            masuo.addChild(ribbon);
            ribbon.x = 20;
            ribbon.y = -135;
            ribbon.scaleX = ribbon.scaleY = 0.2;
        }

    }
}


//////////////////////////////////////////////////
// Masuoクラス
//////////////////////////////////////////////////

import flash.display.Sprite;
import flash.display.Shape;

class Masuo extends Sprite {
    private var color:uint = 0x000000;

    public function Masuo(c:uint = 0x000000) {
        color = c;
        init();
    }

    private function init():void {
        graphics.beginFill(color);
        graphics.drawCircle(0, 20, 150);
        graphics.endFill();

        var ears:Shape;
        ears = new Shape();
        addChild(ears);
        ears.x = 0;
        ears.y = - 100;
        ears.graphics.beginFill(color);
        ears.graphics.drawCircle(-145, 0, 80);
        ears.graphics.drawCircle(145, 0, 80);
        ears.graphics.endFill();
    }

}