In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: colin challenge for amateurs

らーめん 560円也
*
* とりあえず普通に普通っぽい感じのラーメンをば
* 色々惰性

Draw a Tasty Ramen !
* 
* You can edit and modify every piece of this code.
* Load more pictures of GU (ingredients of ramen)
* from flickr or draw one by yourself.
* Make it look tasty.
*
/**
 * Copyright zahir ( http://wonderfl.net/user/zahir )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/gdB8
 */

/*
 * らーめん 560円也
 *
 * とりあえず普通に普通っぽい感じのラーメンをば
 * 色々惰性
 */
/*
 * 
 * Draw a Tasty Ramen !
 * 
 * You can edit and modify every piece of this code.
 * Load more pictures of GU (ingredients of ramen)
 * from flickr or draw one by yourself.
 * Make it look tasty.
 *
 */
package{
	import flash.display.Sprite;
	import flash.display.*;
	import flash.events.*;
	import flash.geom.*;
	import flash.net.*;
	import flash.system.*;
	[SWF(width="460", height="460", backgroundColor="0xFFFFFF", frameRate="30")]
	public class FlashTest extends Sprite{
		private var _loader        :Loader;
		private var _loaderInfo    :LoaderInfo;
		private var _loader_GU     :Loader;
		private var _loaderInfo_GU :LoaderInfo;
		private var RAMEN_URL :String   = "http://farm3.static.flickr.com/2589/3787648401_0b3d62a314_o.png";
		private var NARUTO1_URL :String = "http://farm3.static.flickr.com/2466/3787648415_1f857d46cf_o.png";
		private var NARUTO2_URL :String = "http://farm4.static.flickr.com/3560/3788456920_5101174e6c_o.png";
		private var MENMA_URL :String   = "http://farm3.static.flickr.com/2628/3788456906_91e357245f_o.png";
		public function FlashTest(){
			init();
		}
		private function init():void{
                        Wonderfl.capture_delay(20);
                        
			stage.scaleMode=StageScaleMode.NO_SCALE;
			stage.align=StageAlign.TOP_LEFT;
			_loader=new Loader();
			_loader.load(new URLRequest(RAMEN_URL));
			_loaderInfo=_loader.contentLoaderInfo;
			_loaderInfo.addEventListener(Event.COMPLETE,onLoadComplete);

			var _w:int = 465 >>1;
			const pi:Number = 0.017453;
			var count:int = 6;
			
			// 湯気を出すぜ
			// しかしなんか違う…orz
			// もっとモワモワ感とか欲しい。っていうか出現がなぁ…
			this.addEventListener(Event.ENTER_FRAME, function(e:Event):void{
				if(count%6 == 0){
					var yuge:Yuge = new Yuge();
					yuge.x = Math.cos( 360 * Math.random()  * pi ) * 150*Math.random() + _w ;
					yuge.y = Math.sin( 360 * Math.random()  * pi ) * 150*Math.random() + _w ;
					addChild( yuge );
				}
				count++;
			});
		}
		private function onLoadComplete(event:Event):void{
			_loaderInfo.removeEventListener(Event.COMPLETE,onLoadComplete);
			addChild(_loader);
			draw_MOYOU();
			draw_GU();
			draw_ITEM();
			//load_GU();
			
			
			this.scaleX = this.scaleY = 0.7;
			this.x = (stage.stageWidth - this.width) /2 + 20;
			this.y = (stage.stageHeight - this.height)/2 + 50;
		}
		
		// 丼の模様を描く
		private function draw_MOYOU():void{
			var _w:Number = _loader.width >>1;
			var _h:Number = _loader.height >>1;
			var line:Shape = new Shape();
			addChild( line );
			var g:Graphics = line.graphics;
			g.lineStyle( 3, 0x990000, .6 );
			g.drawCircle( _w, _h, _w - 50);
			
			//模様 (雷紋と囍)
			//上
			var m1:Moyou = new Moyou();
			addChild( m1 );
			m1.x = (_loader.width - m1.width + 38) >>1;
			m1.y = 10;
			
			// 下
			var m2:Moyou = new Moyou();
			addChild( m2 );
			m2.rotation = 180;
			m2.x = (_loader.width + m2.width - 38) >>1;
			m2.y = _loader.height - 10;
			
			// 右
			var m3:Moyou = new Moyou();
			addChild( m3 );
			m3.rotation = 90;
			m3.x = _loader.width - 10;
			m3.y = (_loader.height - m3.height + 38) >>1;
			
			// 左
			var m4:Moyou = new Moyou();
			addChild( m4 );
			m4.rotation = 270;
			m4.x = 10;
			m4.y = (_loader.height + m4.height -38) >>1;
			
			m1.scaleX = m1.scaleY = m2.scaleX = m2.scaleY = m3.scaleX = m3.scaleY = m4.scaleX = m4.scaleY = 0.8;
			
			var ryu_d:Ryu = new Ryu();
			var bd:BitmapData = new BitmapData( 465, 465, true, 0xFFFFFF);
			var mt:Matrix = new Matrix();
			var pi:Number = 0.017453; // Math.PI / 180;
			mt.scale( 0.8, 0.8);
			mt.rotate( pi * 45);
			mt.translate( _loader.width - ryu_d.width - 0, 45);
			bd.draw( ryu_d, mt);
			
			mt.identity();
			mt.scale( 0.8, 0.8);
			mt.rotate( pi * 135 );
			mt.translate(_loader.width - ryu_d.height , _loader.height - ryu_d.width);
			bd.draw( ryu_d, mt );
			
			mt.identity();
			mt.scale( 0.8, 0.8);
			mt.rotate( pi * 225 );
			mt.translate( ryu_d.width , _loader.height - ryu_d.height);
			bd.draw( ryu_d, mt );
			
			mt.identity();
			mt.scale( 0.8, 0.8);
			mt.rotate( pi * 315 );
			mt.translate( 50 , ryu_d.height + 50);
			bd.draw( ryu_d, mt );
			
			var ryu:Bitmap = new Bitmap(bd);
			addChild(ryu);
		}
		
		// 具材を描く
		private function draw_GU():void{
			//ノリ
			var nori:Sprite = setNori();
			addChild(nori);
			nori.rotation = 10;
			nori.x = _loader.width - 170;
			nori.y = -80;
			nori.alpha = 0.98;
			
			
			// ナルトは右上のイメージ
			var naruto:Naruto = new Naruto( 75, 5, 18);
			addChild(naruto);
			naruto.x = _loader.width - 165;
			naruto.y = 100;
			var naruto2:Naruto = new Naruto( 75, 5, 18);
			addChild(naruto2);
			naruto2.x = _loader.width - 210;
			naruto2.y = 80;
			naruto2.z = 0;
			naruto2.rotationY = 30;
			naruto2.rotationX = -10;
			
			// メンマ 何処かしらの端の方
			setMenma();
			
			// 卵
			setTamago( 80, 1.8, 60, 230,-10);
			setTamago( 80, 1.8, 30, 100,40);
			
			// チャーシュー
			setChashu();
			
			// ネギ ラスト!
			var negi:Negi = new Negi();
			addChild(negi);
			negi.rotation = -20;
			negi.x = -60;
			negi.y = 70;
		}
		private function setMenma():void{
			var m1:Menma = new Menma();
			addChild(m1);
			m1.rotation = -60;
			m1.scaleX = m1.scaleY = 0.4;
			m1.x = 220;
			m1.y = 300;
			
			var m2:Menma = new Menma();
			addChild(m2);
			m2.rotation = -50;
			m2.scaleX = m2.scaleY = 0.45;
			m2.x = 160;
			m2.y = 260;
			
			var m3:Menma = new Menma();
			addChild(m3);
			m3.rotation = -20;
			m3.scaleX = m3.scaleY = 0.35;
			m3.x = 240;
			m3.y = 190;
		}
		private function setChashu():void{
			var chashu1:Chashu = new Chashu();
			addChild(chashu1);
			chashu1.scaleX = chashu1.scaleY = 0.45;
			chashu1.rotation = -30;
			chashu1.y = 220;
			chashu1.x = -30;
			
			var chashu2:Chashu = new Chashu();
			addChild(chashu2);
			chashu2.scaleX = chashu2.scaleY = 0.43;
			chashu2.rotation = -10;
			chashu2.y = 230;
			chashu2.x = 70;
		}
		private function setTamago( size:int, scale:Number, rot:Number, _x:int, _y:int):void{
			var tamago:Tamago = new Tamago( size );
			addChild( tamago );
			tamago.scaleX = tamago.scaleY = scale;
			tamago.rotation = rot;
			tamago.x = _x;
			tamago.y = _y;
		}
		private function setNori():Sprite{
			var s:Sprite = new Sprite();
			var nori1:Nori = new Nori( 90,160);
			s.addChild(nori1);
			var nori2:Nori = new Nori( 90,160);
			s.addChild(nori2);
			nori2.rotation = 27;
			var nori3:Nori = new Nori(90,160);
			s.addChild(nori3);
			nori3.rotation = 60;
			nori1.x = -20;
			nori2.x = 110;
			nori2.y = 5;
			nori3.x = 230;
			nori3.y = 80;
			return s;
		}
		private function draw_ITEM():void{
		}
		// 具材の画像
		private function load_GU():void{
			_loader_GU=new Loader();
			_loader_GU.load(new URLRequest(MENMA_URL));
			_loaderInfo_GU=_loader_GU.contentLoaderInfo;
			_loaderInfo_GU.addEventListener(Event.COMPLETE,onLoadComplete_GU);
		}
		private function onLoadComplete_GU(event:Event):void{
			_loaderInfo_GU.removeEventListener(Event.COMPLETE,onLoadComplete_GU);
			// position adjustment for GU
			_loader_GU.x = 160;
			_loader_GU.y = 160;
			addChild(_loader_GU);
		}
	}
}
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.display.Graphics;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	import flash.display.BitmapData;
	import flash.geom.Matrix;
	import flash.display.Bitmap;
	import flash.display.GradientType;
	import flash.events.Event;
	import flash.geom.ColorTransform;
	import flash.geom.Matrix3D;
	import flash.filters.BlurFilter;
	
class HSV{
	public static function HSV2RGB(H:Number, S:Number, V:Number):uint{
		if(H<0) H+= 360; H %= 360;
        var h:Number = H / 60;
        var _h:Number = Math.floor( h );
        var v:Number = Math.max(0, Math.min( 0xFF, V * 0xFF) );
        var mr:uint = v <<16;
        var mg:uint = v <<8;
        var h_:Number = Math.round( v * ( 1 - ( 1- h+_h ) * S) );
        h = Math.round( v * (1- S * h + S* _h) );
        var n:Number = Math.round( v * (1-S) );
        var c:uint;
        switch(_h){
            case 0: c = mr| ( h_ << 8) | n; break;
            case 1: c = (h << 16) | mg | n; break;
            case 2: c = (n<<16) | mg | h_; break;
            case 3: c =  (n<<16) | (h<<8) | v; break;
            case 4: c = (h_<<16) | (n<<8) | v; break;
            case 5: c = mr | (n<<8) | h; break;
        }
        return c;
	}
}	

class Yuge extends Sprite{
	// 参考にさせて頂きました
	// http://wonderfl.net/code/bcf2f6c56e654605227285226db147dc64411ada
	private var scale:Number = 1;
	public function Yuge(){
		var s:Shape = new Shape();
		addChild(s);
		var g:Graphics = s.graphics;
		g.beginFill( 0xCCCCCC , 0.4);
		g.drawCircle(0,0, 15);
		g.endFill();
		filters = [ new BlurFilter(16,16) ];
		
		this.addEventListener( Event.ENTER_FRAME, enter);
	}
	public function enter(e:Event):void{
		scale *= 1.05;
		scaleX = scaleY = scale;
		alpha *= 0.95;
		this.y -= 2;
		if( alpha < 0.1){
			this.removeEventListener( Event.ENTER_FRAME, enter);
			parent.removeChild( this );
		}
	}
}
// レンゲ
class Renge extends Sprite{
	public function Renge(){
		// やる気力が…
	}
}
// 具材なクラス
class Menma extends Sprite{
	public function Menma(){
		const m1:Array = [[ 32,329, 32,330, 30,330, 30,329, 30,328, 30,327, 32,326, 33,325, 33,324, 34,323, 36,322, 37,320, 40,316, 42,314, 44,312, 46,310, 50,306, 53,304, 55,302, 59,298, 61,297, 63,295, 67,291, 69,290, 71,288, 72,287, 74,286, 76,285, 77,284, 78,284, 78,283, 79,283, 80,283, 80,282, 82,281, 83,281, 84,280, 85,280, 86,279, 87,279, 87,278, 88,278, 88,279, 89,279, 90,280, 91,280, 92,281, 93,281, 94,282, 95,282, 95,283, 96,283, 97,283, 98,284, 99,285, 101,286, 102,287, 103,288, 104,288, 105,289, 106,290, 108,291, 109,291, 110,292, 113,293, 114,294, 117,295, 118,296, 119,297, 122,299, 123,300, 126,302, 128,304, 129,305, 131,306, 134,308, 136,309, 137,310, 139,311, 143,312, 145,313, 147,314, 149,314, 150,315, 152,316, 155,317, 156,318, 159,320, 160,321, 161,321, 162,322, 164,323, 165,324, 166,324, 167,325, 168,326, 169,327, 170,328, 171,329, 172,330, 173,331, 173,332, 174,332, 175,332, 175,333, 176,333, 177,334, 178,334, 178,335, 179,335, 180,335, 180,336, 181,336, 182,336, 182,337, 183,337, 184,337, 184,338, 185,338, 186,338, 187,338, 188,338, 189,338, 189,337, 190,337, 191,337, 192,337, 193,336, 195,336, 197,335, 198,335, 200,335, 202,334, 203,334, 204,334, 206,334, 207,334, 209,333, 211,333, 212,333, 214,332, 215,332, 218,332, 220,332, 221,332, 224,331, 225,331, 226,331, 227,331, 228,331, 229,331, 230,331, 231,331, 233,331, 234,331, 235,331, 236,331, 237,331, 238,331, 240,331, 241,331, 242,331, 243,331, 244,331, 245,331, 246,331, 247,331, 248,331, 249,331, 250,331, 251,331, 252,331, 253,331, 254,331, 255,331, 256,331, 257,331, 258,331, 259,331, 260,331, 261,331, 262,331, 263,331, 264,331, 265,331, 266,331, 267,331, 268,332, 269,332, 270,332, 271,332, 272,332, 273,332, 274,332, 275,332, 276,332, 277,332, 279,332, 280,332, 281,332, 281,333, 282,333, 283,333, 284,333, 285,333, 285,332, 286,332, 286,331, 287,331, 287,330, 288,329, 288,328, 289,328, 289,327, 290,327, 290,326, 291,326, 291,325, 292,325, 292,324, 293,324, 293,323, 294,322, 295,321, 296,320, 296,319, 297,319, 298,318, 299,316, 300,315, 301,314, 301,313, 302,313, 304,311, 304,310, 305,309, 306,308, 308,307, 310,305, 312,304, 313,302, 315,301, 318,299, 319,298, 320,296, 322,296, 324,294, 325,293, 326,292, 328,290, 329,289, 331,288, 333,286, 335,284, 337,283, 338,281, 340,280, 341,279, 345,276, 346,275, 347,274, 348,273, 350,272, 351,272, 352,271, 353,271, 354,270, 355,270, 355,269, 357,268, 358,268, 359,267, 360,267, 362,266, 363,266, 364,265, 365,265, 366,264, 367,264, 368,263, 369,263, 370,262, 371,262, 372,262, 372,261, 373,261, 373,262, 374,262, 374,263, 375,263, 375,264, 375,265, 375,266, 375,267, 376,267, 376,268, 376,269, 377,270, 378,271, 378,272, 379,273, 379,274, 380,275, 380,276, 381,277, 381,278, 382,279, 382,280, 382,281, 383,283, 383,284, 384,285, 385,286, 385,287, 386,288, 387,289, 387,290, 388,291, 389,292, 390,293, 391,294, 392,295, 393,296, 394,297, 395,298, 396,299, 396,300, 397,301, 397,302, 398,302, 398,303, 399,303, 399,304, 399,305, 399,306, 400,307, 
											400,308, 401,308, 401,309, 401,310, 402,311, 402,312, 403,312, 403,313, 403,314, 404,314, 404,315, 405,315, 405,316, 405,317, 406,317, 406,318, 406,319, 405,319, 405,320, 404,321, 403,321, 403,322, 402,322, 401,322, 401,323, 400,323, 400,324, 399,324, 399,325, 398,325, 397,326, 396,326, 395,327, 394,328, 393,328, 393,329, 392,329, 392,330, 391,330, 390,331, 389,331, 389,332, 388,332, 387,333, 386,334, 385,335, 384,335, 383,336, 382,337, 381,338, 380,339, 380,340, 378,341, 377,342, 376,343, 375,344, 374,344, 373,345, 371,346, 370,347, 369,348, 368,349, 367,349, 367,350, 366,350, 365,351, 365,352, 363,353, 362,354, 361,355, 360,356, 359,357, 358,358, 357,359, 356,360, 355,361, 354,361, 353,363, 352,364, 351,365, 350,365, 349,366, 349,367, 348,367, 348,368, 347,368, 346,369, 345,370, 345,371, 344,371, 343,372, 342,372, 342,373, 341,374, 340,374, 339,375, 339,376, 338,376, 337,377, 337,378, 336,378, 336,379, 335,379, 334,379, 334,380, 333,380, 333,381, 332,381, 331,382, 330,383, 329,384, 328,385, 327,385, 327,386, 326,386, 326,387, 325,387, 325,388, 324,388, 323,388, 323,389, 322,389, 321,389, 320,389, 319,389, 319,390, 318,390, 317,390, 316,390, 315,390, 314,390, 313,390, 313,389, 312,389, 311,389, 310,389, 309,388, 308,388, 307,388, 306,388, 305,388, 304,388, 303,388, 302,388, 301,388, 300,388, 299,388, 298,388, 297,388, 296,387, 295,387, 294,387, 293,387, 292,387, 291,387, 290,387, 289,387, 288,387, 287,387, 287,386, 286,386, 285,386, 284,386, 283,386, 282,386, 281,386, 280,386, 279,386, 278,386, 278,385, 277,385, 276,385, 275,385, 273,385, 272,385, 271,385, 270,385, 268,385, 267,385, 265,385, 264,385, 263,385, 262,385, 261,385, 260,385, 259,385, 258,385, 257,385, 255,385, 254,385, 253,385, 252,385, 250,385, 248,385, 247,385, 246,385, 245,385, 244,385, 243,385, 241,385, 240,385, 239,385, 238,385, 236,385, 235,385, 233,385, 232,385, 231,385, 230,385, 229,385, 228,385, 227,385, 226,385, 224,385, 223,385, 222,385, 221,385, 220,385, 219,385, 217,384, 216,384, 215,384, 214,384, 213,384, 212,384, 211,384, 210,384, 209,384, 208,384, 207,384, 206,384, 204,384, 203,384, 202,384, 201,384, 200,384, 199,384, 197,384, 196,384, 195,384, 194,384, 192,384, 191,384, 190,384, 188,384, 187,384, 186,383, 185,383, 184,383, 182,383, 181,383, 180,383, 179,383, 178,383, 177,383, 176,383, 174,383, 173,383, 172,383, 171,383, 169,383, 168,383, 167,383, 166,383, 165,383, 164,383, 163,383, 161,383, 160,383, 159,383, 158,383, 157,383, 156,383, 155,383, 154,383, 153,382, 152,382, 151,382, 150,382, 149,382, 148,382, 147,382, 147,381, 146,381, 146,380, 145,380, 145,379, 144,379, 144,378, 143,378, 143,377, 142,377, 141,376, 140,376, 140,375, 139,375, 138,374, 137,374, 136,373, 135,373, 134,373, 134,372, 133,372, 132,372, 131,372, 130,372, 130,371, 129,371, 128,371, 127,370, 126,370, 125,369, 124,369, 124,368, 123,368, 122,368, 121,367, 120,367, 119,367, 119,366, 117,366, 116,366, 115,365, 114,365, 113,365, 112,365, 111,364, 110,364, 109,363,
											 108,363, 107,362, 105,362, 105,361, 103,361, 103,360, 102,360, 101,360, 100,360, 99,359, 98,359, 96,359, 95,359, 94,359, 92,359, 91,359, 90,359, 89,358, 88,358, 87,358, 86,357, 85,357, 84,357, 83,356, 82,356, 80,356, 79,356, 78,356, 77,356, 76,356, 75,356, 74,356, 73,356, 71,355, 70,355, 69,355, 68,355, 67,354, 66,354, 65,353, 64,353, 63,353, 62,353, 61,352, 60,352, 59,352, 58,352, 57,352, 56,352, 55,352, 54,352, 53,352, 51,352, 50,351, 49,351, 48,351, 47,351, 47,350, 46,350, 45,350, 44,350, 43,350, 42,350, 41,350, 40,350, 39,350, 38,349, 37,349, 36,349, 35,349, 34,349, 33,349, 32,349, 32,348, 30,348, 32,329] 
										,[ 30,329, 29,329, 30,328, 32,328, 33,328, 34,328, 35,328, 36,328, 37,328, 38,328, 39,328, 40,328, 41,328, 41,329, 42,329, 43,330, 44,330, 45,331, 46,331, 47,331, 48,332, 50,332, 51,332, 52,333, 53,333, 54,333, 55,334, 56,334, 57,334, 58,335, 59,335, 60,336, 62,336, 63,336, 64,337, 65,337, 66,337, 67,338, 68,338, 68,339, 69,339, 70,339, 71,340, 72,340, 73,340, 73,341, 74,341, 75,341, 75,342, 76,342, 76,343, 77,343, 78,343, 79,343, 80,343, 80,344, 81,344, 82,344, 83,345, 84,345, 85,345, 86,346, 87,346, 88,346, 89,346, 90,346, 91,346, 92,346, 93,346, 95,346, 96,347, 97,347, 98,347, 99,347, 100,348, 101,348, 102,348, 103,348, 104,348, 105,348, 107,348, 108,348, 109,348, 110,348, 111,348, 112,348, 113,348, 114,348, 115,348, 116,348, 117,348, 118,349, 119,349, 120,349, 121,349, 122,349, 123,349, 124,349, 124,350, 125,350, 126,350, 127,350, 128,350, 129,351, 130,351, 131,351, 132,352, 133,352, 134,352, 134,353, 135,353, 136,353, 136,354, 137,354, 138,355, 139,355, 140,356, 141,356, 142,356, 143,357, 144,357, 144,358, 145,358, 146,358, 146,359, 147,359, 148,359, 149,360, 150,360, 151,361, 152,361, 153,361, 154,362, 155,362, 156,362, 157,362, 157,363, 158,363, 159,363, 160,363, 161,363, 162,363, 163,363, 163,364, 164,364, 165,364, 165,365, 166,365, 167,365, 168,365, 169,365, 170,365, 171,365, 172,365, 173,365, 174,365, 174,366, 175,366, 176,366, 177,366, 178,366, 179,366, 180,366, 181,366, 182,366, 183,367, 185,367, 186,367, 187,367, 188,367, 189,367, 190,367, 191,367, 193,367, 194,367, 196,367, 197,368, 198,368, 199,368, 200,368, 201,369, 202,369, 204,369, 206,369, 207,369, 208,369, 209,369, 211,369, 212,369, 213,369, 214,369, 215,369, 216,369, 217,369, 218,369, 219,369, 221,369, 222,369, 223,370, 225,370, 226,370, 227,370, 228,370, 229,371, 230,371, 232,371, 234,371, 235,371, 236,371, 238,371, 239,371, 240,371, 241,371, 242,371, 243,371, 244,371, 245,371, 246,371, 247,371, 248,371, 250,371, 251,371, 252,371, 253,371, 256,371, 257,371, 258,371, 259,371, 261,371, 262,371, 264,371, 265,371, 266,371, 267,371, 269,371, 270,371, 271,371, 272,371, 273,371, 273,370, 274,370, 275,370, 276,370, 277,370, 278,370, 279,370, 280,370, 281,370, 282,370, 283,370, 284,370, 285,370, 286,370, 287,370, 288,370, 289,370, 290,370, 291,370, 292,370, 293,370, 294,370, 294,371, 295,371, 296,371, 297,371, 298,371, 299,371, 300,370, 301,370, 302,370, 303,370, 304,370, 305,370, 306,370, 307,370, 307,369, 308,369, 308,368, 309,368, 310,368, 311,367, 312,367, 313,367, 314,367, 315,366, 316,366, 317,366, 318,365, 319,365, 320,364, 321,364, 322,364, 323,364, 324,363, 325,362, 326,362, 326,361, 327,361, 328,361, 328,360, 329,359, 330,359, 331,359, 331,358, 332,357, 333,357, 333,356, 334,356, 334,355, 335,355, 335,354, 336,354, 337,353, 338,352, 339,352, 339,351, 340,351, 341,350, 342,350, 343,349, 344,348, 345,347, 346,347, 347,346, 348,345, 349,344, 350,344, 351,343, 351,342, 352,342, 353,342, 353,341, 354,341, 355,340, 356,340, 356,339, 357,339, 358,338, 
										358,337, 359,337, 360,336, 361,336, 362,335, 363,334, 364,334, 364,333, 365,333, 365,332, 366,332, 367,332, 367,331, 368,331, 369,330, 370,329, 371,328, 372,328, 372,327, 373,327, 374,326, 374,325, 375,325, 376,324, 377,324, 377,323, 378,323, 378,322, 379,322, 380,321, 381,320, 382,319, 382,318, 383,317, 384,316, 384,315, 385,315, 385,314, 386,314, 386,313, 387,313, 387,312, 388,312, 388,311, 389,311, 390,310, 391,310, 391,309, 392,309, 392,308, 393,308, 393,307, 394,307, 395,307, 396,307, 396,308, 397,308, 397,309, 397,310, 398,310, 398,311, 399,311, 400,311, 400,312, 401,312, 402,312, 402,313, 402,314, 403,314, 403,315, 402,315, 402,316, 401,316, 400,317, 400,318, 399,318, 399,319, 398,319, 397,320, 397,321, 396,321, 396,322, 395,322, 395,323, 396,323, 397,323, 397,324, 396,324, 395,324, 395,325, 394,325, 393,326, 392,326, 392,327, 391,328, 390,328, 390,329, 389,329, 389,330, 388,330, 388,331, 387,331, 387,332, 386,332, 386,333, 385,333, 384,333, 384,334, 383,334, 383,335, 382,335, 382,336, 381,336, 381,337, 380,337, 380,338, 379,338, 378,338, 378,339, 377,340, 376,340, 376,341, 375,341, 374,342, 373,342, 373,343, 372,343, 372,344, 371,344, 371,345, 370,345, 370,346, 369,346, 369,347, 368,347, 368,348, 367,348, 367,349, 366,349, 366,350, 365,350, 365,351, 364,351, 364,352, 363,352, 363,353, 362,353, 362,354, 361,354, 361,355, 360,355, 360,356, 359,356, 358,357, 357,358, 356,358, 356,359, 356,360, 355,360, 354,361, 353,361, 353,362, 352,362, 352,363, 351,363, 350,364, 349,364, 349,365, 348,365, 348,366, 347,366, 347,367, 346,367, 345,367, 345,368, 344,368, 344,369, 343,369, 343,370, 342,370, 342,371, 341,371, 341,372, 340,372, 340,373, 339,373, 339,374, 338,374, 338,375, 337,375, 337,376, 336,376, 336,377, 335,378, 335,379, 334,379, 334,380, 333,380, 332,380, 331,381, 331,382, 330,382, 329,382, 329,383, 328,383, 328,384, 327,384, 326,384, 326,385, 325,385, 325,386, 324,386, 323,386, 323,387, 322,387, 321,387, 320,387, 319,387, 318,387, 317,387, 316,387, 315,387, 314,387, 313,387, 312,387, 311,387, 310,387, 309,387, 308,387, 307,387, 306,387, 305,387, 304,387, 303,387, 302,387, 301,387, 300,387, 299,387, 298,387, 297,387, 296,387, 295,387, 294,387, 293,387, 292,387, 291,387, 290,387, 289,387, 288,387, 287,387, 286,387, 285,387, 284,387, 283,387, 282,387, 281,387, 280,387, 279,387, 278,387, 277,387, 276,387, 275,387, 274,387, 272,387, 271,387, 270,387, 269,387, 268,387, 267,387, 266,387, 264,387, 263,387, 262,387, 261,387, 260,387, 259,387, 258,387, 257,387, 256,387, 255,387, 254,387, 253,387, 251,387, 250,387, 249,387, 248,387, 247,387, 246,387, 245,387, 244,387, 243,387, 242,387, 241,387, 239,387, 238,387, 237,387, 236,387, 235,387, 234,387, 233,387, 232,387, 231,387, 230,387, 229,387, 228,387, 227,387, 226,387, 225,387, 224,387, 223,387, 222,387, 221,387, 220,387, 218,387, 217,387, 216,387, 215,387, 214,387, 213,387, 212,387, 211,387, 210,386, 209,386, 208,386, 207,386, 206,386, 204,386, 203,386, 202,386, 
										201,386, 200,386, 199,386, 198,386, 197,386, 196,386, 194,386, 193,386, 192,386, 191,386, 190,386, 189,386, 188,386, 187,386, 186,386, 185,386, 185,387, 184,387, 183,387, 182,387, 181,387, 180,387, 179,387, 178,387, 177,387, 176,387, 175,387, 174,387, 173,387, 172,387, 171,387, 170,387, 169,387, 168,387, 167,387, 166,387, 165,387, 164,387, 163,387, 162,387, 161,387, 160,387, 159,387, 158,387, 157,387, 156,386, 155,386, 154,386, 153,386, 152,386, 151,386, 150,386, 149,386, 148,386, 147,385, 146,385, 146,384, 145,384, 144,383, 143,383, 143,382, 142,382, 141,382, 141,381, 140,381, 139,381, 139,380, 138,380, 137,380, 137,379, 136,379, 135,379, 134,378, 133,378, 133,377, 132,377, 131,377, 131,376, 130,376, 129,376, 129,375, 128,375, 128,374, 127,374, 126,374, 125,374, 125,373, 124,373, 124,372, 123,372, 122,372, 122,371, 121,371, 121,370, 120,370, 120,369, 119,369, 119,368, 118,368, 118,367, 117,367, 116,366, 115,366, 115,365, 114,365, 113,365, 112,365, 111,365, 110,365, 110,364, 109,364, 108,363, 107,363, 106,363, 105,363, 105,362, 104,362, 103,362, 102,362, 102,361, 101,361, 100,361, 100,360, 99,360, 98,360, 97,360, 96,360, 96,359, 95,359, 94,359, 93,359, 92,359, 91,359, 91,358, 90,358, 89,358, 88,358, 87,358, 86,358, 86,357, 85,357, 84,357, 83,357, 82,357, 81,357, 80,357, 79,357, 78,357, 77,358, 76,358, 75,358, 74,358, 73,358, 72,357, 71,357, 70,357, 69,357, 68,357, 67,357, 66,356, 65,356, 64,356, 63,356, 62,356, 61,356, 60,356, 59,356, 58,356, 57,355, 56,355, 55,355, 54,355, 53,355, 52,355, 51,355, 50,355, 49,355, 48,355, 47,355, 47,354, 46,354, 45,354, 44,354, 43,354, 42,354, 41,354, 40,354, 40,353, 39,353, 38,353, 38,352, 37,352, 36,352, 36,351, 35,351, 34,351, 33,351, 33,350, 32,350, 30,350, 30,349, 29,349, 29,348, 28,348, 30,329] 
										];
		var arr:Array = m1[0] as Array;
		var len:int, len2:int;
		var i:int, j:int;
		len = arr.length;
		var g:Graphics = this.graphics;
		g.lineStyle(3,HSV.HSV2RGB(25,0.95,0.45));
		g.beginFill(HSV.HSV2RGB(36,0.85,0.8));
		g.moveTo( arr[0],arr[1]);
		for(i=2;i<len;i+=2) g.lineTo( arr[i],arr[i+1]);
		g.endFill();
		
		arr = m1[1] as Array;
		len = arr.length;
		g.lineStyle(0, 0, 0);
		g.beginFill(HSV.HSV2RGB(30,0.85,0.7));
		g.moveTo( arr[0],arr[1]);
		for(i=2;i<len;i+=2) g.lineTo( arr[i],arr[i+1]);
		g.endFill();
	}
}
class Chashu extends Sprite{
	public function Chashu(){
		const base:Array = [ 203,423,   202,423,   202,424,   201,424,   200,424,   199,424,   198,424,   197,424,   196,424,   195,425,   194,425,   193,425,   192,425,   191,425,   190,425,   189,425,   188,425,   187,425,   186,425,   185,425,   184,425,   184,426,   183,426,   182,426,   181,426,   180,426,   179,426,   178,426,   177,426,   176,426,   175,426,   174,426,   173,426,   172,426,   171,426,   170,426,   169,425,   168,425,   168,424,   167,424,   166,424,   165,423,   164,423,   163,423,   162,423,   161,423,   161,422,   160,422,   159,422,   158,421,   157,420,   155,419,   154,419,   153,419,   153,418,   152,418,   151,418,   150,418,   149,418,   148,417,   147,417,   147,416,   146,416,   145,416,   145,415,   144,415,   143,415,   143,414,   142,414,   141,414,   140,414,   139,413,   138,413,   138,412,   137,412,   137,411,   136,410,   136,409,   135,409,   134,408,   134,407,   133,407,   133,406,   132,406,   132,405,   131,405,   131,404,   131,403,   130,403,   130,402,   129,402,   129,401,   128,401,   128,400,   127,400,   127,399,   126,399,   125,399,   124,399,   123,399,   123,400,   122,400,   121,400,   120,400,   119,400,   118,399,   118,398,   117,398,   117,397,   116,397,   115,397,   114,397,   113,397,   112,396,   111,396,   110,396,   109,395,   108,395,   108,394,   107,394,   106,394,   106,393,   105,393,   105,392,   104,392,   104,391,   103,391,   103,390,   102,390,   102,389,   101,388,   100,388,   99,388,   99,387,   98,387,   98,386,   97,386,   96,385,   95,385,   95,384,   94,384,   93,384,   93,383,   92,383,   92,382,   91,381,   90,381,   89,381,   88,380,   87,380,   86,379,   85,379,   85,378,   84,378,   83,378,   83,377,   82,377,   81,377,   81,376,   80,376,   80,375,   79,375,   79,374,   78,374,   77,374,   77,373,   76,373,   75,373,   74,372,   73,371,   72,370,   71,369,   70,369,   69,369,   69,368,   68,368,   67,367,   66,367,   66,366,   65,366,   65,365,   65,364,   64,363,   63,362,   62,362,   62,361,   61,361,   61,360,   60,360,   60,359,   60,358,   59,358,   59,357,   59,356,   58,356,   58,355,   58,354,   57,353,   57,352,   57,351,   56,351,   56,350,   56,349,   56,348,   55,345,   55,344,   55,343,   55,342,   54,340,   54,339,   54,338,   53,338,   53,337,   53,336,   53,335,   53,334,   53,333,   53,332,   52,331,   52,330,   52,329,   52,328,   52,327,   52,326,   52,325,   52,324,   52,323,   52,322,   52,321,   52,320,   52,319,   53,319,   53,318,   53,317,   53,316,   54,316,   54,314,   54,313,   54,311,   54,310,   54,309,   54,308,   55,308,   55,307,   55,306,   55,305,   55,304,   56,303,   56,302,   56,301,   56,300,   56,299,   56,298,   57,298,   57,297,   57,296,   57,295,   57,294,   57,293,   57,292,   57,291,   57,290,   57,289,   57,288,   57,287,   58,286,   58,285,   58,284,   58,283,   58,282,   58,281,   58,280,   58,279,   58,278,   58,277,   58,276,   59,276,   59,274,   59,273,   59,272,   59,271,   58,270,   58,269,   58,268,   58,267,   59,266,
										   59,265,   59,264,   60,263,   60,261,   60,260,   61,259,   61,258,   61,257,   61,256,   61,255,   62,254,   62,253,   62,252,   62,251,   62,250,   62,249,   63,247,   63,246,   63,245,   63,244,   64,242,   64,241,   64,240,   64,239,   65,239,   65,238,   65,237,   65,236,   65,235,   65,234,   65,233,   65,232,   66,231,   66,230,   66,229,   66,228,   66,227,   67,227,   67,226,   67,225,   67,224,   67,222,   67,221,   67,220,   68,220,   68,219,   68,218,   68,217,   68,216,   68,215,   68,214,   68,213,   69,213,   69,212,   69,211,   69,210,   70,209,   70,208,   70,207,   71,206,   72,205,   73,205,   74,205,   75,205,   76,205,   77,205,   78,205,   78,204,   79,204,   80,204,   81,203,   81,202,   82,202,   83,201,   84,200,   84,199,   85,199,   85,198,   86,198,   86,197,   87,197,   87,196,   87,195,   88,195,   88,194,   89,193,   89,192,   90,191,   90,190,   91,189,   91,188,   91,187,   92,187,   92,186,   92,185,   93,185,   93,184,   94,184,   94,183,   95,182,   95,181,   96,180,   96,179,   97,178,   98,177,   98,176,   99,176,   99,175,   99,174,   100,174,   100,173,   100,172,   101,171,   102,170,   102,169,   102,168,   103,168,   103,167,   104,167,   104,166,   104,165,   105,164,   106,164,   106,163,   107,163,   108,163,   108,162,   109,163,   110,163,   111,163,   112,163,   113,163,   115,162,   115,161,   116,161,   117,161,   118,161,   119,160,   120,160,   121,160,   122,160,   123,160,   123,159,   124,159,   125,159,   126,159,   127,159,   127,158,   128,158,   129,158,   129,157,   130,156,   131,156,   131,155,   132,155,   133,154,   134,153,   135,152,   136,152,   136,151,   138,150,   139,149,   140,148,   141,147,   142,147,   142,146,   143,145,   144,145,   145,144,   146,143,   147,142,   148,141,   149,140,   150,140,   150,139,   151,139,   152,138,   153,137,   154,136,   155,135,   156,135,   157,134,   158,133,   159,131,   160,131,   161,130,   161,129,   162,128,   163,128,   163,127,   164,126,   165,126,   165,125,   166,125,   168,124,   168,123,   169,123,   170,121,   171,121,   172,120,   173,119,   174,119,   174,118,   175,117,   176,117,   177,117,   178,116,   179,116,   179,115,   180,115,   181,115,   181,114,   182,114,   183,113,   185,112,   186,111,   187,111,   187,110,   188,110,   189,110,   189,109,   190,109,   191,108,   192,108,   193,107,   194,107,   195,106,   196,106,   196,105,   197,105,   197,104,   198,104,   199,104,   200,104,   200,103,   201,103,   202,103,   202,102,   203,102,   203,101,   204,101,   205,101,   206,101,   206,100,   207,100,   208,100,   209,100,   210,100,   211,100,   212,100,   212,99,   213,99,   214,99,   215,99,   216,99,   217,99,   218,99,   219,99,   220,99,   221,99,   222,99,   223,99,   224,99,   225,99,   226,99,   227,99,   228,99,   229,99,   229,100,   230,100,   231,100,   232,100,   234,100,   235,99,   236,99,   237,99,   239,99,   240,99,   241,99,   242,99,   243,99,   244,99,   246,99,   247,99,   
										   248,99,   249,99,   250,98,   251,98,   252,98,   253,98,   254,98,   256,98,   257,98,   258,98,   259,98,   260,98,   261,98,   262,98,   263,98,   264,98,   265,98,   266,98,   267,98,   268,98,   269,98,   271,98,   272,98,   273,99,   274,99,   275,99,   276,99,   277,99,   278,100,   279,100,   280,100,   281,100,   281,101,   282,101,   284,101,   285,101,   286,101,   288,102,   289,102,   291,102,   292,102,   293,103,   294,103,   295,103,   296,103,   298,104,   300,105,   301,105,   302,105,   304,106,   305,106,   306,106,   308,107,   309,107,   312,108,   313,109,   314,109,   315,110,   316,111,   317,111,   318,112,   319,113,   320,113,   322,114,   323,115,   324,115,   326,116,   327,116,   328,117,   330,118,   331,118,   331,119,   332,119,   333,120,   334,121,   335,121,   335,122,   336,122,   337,123,   338,124,   339,124,   340,125,   341,126,   342,127,   343,128,   344,128,   344,129,   345,130,   346,131,   346,132,   347,133,   348,134,   349,135,   349,136,   350,136,   350,137,   351,138,   352,139,   353,140,   353,141,   354,142,   354,143,   355,144,   355,145,   355,146,   355,147,   356,149,   356,150,   356,151,   357,153,   357,154,   357,155,   358,157,   358,158,   359,159,   359,160,   359,162,   360,163,   360,164,   360,165,   361,167,   361,168,   361,169,   362,171,   363,173,   364,175,   365,176,   365,177,   366,178,   367,180,   367,181,   367,182,   368,183,   368,185,   368,186,   369,187,   369,188,   370,189,   370,190,   371,191,   372,193,   373,193,   373,194,   374,196,   375,196,   375,198,   376,198,   376,199,   377,201,   378,201,   378,202,   379,204,   380,205,   380,206,   381,206,   381,207,   382,207,   382,208,   383,209,   384,209,   384,210,   385,211,   385,212,   385,213,   386,214,   387,215,   387,216,   388,217,   388,218,   389,218,   389,219,   390,220,   390,221,   391,222,   391,223,   392,224,   392,225,   393,225,   393,226,   394,227,   394,228,   394,229,   395,231,   395,232,   396,233,   396,234,   396,236,   396,237,   397,237,   397,238,   397,240,   398,241,   398,242,   398,243,   399,244,   399,245,   399,246,   399,247,   399,248,   399,249,   399,250,   399,251,   399,252,   399,254,   399,255,   399,256,   399,258,   399,259,   399,260,   399,262,   399,263,   399,264,   399,265,   399,266,   399,267,   399,268,   398,269,   398,270,   398,272,   398,273,   398,274,   398,275,   398,276,   398,277,   398,278,   398,279,   399,279,   399,280,   399,281,   399,282,   399,283,   399,284,   399,285,   399,286,   399,287,   399,288,   399,289,   399,290,   398,291,   398,292,   397,292,   397,293,   397,294,   396,294,   396,295,   395,296,   395,297,   394,298,   394,299,   394,300,   393,300,   393,301,   393,302,   393,303,   392,304,   392,305,   392,306,   392,307,   392,308,   392,309,   392,310,   392,311,   392,312,   392,313,   392,314,   392,315,   392,316,   392,317,   392,318,   392,319,   392,320,   392,321,   
										   392,322,   392,323,   392,324,   392,325,   392,326,   391,327,   391,328,   391,329,   391,330,   390,331,   390,332,   390,333,   390,334,   389,336,   389,337,   389,338,   388,339,   388,340,   388,341,   388,342,   388,344,   387,344,   387,345,   387,346,   387,347,   387,348,   387,349,   387,350,   386,351,   386,352,   386,353,   386,354,   386,355,   385,356,   385,357,   385,358,   384,358,   384,360,   383,361,   383,362,   383,363,   382,363,   382,365,   382,366,   381,367,   381,368,   381,369,   381,370,   380,370,   380,371,   380,372,   380,373,   380,374,   380,375,   379,376,   379,377,   378,377,   378,378,   378,379,   377,379,   377,380,   376,380,   375,381,   374,382,   373,382,   373,383,   372,383,   371,384,   370,384,   370,385,   369,385,   369,386,   368,386,   367,387,   367,388,   366,388,   366,389,   365,390,   364,391,   363,392,   362,393,   362,394,   361,394,   361,395,   360,395,   360,396,   359,396,   359,397,   358,397,   357,398,   357,399,   356,399,   355,400,   355,401,   354,401,   353,402,   352,403,   351,404,   350,404,   350,405,   349,405,   348,405,   348,406,   347,407,   346,407,   345,408,   344,408,   343,409,   342,409,   341,409,   340,409,   339,409,   339,410,   338,410,   337,410,   336,410,   335,410,   334,411,   333,411,   332,411,   331,411,   330,411,   329,412,   328,412,   327,412,   326,412,   325,412,   324,412,   323,412,   322,412,   321,412,   321,413,   320,413,   319,413,   318,413,   317,414,   316,414,   315,414,   315,415,   314,415,   313,415,   312,415,   312,416,   311,416,   310,416,   309,416,   308,416,   307,416,   306,417,   305,417,   304,417,   303,417,   302,418,   301,418,   300,418,   299,418,   298,418,   297,418,   296,418,   295,418,   294,418,   293,418,   292,418,   291,418,   291,419,   290,419,   289,419,   289,418,   288,418,   287,418,   287,417,   286,417,   285,417,   284,416,   283,416,   282,416,   281,415,   280,415,   279,415,   278,415,   278,414,   277,414,   276,414,   275,414,   274,414,   273,413,   272,413,   271,413,   270,413,   269,413,   268,413,   267,413,   266,413,   266,412,   265,412,   264,412,   263,412,   262,412,   261,412,   260,412,   259,411,   258,411,   257,411,   256,411,   255,411,   254,410,   253,410,   252,410,   251,410,   250,410,   249,410,   248,410,   247,410,   246,410,   245,410,   244,410,   243,409,   242,409,   241,409,   240,409,   239,409,   239,408,   238,408,   238,407,   238,406,   237,405,   237,404,   237,403,   236,403,   236,402,   236,401,   235,401,   234,401,   234,402,   233,402,   233,403,   232,403,   231,404,   230,404,   230,405,   229,405,   228,405,   228,406,   227,406,   227,407,   227,408,   226,409,   225,409,   225,410,   225,411,   224,411,   224,412,   224,413,   223,413,   223,414,   222,414,   222,415,   221,415,   221,416,   220,416,   220,417,   219,417,   219,418,   218,418,   217,418,   216,418,   216,417,   215,417,   214,417,
										   213,417,   212,417,   212,418,   211,418,   210,418,   210,419,   209,419,   208,419,   208,420,   207,420,   206,420,   205,420,   205,421,   204,421,   203,421,   203,422,   202,422,   203,423] ;
		
		const line:Array = [[ 112,383,   110,379,   109,377,   108,376,   106,371,   104,368,   103,363,   102,361,   101,358,   101,355,   100,351,   100,350,   100,343,   100,338,   100,334,   99,329,   99,328,   97,325,   97,323,   96,320,   96,318,   96,315,   96,313,   97,310,   98,306,   99,303,   100,301,   100,299,   100,298,   101,295,   101,293,   103,289,   104,288,   105,285,   107,283,   108,281,   109,280,   110,278,   110,277,   110,275,   111,273,   112,271,   113,269,   114,267,   115,264,   116,262,   117,262,   117,260,   118,260,   118,259,   118,258,   118,256,   120,253,   120,252,   123,248,   124,246,   125,245,   125,244,   126,243,   126,242,   127,241,   127,239,   128,237,   130,235,   131,233,   132,231,   133,230,   134,228,   135,227,   135,226,   136,224,   137,222,   137,221,   139,217,   139,216,   140,214,   140,213,   141,210,   142,209,   142,208,   142,207,   143,206,   143,205,   144,202,   144,201,   146,199,   147,198,   148,196,   150,195,   151,194,   151,193,   152,193,   152,192,   155,190,   156,189,   158,188,   160,186,   162,184,   165,182,   166,181,   168,181,   168,180,   172,178,   174,177,   177,176,   179,175,   181,173,   184,172,   185,172,   187,172,   188,171,   191,171,   192,170,   196,169,   199,169,   202,168,   204,167,   207,167,   209,167,   211,166,   214,166,   219,165,   221,165,   224,165,   228,164,   230,164,   231,164,   233,164,   235,164,   238,164,   241,164,   246,164,   253,164,   256,165,   259,165,   261,165,   265,166,   266,166,   271,166,   274,166,   277,166,   278,166,   284,166,   286,166,   288,166,   289,167,   291,167,   292,167,   296,168,   297,168,   301,169,   304,170,   305,170,   307,171,   308,172,   310,173,   312,174,   314,176,   315,176,   317,177,   318,178,   321,179,   322,179,   323,180,   323,181,   325,183,   327,184,   328,186,   329,188,   331,190,   332,193,   333,194,   334,196,   334,197,   335,199,   335,202,   336,206,   337,208,   337,211,   338,214,   338,216,   339,218,   340,219,   340,221,   340,223,   341,227,   342,228,   342,232,   342,234,   344,237,   345,239,   346,242,   347,243,   348,246,   349,249,   351,251,   352,254,   352,257,   354,260,   354,262,   354,264,   355,265,   355,267,   356,268,   356,270,   356,271,   356,273,   356,276,   356,277,   356,279,   356,280,   356,281,   356,283,   356,286,   356,287,   356,289,   355,292,   355,295,   354,297,   354,300,   354,301,   353,305,   353,308,   353,310,   353,312,   352,314,   352,317,   352,318,   352,321,   351,323,   351,326,   351,328,   350,331,   350,332,   350,334,   350,339,   350,341,   351,343,   351,346,   351,347],
										[ 236,385,   236,384,   235,384,   235,383,   235,382,   234,377,   234,376,   233,374,   233,372,   232,367,   232,366,   232,362,   232,359,   232,357,   231,353,   231,351,   231,347,   231,345,   231,340,   232,338,   232,335,   233,330,   233,328,   233,325,   234,321,   234,319,   234,316,   234,315,   234,313,   234,310,   234,308,   234,304,   234,302,   235,300,   235,297,   235,296,   236,294,   236,293,   236,291,   236,289,   236,288,   236,287,   236,286,   237,283,   237,282,   238,282,   238,281,   238,280,   238,279,   238,278,   238,277,   238,276,   238,275,   238,274,   239,273,   240,271,   240,270,   240,268,   240,267,   241,266,   241,265,   242,263,   242,262,   243,261,   243,260,   244,259,   244,258,   244,257,   245,256,   245,255,   246,255,   246,254,   246,255,   246,256,   246,257,   246,258,   246,259,   246,260,   247,262,   247,264,   247,265,   247,266,   247,268,   247,270,   246,272,   246,274,   246,275,   246,277,   246,278,   246,279,   246,281,   246,282,   246,283,   246,285,   246,287,   246,289,   246,290,   246,293,   245,295,   245,298,   245,301,   245,303,   245,304,   245,307,   244,309,   244,312,   244,313,   244,315,   244,318,   244,320,   244,321,   244,322,   244,323,   244,324,   244,325,   244,327,   244,328,   244,329,   244,330,   244,331,   244,332,   244,333,   245,333,   245,335,   245,336,   245,337,   245,338,   245,339,   245,340,   245,342,   245,343,   245,344,   245,345,   245,346,   245,348,   245,349,   245,351,   245,352,   245,353,   245,356,   245,357,   245,359,   245,361,   245,362,   245,364,   245,365,   245,367,   245,368,   245,369,   245,370,   244,371,   244,372,   244,373,   244,374,   244,375,   243,375,   243,376,   243,377,   243,378,   242,378,   242,379,   242,380,   241,381,   240,382,   240,384,   239,385,   239,386,   238,386,   237,387]
										,[ 192,411,   191,411,   191,410,   191,409,   190,408,   190,407,   190,406,   189,404,   189,401,   188,398,   187,396,   186,392,   185,390,   183,386,   182,383,   181,381,   181,379,   180,377,   179,374,   178,371,   178,369,   177,364,   177,362,   176,357,   175,355,   175,353,   174,351,   174,349,   173,347,   172,345,   171,342,   171,341,   171,338,   171,336,   171,334,   171,333,   171,330,   171,328,   171,326,   171,324,   171,323,   170,322,   170,321,   169,319,   169,316,   169,315,   169,313,   169,311,   170,310,   170,309,   170,308,   170,307,   170,305,   170,304,   170,302,   170,301,   171,299,   171,298,   172,296,   172,295,   172,294,   172,293,   172,291,   173,291,   173,290,   173,289,   174,287,   175,286,   175,284,   176,283,   177,282,   177,280,   178,279,   178,278,   178,277,   179,277,   179,275,   180,273,   181,271,   181,268,   183,265,   183,264,   184,262,   185,262,   186,260,   186,259,   187,257,   188,256,   189,255,   189,253,   190,252,   190,250,   191,249,   191,248,   192,246,   192,245,   193,243,   194,242,   194,240,   195,238,   196,236,   196,235,   196,233,   197,231,   198,229,   198,227,   199,226,   199,224,   200,223,   201,222,   202,220,   203,220,   205,217,   207,216,   208,214,   209,214,   209,213,   210,213,   210,212,   211,212,   212,211,   213,211,   215,210,   217,210,   219,209,   221,209,   224,208,   225,208,   228,207,   230,207,   231,207,   233,207,   236,206,   237,206,   239,206,   240,205,   241,205,   242,205,   243,205,   244,204,   247,204,   251,202,   253,201,   257,200,   260,199,   263,198,   266,198,   267,198,   270,198,   272,198,   275,198,   279,198,   286,198,   289,198,   291,198,   294,200,   295,201,   295,203,   296,204,   297,205,   298,206,   300,207,   302,208,   304,210,   306,211,   307,214,   308,216,   309,220,   309,222,   310,225,   311,226,   312,227,   313,229,   315,231,   316,232,   318,235,   319,238,   320,242,   320,243,   321,246,   322,249,   322,252,   323,254,   324,256,   324,258,   325,260,   325,261,   326,263,   326,265,   326,268,   326,271,   326,275,   326,277,   325,280,   325,282,   325,285,   325,286,   326,289,   326,291,   326,293,   326,296,   325,299,   325,302,   324,308,   323,313,   323,314,   323,317,   323,318,   322,322,   322,325,   321,327,   321,328,   320,331,   320,333,   320,334,   319,337,   319,340,   319,341,   318,343,   318,346,   317,349,   316,350,   316,351,   315,353,   314,354,   313,357,   312,359,   311,360,   310,362,   309,364,   308,366,   307,368,   306,369,   305,370,   305,371,   304,373,   304,374,   303,375,   302,377,   302,378,   301,379,   300,380,   300,381,   299,381,   299,383,   298,384,   297,385,   297,386,   296,387,   296,388,   295,389,   295,390,   295,391,   295,392,   294,394,   294,396,   294,397,   294,401,   294,402,   294,404,   295,405,   295,406] ] ;
		
		const abura:Array =[ [ 302,268,   301,268,   300,268,   299,267,   299,265,   299,264,   298,262,   298,260,   298,257,   299,254,   299,252,   300,250,   301,249,   302,248,   302,247,   303,247,   303,246,   305,246,   306,246,   307,247,   308,247,   309,248,   310,248,   310,249,   311,250,   311,251,   311,253,   311,254,   311,256,   311,258,   311,259,   312,261,   312,262,   312,263,   312,265,   311,267,   311,268,   310,269,   310,270,   309,271,   309,272,   308,272,   307,273,   306,273,   305,274,   304,274,   303,274,   302,273,   301,273,   301,272,   302,268],
											[ 264,328,   263,327,   263,326,   262,323,   262,321,   262,319,   262,315,   263,312,   264,310,   264,309,   265,307,   266,305,   267,304,   268,304,   269,304,   270,304,   270,305,   271,306,   271,307,   272,309,   272,310,   272,312,   272,316,   272,318,   272,322,   272,324,   264,328] ,
											[ 196,334,   194,335,   193,335,   192,334,   192,333,   192,332,   192,331,   192,328,   192,325,   192,323,   192,319,   192,317,   192,315,   193,312,   193,310,   194,308,   195,305,   196,304,   196,303,   197,303,   198,302,   200,302,   200,303,   201,304,   203,307,   203,310,   204,312,   204,314,   204,316,   204,317,   205,320,   205,321,   205,324,   205,327,   205,329,   204,332,   203,335,   203,336,   203,337,   202,337,   201,337,   200,337,   199,337,   198,337,   196,334] ,
											[ 228,237,   227,237,   227,236,   227,235,   227,234,   227,233,   228,232,   229,231,   230,231,   231,230,   232,230,   232,231,   233,231,   233,233,   234,235,   234,236,   234,237,   234,238,   233,241,   232,242,   232,243,   231,243,   229,245,   228,246,   226,247,   224,248,   223,249,   222,249,   221,249,   221,250,   220,251,   219,252,   218,252,   218,253,   218,252,   217,252,   217,251,   217,250,   217,249,   217,248,   217,247,   217,246,   218,245,   219,244,   220,243,   221,242,   222,241,   224,240,   226,238,   227,237,   228,235,   230,233,   231,232,   232,232,   228,237], 
											[ 275,245,   275,244,   275,243,   275,242,   274,242,   274,241,   274,240,   273,239,   272,238,   272,237,   271,237,   270,236,   270,235,   269,235,   268,235,   267,236,   266,237,   265,237,   265,238,   264,238,   264,239,   265,239,   265,240,   265,241,   266,242,   267,243,   267,244,   268,245,   269,246,   269,247,   269,248,   270,249,   270,250,   271,251,   271,252,   271,253,   271,254,   271,255,   272,256,   272,257,   273,258,   274,258,   275,258,   275,257,   275,256,   275,255,   275,254,   274,253,   274,252,   274,251,   274,250,   273,249,   273,248,   273,247,   273,246,   273,245,   272,244,   272,243,   272,241,   271,241,   271,240,   271,239,   275,245],
											[ 148,258,   147,258,   147,257,   147,256,   147,255,   148,254,   148,253,   149,252,   150,251,   151,249,   152,248,   154,246,   155,245,   156,245,   158,244,   160,244,   162,243,   163,243,   164,243,   165,243,   165,244,   166,244,   167,245,   168,245,   168,246,   168,247,   167,248,   167,249,   167,250,   166,250,   166,251,   166,252,   165,254,   165,255,   164,257,   164,258,   163,259,   162,261,   162,262,   161,263,   160,265,   159,265,   159,266,   158,266,   157,267,   157,268,   156,268,   155,268,   155,269,   154,269,   153,269,   152,269,   151,269,   150,269,   149,268,   149,267,   149,266,   149,265,   148,263,   146,261,   145,260,   144,259,   143,258,   148,258] ,
											[ 197,190,   197,189,   197,188,   197,187,   197,186,   198,185,   199,184,   201,183,   202,182,   206,180,   209,178,   214,177,   216,176,   218,176,   219,175,   220,175,   221,175,   221,176,   220,176,   220,177,   219,177,   218,178,   216,180,   212,182,   211,183,   208,184,   204,186,   201,187,   198,188,   197,188,   196,188,   197,190] , [ 249,393,   249,392,   248,392,   248,391,   248,389,   248,388,   248,387,   248,384,   248,382,   248,379,   248,377,   248,375,   249,373,   249,372,   249,371,   250,369,   250,367,   250,366,   251,365,   251,364,   252,364,   253,364,   253,365,   253,366,   254,367,   254,368,   254,369,   254,371,   254,372,   254,374,   254,377,   254,378,   254,380,   254,382,   254,386,   254,388,   254,391,   254,392,   253,395,   253,396,   252,397,   249,393],
											[ 132,361,   130,360,   127,359,   126,359,   125,358,   124,357,   123,355,   122,354,   121,351,   121,349,   120,346,   120,343,   119,340,   119,337,   120,334,   122,333,   123,332,   125,331,   129,333,   130,334,   133,339,   134,343,   135,348,   137,352,   141,358,   142,359,   146,360,   132,361] , [ 337,321,   336,320,   336,318,   336,317,   336,316,   336,314,   336,313,   336,312,   336,311,   335,309,   335,308,   335,307,   334,306,   334,305,   334,303,   335,301,   335,300,   336,299,   337,299,   337,300,   337,301,   338,304,   338,310,   338,313,   339,318,   339,321,   339,324,   339,325,   338,327,   337,321]];
		
		var m:Matrix = new Matrix();
		var g:Graphics = this.graphics;
		var len:int = base.length, len2:int;
		m.createGradientBox( 357, 338, 90, 55, 90);
		g.lineStyle( 8 , HSV.HSV2RGB(26, 0.8,0.75));
		g.beginGradientFill( flash.display.GradientType.RADIAL,
										[HSV.HSV2RGB(3,0.18,0.8), HSV.HSV2RGB(6, 0.2, 0.85), HSV.HSV2RGB(19, 0.15, 0.9), HSV.HSV2RGB(32, 0.25, 0.98)],
										[1,1,1,1],[0,0x66, 0xCC, 0xFF],m,"pad","rgb", 0.5);
		g.moveTo( base[0], base[1]);
		for(var i:int = 2;i<len;i+=2) g.lineTo( base[i], base[i+1]);
		g.endFill();
		
		var j:int;
		var arr:Array;
		len = line.length
		g.lineStyle(0,HSV.HSV2RGB(8, 0.3, 0.7) ,0.4);
		for(i = 0; i<len; i++){
			arr = line[i] as Array;
			len2 = arr.length;
			g.moveTo( arr[0], arr[1]);
			for(j = 2;j<len2;j+=2) g.lineTo( arr[j], arr[j+1]);
		}
		
		g.lineStyle(1,0x999999,0.3);
		for(i = 0, len = abura.length; i<len; i++){
			arr = abura[i] as Array;
			len2 = arr.length;
			g.beginFill( HSV.HSV2RGB(8, 0.1, 0.9) );
			g.moveTo( arr[0], arr[1]);
			for(j = 2;j<len2;j+=2) g.lineTo( arr[j], arr[j+1]);
			g.endFill();
		}
	}
}
class Negi extends Sprite{
	public function Negi(){
		const pi:Number = 0.017453;
		const type:String = flash.display.GradientType.RADIAL;
		var cx:int, cy:int, _x:int, _y:int;
		cx = 465>>1;
		cy = 512>>1;
		var r:int = 100;
		var i:int;
		var g:Graphics = this.graphics;
		
		for(i=0; i<256; i++){
			var m:Matrix = new Matrix();
			var rad:Number = 360 * Math.random() * pi;
			var w:Number = 3 *Math.random() + 5;
			_x = Math.cos(rad) * (r*Math.random() + 1) + cx;
			_y = Math.sin(rad) * (r*Math.random() + 1 ) + cy;
			m.createGradientBox( w, w, 0, _x  -w/2, _y-w/2);
			
			g.lineStyle( 2, HSV.HSV2RGB(40*Math.random() +90, 0.9, 0.3*Math.random() + 0.25), 0.9 );
			g.beginGradientFill(type,[HSV.HSV2RGB(73,0.2,0.9), HSV.HSV2RGB(90, 0.25,0.9)],[0.75,0.9],[0x33,0xFF],m);
			g.drawCircle( _x, _y, w);
			g.endFill();
			g.lineStyle( 1, HSV.HSV2RGB(40*Math.random() +90, 0.9, 0.3*Math.random() + 0.2), 0.4 );
			g.drawCircle( _x, _y, w*0.6);
		}
	}
}
class Nori extends Bitmap{
	public function Nori( width:int, height:int){
		var bd:BitmapData = new BitmapData(width, height, false, 0xFFFFFF);
		bd.perlinNoise(5,40, 4, 5, false, false, 7, false);
		bd.colorTransform(bd.rect, new ColorTransform(0, 0.25, 0.15, 1, 1, 1, 0.8) );
		this.bitmapData = bd;
	}
}
class Tamago extends Shape{
	public function Tamago( size:int ){
		const pi:Number = 0.017453;
		var cx:Number, cy:Number , r:Number, r2:Number = size >> 2;
		cx = cy = r = size>>1;
		r = size / 3;
		var m:Matrix = new Matrix();
		m.createGradientBox(size, size*1.5, 0, 0, -cy/2);
		var g:Graphics = this.graphics;
		g.lineStyle( 0, 0xCC9933);
		g.beginGradientFill( flash.display.GradientType.RADIAL,
										[0xdcc8b4, 0xf0bc83, 0xeeb460],[1,1,1],[0,150,180],m);
		g.moveTo( Math.cos( pi * 315) * (r -5) + cx, Math.sin( pi * 315 ) * r + cy );
		g.curveTo( Math.cos( pi * 0) * (r) + cx, Math.sin( pi * 0 ) * (r - 20) + cy, Math.cos( pi * 45) * r + cx, Math.sin( pi * 45 ) * r + cy);
		g.curveTo( Math.cos( pi * 90) * (r - 10) + cx, Math.sin( pi * 90 ) * (r + 10) + cy, Math.cos( pi * 135) * r + cx, Math.sin( pi * 135 ) * r + cy);
		g.curveTo( Math.cos( pi * 180) * (r) + cx, Math.sin( pi * 180 ) * (r - 20) + cy,  Math.cos( pi *225) *( r - 5) + cx, Math.sin( pi * 225 ) * r + cy);
		g.curveTo(Math.cos( pi * 270) * (r) + cx, Math.sin( pi * 270 ) * (r + 15) + cy,  Math.cos( pi * 315) * (r -5) + cx, Math.sin( pi * 315 ) * r + cy );
		g.endFill();
		
		m.identity();
		m.createGradientBox( cx,cy, 0, cx/2, cy/2 );
		g.lineStyle( 0,0,0);
		g.beginGradientFill( flash.display.GradientType.RADIAL,
										[0xCC3300, 0xCC3300, 0xFFAA33, 0xFFCC33],[1,1,1,1],[0,100,220,250],m);
		g.drawCircle( cx, cy+5, r*0.6);
		g.endFill();
		
		r *= 0.2;
		for(var i:int=0; i<3; i++){
			var _x:int = Math.cos( pi *(360*Math.random()) ) * r+ cx;
			var _y:int = Math.sin( pi *(360*Math.random())) * r+ cy;
			var _w:Number = 3*Math.random() +1;
			var _h:Number = 3*Math.random() +1;
			m.identity();
			m.createGradientBox(_w, _h, 0, _x,_y);
			g.beginGradientFill( flash.display.GradientType.RADIAL,
										[0xFFFFCC, 0xFFFFCC, 0xFFFFCC],[1, 0.4,0.0],[0,180,255],m);
			g.drawEllipse( _x, _y, _w, _h );
			g.endFill();
		}
	}
}
class Naruto extends Shape{
	public function Naruto( size:int, diff:int = 5, giza:int = 12 ){
		var g:Graphics = this.graphics;
		var thickness:Number = (360 / giza) / 2;
		var len:int = giza * 2;
		var cx:Number, cy:Number, r:Number;
		cx = cy = r = size >>1;
		var r2:Number = r - diff;
		var flg:Boolean = false;
		var pi:Number = 0.017453;
		g.lineStyle(1,0xCCCCCC);
		var m:Matrix = new Matrix();
		m.createGradientBox( size, size);
		g.beginGradientFill( flash.display.GradientType.RADIAL,
										[0xEEEEEE, 0xCCCCCC],[1,1],[128,255],m);//所詮はすり身なので少しグレーに
		g.moveTo( Math.cos( pi * 0) * r + cx, Math.sin( pi * 0 ) *r + cy );
		for(var i:int = 1; i<len; i++){
			if(flg){
				flg = false;
				g.lineTo( Math.cos( pi * (i*thickness)) * r + cx, Math.sin( pi * (i*thickness) ) *r + cy );
			}else{
				flg = true;
				g.lineTo( Math.cos( pi * (i*thickness)) * r2 + cx, Math.sin( pi * (i*thickness) ) *r2 + cy );
			}
		}
		g.lineTo( Math.cos( pi * 0) * r + cx, Math.sin( pi * 0 ) *r + cy );
		g.endFill();
		
		r *= 0.7;
		g.lineStyle(4, 0xFF66CC );
		var rot:int = 0;
		g.moveTo( Math.cos( pi * rot) * r + cx, Math.sin( pi * rot ) *r + cy );
		while( r >= 0){
			rot = rot +1 %360;
			r -= 0.04;
			g.lineTo( Math.cos( pi * rot) * r + cx, Math.sin( pi * rot ) *r + cy );
		}
	}
}

// 模様なクラス
class Ryu extends Sprite{
	private var t:TextField;
	public function Ryu(){
		t = new TextField();
		t.htmlText = "<b>山</b>";
		t.autoSize = flash.text.TextFieldAutoSize.LEFT;
		
		var g:Graphics = this.graphics;
		g.lineStyle( 12, 0x119933 );
		g.moveTo(12,12);
		g.curveTo( 0, 24, 18, 24);
		g.curveTo( 60, -16, 48, 20);
		g.curveTo( 78, 6, 92, 24);
		g.lineTo( 100, 18);
		
		var s:Shape = new Shape();
		addChild( s );
		g = s.graphics;
		g.beginFill( 0xFF99FF );
		g.drawCircle(18,12, 8);
		g.endFill();
		g.beginFill( 0xFF99FF );
		g.drawCircle(24,14, 6);
		g.endFill();
		
		kumo( 0xCC1100, 2, 45, 55, -10);
		kumo( 0xCC1100, 1.3, 40, 22, 18);
		kumo( 0xCC1100, 1.1, 38, 30, -10);
		kumo( 0xCC1100, 0.9, 50, 96, -5);
		kumo( 0xFF33CC, 1, 40, 35, 10);
	}
	private function kumo( color:uint, scale:Number, rot:Number, _x:Number, _y:Number):void{
		var kumo:Bitmap = zuiun( color, scale);
		addChild(kumo);
		kumo.rotation = rot;
		kumo.x = _x;
		kumo.y = _y;
	}
	private function zuiun( color:uint , scale:Number):Bitmap{
		t.textColor = color;
		var m:Matrix = new Matrix();
		m.scale( scale, scale );
		var bd:BitmapData = new BitmapData( t.textWidth * scale, t.textHeight * scale , true, 0xFFFFFF);
		bd.draw( t , m);
		return new Bitmap(bd);
	}
}
class Moyou extends Sprite{
	public function Moyou(){
		var margin:int = 16;
		
		var left:Raimon = new Raimon( RaimonData.LEFT );
		addChild( left );
		
		var ki1:Ki = new Ki();
		addChild( ki1 );
		ki1.x = left.x  + left.width + margin;
		
		var ki2:Ki = new Ki();
		addChild( ki2 );
		ki2.x = ki1.x + ki1.width + 3;
		
		var right:Raimon = new Raimon( RaimonData.RIGHT );
		addChild( right );
		right.x = ki2.x + ki2.width + margin;
		
		left.rotation = -10;
		left.y = 25;
		right.rotation = 10;
		right.y = 15;
	}
}
class RaimonData{
	public static const LEFT:Array =	[	18, 6,  6,6,   6,12,   24,12,   24,0,   0,0,   0,18,   30, 18,
																30,0,
																60,0,   60,18,  36,18,  36,6,  54,6,  54,12,  42,12];
	public static const RIGHT:Array =	[	18, 12,  6,12,   6,6,   24,6,   24,18,   0,18,   0,0,   30, 0,
																30,18,
																60,18,   60,0,  36,0,  36,12,  54,12,  54,6,  42,6];
}
class Raimon extends Shape{
	public function Raimon( data:Array ){
		var g:Graphics = this.graphics;
		g.lineStyle( 2, 0xCC1100 );
		g.moveTo( data[0], data[1] );
		for(var i:int = 2, len:int = data.length; i<len; i+=2) g.lineTo( data[i], data[i+1]);
	}
}
class Ki extends Shape{
	public function Ki(){
		var g:Graphics = this.graphics;
		g.lineStyle( 2, 0xCC1100);
		g.moveTo( 0, 6);
		g.lineTo( 15, 6);
		g.moveTo( 0, 12);
		g.lineTo( 15, 12);
		g.moveTo( 7.5, 3);
		g.lineTo( 7.5, 12);
		g.drawRect( 0, 15, 15, 6);
		g.moveTo( 0, 27);
		g.lineTo( 15, 27);
		g.moveTo( 7.5, 21);
		g.lineTo( 7.5, 33);
		g.drawRect( 0, 33, 15, 6);
	}
}