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

ボール並べ替えゲーム

一文字ずつ文字の書かれたボールが落ちてきます。
同じ色のボールの文字を並べ替えると、食べ物に関する単語になります。
正しい順番にクリックすると、その色のボールが消えます。
途中で間違いに気づいたら、ステージ上か他の色のボールをクリックすればやりなおせます。
やりなおしなしで正解するとコンボがつながり得点が上がります。
画面上のボールを全て消すと全消しボーナスが入ります。
100問クリアで終わりです。オールクリアでボーナス点が入ります。
ボールが上まで溜まるか、最後の問題で40秒以上経ってもクリアできないとゲームオーバーです。
追記:100問は疲れるので50問でクリアに修正。問題数は初期変数をいじれば変えられます。
Get Adobe Flash player
by meat18 06 Mar 2010
/*
一文字ずつ文字の書かれたボールが落ちてきます。
同じ色のボールの文字を並べ替えると、食べ物に関する単語になります。
正しい順番にクリックすると、その色のボールが消えます。
途中で間違いに気づいたら、ステージ上か他の色のボールをクリックすればやりなおせます。
やりなおしなしで正解するとコンボがつながり得点が上がります。
画面上のボールを全て消すと全消しボーナスが入ります。
100問クリアで終わりです。オールクリアでボーナス点が入ります。
ボールが上まで溜まるか、最後の問題で40秒以上経ってもクリアできないとゲームオーバーです。
追記:100問は疲れるので50問でクリアに修正。問題数は初期変数をいじれば変えられます。
*/
package {
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.display.BitmapData;
    import flash.display.Bitmap;
    import flash.text.TextFormat;
    import flash.events.*;
    import Box2D.Collision.*;
    import Box2D.Common.Math.*;
    import Box2D.Dynamics.*;
    import Box2D.Collision.Shapes.*; 
    import caurina.transitions.Tweener;
    import flash.utils.Timer;
    import flash.filters.GlowFilter;
    public class main extends Sprite{
        private const SCALE:Number = 40;//b2d世界の大きさを定義
        private const frameRate:int = 30;//フレームレート
        private const b2dQuarity:int = 4;//b2d演算の精度(数字が大きいほど高くて高負荷)
        private var world:b2World;//物理演算フィールドの定義
        private var b2cDef:b2CircleDef;//ボールの形の定義
        private var question:Array = [];//問題を格納する配列
        private var qNumber:int = 0;//問題の番号
        private var currentQnum:int = -1;//プレイヤーが取り組んでいる問題の番号(どのボールもフォーカスされていないときは-1)
        private var ballArrays:Array = [];//問題ごとに作られるボールの配列を格納する配列(2次元配列になります)
        private var answer:String = "";//プレイヤーがボールをクリックするごとに、そのクリックした文字が追加されます。答え合わせに使う変数です。
        private var score:int = 0;//スコア
        private var combo:int = 0;//コンボ
        private var maxq:int = 50;//クリアまでの問題数(10の倍数で設定)
        private var qDelay:int = 18000;//次のボールが落ちるまでの時間間隔(ミリ秒)問題が進むごとに短くなります。
        private var finalQDelay:int = 12000;//最後の問題におけるqDelayの値
        private var qDelayDec:int = (qDelay - finalQDelay)/maxq;
        private var qTimer:Timer = new Timer(qDelay,0);//問題ボールを落とすイベントトリガー
        private var gamepanel:Sprite = new Sprite();//スコアなどを表示する部分のスプライト
        private var scoreTF:ftdTextField = new ftdTextField("","right",20,0x000000);//スコアを表示するTextfield(カスタムクラス)
        private var comboTF:ftdTextField = new ftdTextField("","right",16,0x000000);//コンボを表示するTextfield(カスタムクラス)
        private var comboSprite:Sprite = new Sprite();//コンボエフェクト用スプライト
        private var ttf:TextField = new TextField();//コンボエフェクト用テキスト
        private var tft:TextFormat = new TextFormat();//コンボエフェクト用テキストの設定
        private var combospy:int = 0;//コンボエフェクト用スプライトのY座標
        private var numAns:int = 0;//プレイヤーがクリアした問題数
        private var numWo:int = 0;//ワイプアウト(全消し)の回数。ワイプアウトボーナスの計算に使用
        private var passbtn:Sprite = new Sprite();//パスボタン(未実装)
        private var passtf:TextField = new TextField();//パスボタン(未実装)
        private var wsp:Sprite = new Sprite();//"WIPE"の文字
        private var osp:Sprite = new Sprite();//"OUT!"の文字
        private var wopts:int;//本来ボールが落ちてくるタイミングからどれだけ早く全消ししたか(ミリ秒)
        private var wallBd:b2Body;//床。ゲームオーバー時消えます
        private var gover:Boolean = false;//ゲームオーバーしてるかどうか
        private var tf:TextField = new TextField();//各種メッセージ表示用
        private var stg:Sprite = new Sprite();//ステージ上のダミーのスプライト
            	
        public function main(){
            stage.align = "TL";
            stage.frameRate = frameRate;
            //ゲームスタート後の処理
            question = setQarray();
            setGame();
        }
        //ゲームの準備
        private function setGame():void{
        		gamepanel.graphics.beginFill(0xa0a0a0);
        		gamepanel.graphics.drawRect(0,0,150,465);
        		gamepanel.x = 315;
        		stg.graphics.beginFill(0xa0a0a0);
        		stg.graphics.drawRect(0,0,315,465);
        		stg.alpha = 0;
        		stg.addEventListener(MouseEvent.CLICK,gameStart);
        		stage.addChildAt(stg,0);
        		stage.addChild(gamepanel);
        		var stf:ftdTextField = new ftdTextField();
        		stf.x = 20;
        		stf.y = 20;
        		stf.autoSize = "left"; 
        		gamepanel.addChild(stf);
        		stf.text = "Score";
        		scoreTF.background = true;
        		scoreTF.backgroundColor = 0xFFFFFF;
        		scoreTF.text = String(score);
        		scoreTF.height = scoreTF.textHeight + 5;
        		scoreTF.y = 50;
        		scoreTF.x = 20;
        		gamepanel.addChild(scoreTF);
        		comboTF.text = String(combo) + " COMBO";
        		comboTF.x = 20;
        		comboTF.y = 100;
        		gamepanel.addChild(comboTF);
        		var wtf:ftdTextField = new ftdTextField("Wipe","left",50);
        		var otf:ftdTextField = new ftdTextField("Out!","left",50);
        		wtf.autoSize = "left";
        		otf.autoSize = "left";
        		wsp.addChild(Ball.bMapTxt(wtf));
        		wsp.x = -100;
        		wsp.alpha = 0;
        		osp.addChild(Ball.bMapTxt(otf));
        		osp.x = 300;
        		osp.y = 50;
        		osp.alpha = 0;
        		tf.text = "CLICK stage to START!"
        		tf.autoSize = "left";
        		tf.selectable = false;
        		tf.x = 100;
        		tf.y = 200;
        		stage.addChild(tf);
        }
        	private function gameStart(e:Event):void{
        		stg.removeEventListener(MouseEvent.CLICK,gameStart);
        		stg.addEventListener(MouseEvent.CLICK,stageClicked);
        		stage.removeChild(tf);
        		setWorld();
        		stage.addEventListener(Event.ENTER_FRAME,worldStep);
        		qTimer.addEventListener(TimerEvent.TIMER,Qstart);
        		setBall(setQuestion(question,2));
        		qTimer.start();
        	}
        //ボールクリック時の処理
        	private function wordSelected(e:Event):void{
        		var clickedBall:Ball = Ball(e.currentTarget);
        		var it:int;
        		var BA:Array;
        		var ans:String = clickedBall.ans;
        		if(currentQnum == -1){
        			currentQnum = clickedBall.qNumber;
        			answer = "";
        		}
        		clickedBall.removeEventListener(MouseEvent.CLICK,wordSelected);
        		if(clickedBall.qNumber != currentQnum){
        			//違う色のボールをクリックした場合の処理
        			BA = ballArrays[currentQnum];
        			it = BA.length;
        			for(var i:int = 0;i < it;i ++){
        				if(BA[i].getState()){
        					BA[i].clicked();
        					BA[i].addEventListener(MouseEvent.CLICK,wordSelected);
        				}
        			}
        			answer = ""; 
        			comboCrashed();
        			clickedBall.addEventListener(MouseEvent.CLICK,wordSelected);
        			currentQnum = -1;
        		}else{
        			//同じ色のボールをクリックした場合の処理
        			currentQnum = clickedBall.qNumber;
        			it = answer.length;
        			clickedBall.clicked();
        			answer += clickedBall.getTxt();
        			if(answer.length != ans.length){
        				//まだ問題の途中
        			}else{
        				if(answer == ans){
        					//正解時の処理
        					numAns ++;
        					combospy = clickedBall.y - 100;
        					BA = ballArrays[currentQnum];
        					BA.forEach(eraseBall);
        					delete ballArrays[currentQnum];
        					currentQnum = -1;
        					comboState();
        					score += answer.length + numAns * combo;
        					scoreTF.text = String(score);
        				}else{
        					//不正解時の処理
        					ballArrays[currentQnum].forEach(failedBall);
        					clickedBall.addEventListener(MouseEvent.CLICK,wordSelected);
        					comboCrashed();
        					answer = "";
        					currentQnum = -1;
        				}
        			}
        		}
        	}
        	//ボール選択のリセット
        	private function resetWord(e:Event = null):void{
        		if(currentQnum != -1){
        			ballArrays[currentQnum].foreach(failedBall);
        		}
        	}
        	private function failedBall(ball:*,index:int,ar:Array):void{
        		if(ball.getState()){
        			ball.clicked();
        			ball.addEventListener(MouseEvent.CLICK,wordSelected);
        		}
        	}
        	private function stageClicked(e:Event = null):void{
        		if(currentQnum != -1){
        			var BA:Array = ballArrays[currentQnum];
        			var it:int = BA.length;
        			for(var i:int = 0;i < it;i ++){
        				if(BA[i].getState()){
        					BA[i].clicked();
        					BA[i].addEventListener(MouseEvent.CLICK,wordSelected);
        				}
        			}
        			answer = ""; 
        			comboCrashed();
        			currentQnum = -1;
        		}
        	}
        	//正解時のボール消去
        	private function eraseBall(ball:Ball,index:int,ar:Array):void{
        		world.DestroyBody(ball.b2b);
        		Tweener.addTween(Ball(ball),{time:0.8,alpha:0,y:10,transition:"easeInBack",transitionParams:{overshoot :0.8},onComplete:function():void{removeChild(ball);}});
        	}
        	private function Qstart(e:Event = null):void{
        		checkBalls();
        		if(question.length == 0){
        			gameover();
        		}
        		if(!gover){
        			setBall(setQuestion(question,2));
        			qDelay -= qDelayDec;
        			if(question.length == 0){
        				qDelay = 40000;
        			}
        			qTimer.delay = qDelay;
        			qTimer.start();
        		}
        	}
        	//問題のセッティング 
        	private function setQuestion(q:Array,numQ:int = 2):Array{
        		var q1:Array = q.splice(0,numQ);
        		return q1; 
        	}
        	private function setQarray():Array{
        		var a:Array = randomSort(Qs.food3);
        		var b:Array = randomSort(Qs.food4);
        		var c:Array = randomSort(Qs.food5);
        		var q:Array = [];
        		for(var i:int = 0;i < maxq/10 - 1;i ++){
        			q = q.concat(a.splice(0,4),b.splice(0,4),c.splice(0,2));
        		}
        		q = q.concat(c.splice(0,10));
        		return q;
        	}
        	//ボールのセッティング
        	private function setBall(qq:Array):void{
        		var qql:int = qq.length;
        		var allLength:int = 0;
        		var yar:Array = [];
        		for(var i:int = 0;i < qql;i ++){
        			allLength += qq[i].length;
        		}
        		for(i = 0;i < allLength;i ++){
        			yar.push(-i*42);
        		}
        		yar = randomSort(yar);
        		for(var j:int = 0;j < qql;j ++){
        			var q:String = qq[j];
        			var qlength:int = q.length;
        			var ballArray:Array = [];
        			var color:int = randomColor();
        			var innerColor:int = randomColor();
        			var b2dArray:Array = [];
        			var qind:int = Math.floor(Math.random()*qlength);
        			var hidden:Boolean = qlength > 4; 
        			for(i = 0;i < qlength;i ++){
        				if(hidden && i == qind && Math.floor(Math.random()*10) < 6 && numAns > maxq/2){
        					ballArray.push(new Ball(q.charAt(i),color,innerColor,qNumber,true));
        				}else{
        					ballArray.push(new Ball(q.charAt(i),color,innerColor,qNumber));
        				}
        				ballArray[i].addEventListener(MouseEvent.CLICK,wordSelected);
        				ballArray[i].x = Math.floor(Math.random()*280) + 20;
        				ballArray[i].y = yar.splice(0,1)[0];
        				var bod:b2BodyDef = new b2BodyDef();
        				bod.position.Set(ballArray[i].x / SCALE, ballArray[i].y / SCALE);
        				bod.userData = ballArray[i];
        				var circbd:b2Body = world.CreateBody(bod);
        				circbd.CreateShape(b2cDef);
        				circbd.SetMassFromShapes(); 
        				ballArray[i].b2b = circbd;
        				ballArray[i].ans = q;
        				addChild(ballArray[i]);
        			}
        			ballArrays[qNumber] = ballArray;
        			qNumber ++;
        		}
        		var now:Date = new Date();
        		wopts = now.time;
        	}
        	//ランダムに色を取得
        	public function randomColor():int{
        		var rgb16:String = "";
        		for(var i:int = 0;i < 3;i ++){
        			var a:String = String(int(Math.floor(Math.random()*140) + 50).toString(16));
        			a = a.length == 1?"0" + a:a; 
        			rgb16 += a; 
        		}
        		return int("0x" + rgb16);
        	}
        	//配列のランダムソート
        	public function randomSort(a:Array):Array{
        		var alength:int = a.length;
        		while(alength > 0){
        			var rnd:Number = Math.floor(Math.random() * alength);
        			a.push(a[rnd]);
        			a.splice(rnd,1);
        			alength--;
        		}
        		return a;
        	}
        	//コンボ処理 
        	private function comboState():void{
        		combo ++;
        		comboTF.text = String(combo) + " COMBO";
        		if(combo > 1){displayCombo();}
        	}
        	//コンボ表示
        	private function displayCombo():void{
        		comboSprite = new Sprite();
        		ttf.autoSize = "left";
        		tft.color = 0xFF0000;
        		tft.size = 80;
        		tft.bold = true;
        		ttf.defaultTextFormat = tft;
        		ttf.text = String(combo);
        		var tfbmp:Bitmap = Ball.bMapTxt(ttf);
        		var combox:int = tfbmp.width;
        		var comboy:int = tfbmp.height;
        		comboSprite.addChild(tfbmp);
        		tft.size = 20;
        		ttf.defaultTextFormat = tft;
        		ttf.text = "COMBO";
        		tfbmp = Ball.bMapTxt(ttf);
        		tfbmp.x = combox;
        		tfbmp.y = comboy - 40;
        		comboSprite.addChild(tfbmp);
        		comboSprite.alpha = 1;
        		comboSprite.x = 50;
        		comboSprite.y = combospy; 
        		stage.addChild(comboSprite);
        		Tweener.addTween(comboSprite,{scaleX:1.5,scaleY:1.5,alpha:0,time:2,x:150,y:combospy-comboSprite.height,onComplete:function():void{stage.removeChild(this);}});
        	}
        	//コンボが途切れた時の処理
        	private function comboCrashed():void{
        		combo = 0;
        		comboTF.text = String(combo) + " COMBO";
        	}
        	
        	//物理演算(box2d)のセッティング
        	private function setWorld():void{
        		var worldAABB:b2AABB = new b2AABB();
        		worldAABB.lowerBound.Set(-100.0, -100.0);
        		worldAABB.upperBound.Set(100.0, 100.0);
        		var gravity:b2Vec2 = new b2Vec2(0.0, 10.0);
        		world = new b2World(worldAABB, gravity, true);
        		
        		var wallBdDef:b2BodyDef = new b2BodyDef();
        		wallBdDef.position.Set(stage.stageWidth / SCALE/2, (stage.stageHeight+20) / SCALE);
        		wallBd = world.CreateBody(wallBdDef);
        		var wallShapeDef:b2PolygonDef = new b2PolygonDef();
        		wallShapeDef.SetAsBox((stage.stageWidth + 50) / SCALE, 20 / SCALE);
        		wallBd.CreateShape(wallShapeDef);
        		
        		var wallBdDefLeft:b2BodyDef = new b2BodyDef();
        		wallBdDefLeft.position.Set(-20 / SCALE, stage.stageHeight / SCALE);
        		var wallBdLeft:b2Body = world.CreateBody(wallBdDefLeft);
        		var wallShapeDefLeft:b2PolygonDef = new b2PolygonDef();
        		wallShapeDefLeft.SetAsBox(20 / SCALE, stage.stageHeight * 2 / SCALE);
        		wallBdLeft.CreateShape(wallShapeDefLeft);
        		
        		var wallBdDefRight:b2BodyDef = new b2BodyDef();
        		wallBdDefRight.position.Set(335 / SCALE, stage.stageHeight / SCALE);
        		var wallBdRight:b2Body = world.CreateBody(wallBdDefRight);
        		var wallShapeDefRight:b2PolygonDef = new b2PolygonDef();
        		wallShapeDefRight.SetAsBox(20 / SCALE, stage.stageHeight * 2 / SCALE);
        		wallBdRight.CreateShape(wallShapeDefRight); 
        		
        		b2cDef = new b2CircleDef();
        		b2cDef.radius = 25 / SCALE;
        		b2cDef.density = 1;
        		b2cDef.friction = 1;
        		b2cDef.restitution = 0.6; 
        	}
        	//フレームごとの処理
        	private function worldStep(e:Event):void{
        		var now:Date;
        		var nowt:int;
        		var numBalls:int = 0;
        		for(var b:b2Body = world.GetBodyList(); b; b = b.GetNext()){
        			if(b.GetUserData() is Ball){
        				//物理演算処理
        				numBalls ++;
        				var balls:Ball = Ball(b.GetUserData()); 
        				balls.x = b.GetWorldCenter().x * SCALE;
        				balls.y = b.GetWorldCenter().y * SCALE;
        				balls.rotation = b.GetAngle() * 180 / Math.PI;
        				balls.alphaState = balls.alpha == 0.3 || balls.alpha == 1?"":balls.alphaState;
        				//同色ボールのフォーカス処理
        				if(currentQnum != balls.qNumber && currentQnum != -1){
        					if(balls.alphaState != "dec"){
        						balls.alphaState = "dec"; 
        						Tweener.addTween(balls,{alpha:0.3,time:1});
        					}
        				}else{
        					if(balls.alphaState != "inc"){
        						balls.alphaState = "inc";
        						Tweener.addTween(balls,{alpha:1,time:1});
        					}
        				}
        			}
        		}
        		//画面上にボールが無くなったら即追加
        		if(numBalls == 0 && numAns < maxq && !gover){
        			qTimer.stop();
        			numWo ++;
        			wsp.x = -100;
        			osp.x = 300;
        			stage.addChild(wsp);
        			stage.addChild(osp); 
        			Tweener.addTween(wsp,{alpha:1,x:100,time:1.5,transition:"easeOutQuint",onComplete:function():void{
        				Tweener.addTween(wsp,{alpha:0,x:300,time:1.5,transition:"easeInQuint",onComplete:function():void{stage.removeChild(wsp);}});
        			}});
        			Tweener.addTween(osp,{alpha:1,x:100,time:1.5,transition:"easeOutQuint",onComplete:function():void{
        				Tweener.addTween(osp,{alpha:0,x:-100,time:1.5,transition:"easeInQuint",onComplete:function():void{stage.removeChild(osp);}});
        			}});
        			now = new Date();
        			nowt = now.time;
        			var woBonus:Number = Math.floor((qDelay - nowt + wopts)/(50 - numWo));
        			score += woBonus;
        			scoreTF.text = score.toString();
        			wopts = nowt;
        			Qstart(); 
        		}
        		else if(numBalls == 0 && numAns == maxq && !gover){
        			qTimer.stop();
        			tf.text = "CLEARED!";
        			stage.addChild(tf);
        			score += score*0.25;
        			scoreTF.text = score.toString();
        			gover = true;
        		}
        		world.Step(1 / frameRate, 4);
        	}
        	//ゲームオーバー処理
        	private function checkBalls():void{
        		for(var b:b2Body = world.GetBodyList(); b; b = b.GetNext()){
        			if(b.GetUserData() is Ball){
        				var balls:Ball = Ball(b.GetUserData());
        				if(balls.y < 25){
        					gameover(); 
        				}
        			}
        		}
        	}
        	private function gameover():void{
        		world.DestroyBody(wallBd);
        		gover = true;
        		qTimer.stop();
        		tf.text = "GAME OVER...";
        		stage.addChild(tf);
        	}
    }
}

import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.events.Event;
import caurina.transitions.Tweener;
import flash.display.BitmapData;
import flash.display.Bitmap;
import Box2D.Dynamics.b2Body;
class Ball extends Sprite {
	public var b2b:b2Body;
	public var alphaState:String;
	public var ans:String;
	public var qNumber:int;
	public var numPushed:int;
	private var str:String;
	private var tf:TextField = new TextField();
	private var selectedTField:TextField = new TextField();
	private var tFormat:TextFormat = new TextFormat();
	private var bmtf:Bitmap;
	private var bmtf2:Bitmap;
	private var selected:Sprite;
	private var isSelected:Boolean = false;
	public function Ball(txt:String,color:int,innerColor:int = 0xFF0000,num:int = 0,hidden:Boolean = false,rad:int = 25){
		super();
		this.mouseChildren = false;
		this.buttonMode = true;
		this.qNumber = num;
		
		this.graphics.beginFill(color);
		this.graphics.drawCircle(0,0,rad);
		this.graphics.beginFill(innerColor);
		this.graphics.drawCircle(0,0,rad-6);
		
		this.tFormat.color = 0xFFFFFF;
		this.tFormat.align = "left";
		this.tFormat.size = 40;
		this.tFormat.bold = true;
		this.tf.defaultTextFormat = this.tFormat;
		this.str = txt;
		if(hidden){
			this.tf.text = "?";
		}else{
			this.tf.text = txt;
		}
		this.tf.width = this.tf.textWidth + 5;
		this.tf.height = rad*2;
		this.bmtf = bMapTxt(this.tf);
		this.bmtf.x = (rad*2 - this.tf.textWidth)/2 - 2 - rad;
		this.bmtf.y = -rad;
		this.addChild(this.bmtf);
		
		selected = new Sprite();
		selected.graphics.beginFill(color);
		selected.graphics.drawCircle(0,0,rad);
		selected.graphics.beginFill(innerColor);
		selected.graphics.drawCircle(0,0,rad-4);
		selected.alpha = 0;
		this.tFormat.color = 0x000000; 
		this.selectedTField.defaultTextFormat = this.tFormat;
		this.selectedTField.text = txt;
		this.selectedTField.width = this.selectedTField.textWidth + 5;
		this.selectedTField.height = rad*2;
		this.bmtf2 = bMapTxt(this.selectedTField);
		this.bmtf2.x = (rad*2 - this.selectedTField.textWidth)/2 - 2 -rad;
		this.bmtf2.y = -rad;
		this.selected.addChild(this.bmtf2);
		this.addChild(this.selected); 
	}
	public function clicked():void{
		isSelected = !isSelected;
		if(isSelected){
			Tweener.addTween(this.selected,{time:1,alpha:1,transition:"linear"});
		}else{
			Tweener.addTween(this.selected,{time:1,alpha:0,transition:"linear"});
		}
	}
	public function getState():Boolean{
		return this.isSelected;
	}
	public function getTxt():String{
		return this.str; 
	}
	public static function bMapTxt(txt:*):Bitmap{
        	var bm:BitmapData = new BitmapData(txt.width,txt.height,true,0x000000000);
        	bm.draw(txt); 
        	return new Bitmap(bm);
	}
}

import flash.display.Sprite;
import flash.filters.GlowFilter;
class ftdTextField extends TextField{
	public var format:TextFormat = new TextFormat();
	public var size:int = 20;
	public var bold:Boolean = true;
	public var innerColor:int = 0xFFFFFF;
	public var outerColor:int = 0xFF0000; 
	public function ftdTextField(txt:String = "",align:String = "left",size:int = 20,color:int = 0x0000FF,innerColor:int = 0xFFFFFF,outerColor:int = 0xFF0000){
		format.size = size;
		format.color = color;
		format.bold = this.bold;
		format.align = align;
		this.defaultTextFormat = format;
		this.text = txt;
		this.filters = [new GlowFilter(innerColor,1,2,2,16,1),new GlowFilter(outerColor,1,4,4,16,1)];
	}
}

class Qs{
	public static var food3:Array = 
	["ミカン","リンゴ","イチゴ","アンズ","ライチ","レモン","キウイ","タマゴ","ケーキ","サラミ","トマト","キノコ","トウフ","カツオ","イワシ","シャケ","プリン","ウナギ","ジャム","ブドウ","パスタ","カラシ",
	"アイス","チーズ","ワイン","スルメ","オデン","ライス","ドリア","チクワ","イクラ","マグロ","アナゴ","ゴボウ","ゼリー","スズナ","ナズナ","ココア","コーラ","ゴーヤ","ソース","サラダ","ワサビ",
	"モズク","ワカメ","サザエ","タラコ","シラコ","チキン","ポーク","ビーフ","バナナ","スープ","カレー","コーン","ポテト","チマキ","ダンゴ","キムチ","ソテー","バター","ピラフ","アズキ","アワビ",
	"ダイズ","ウコン","ウズラ","コンブ","オカラ","オクラ","オオバ","カジキ","カレイ","ヒラメ","キナコ","カリン","キクナ","クサヤ","クジラ","クラゲ","ケガニ","コウジ","コムギ","タカナ","タニシ",
	"ザクロ","サトウ","サルサ","サワラ","サンマ","シメジ","シャコ","スジコ","スダチ","スズキ","セロリ","パセリ","セージ","タイム","ツクシ","ナッツ","ナマコ","ナメコ","ナルト","ニシン","ハッカ","バニラ",
	"ハーブ","パンコ","ヒジキ","プラム","ペンネ","ホタテ","ポンズ","メザシ","メンマ","モヤシ","ユリネ","ヨモギ","ライム","レバー","ワラビ"];
	public static var food4:Array = 
	["オレンジ","パパイヤ","マンゴー","アボカド","グレープ","プルーン","ドリアン","イヨカン","キャベツ","ピーマン","シイタケ","マツタケ","マイタケ","ナットウ","ヤキニク","ヤキソバ","タコヤキ","ヤキメシ","コムギコ",
	"トースト","ハンペン","アツアゲ","ザルソバ","カツドン","アンパン","スズシロ","ジュース","コーヒー","コウチャ","イセエビ","ショウユ","タケノコ","ハクサイ","ダイコン","レンコン","キュウリ","ニクマン","コマツナ",
	"アンマン","ヤキナス","オムレツ","グラタン","サーモン","ラーメン","ショウガ","キャビア","トリュフ","シチュー","ボルシチ","オニオン","タマネギ","ニンジン","フカヒレ","ミソシル","コンソメ","ギョウザ","カボチャ",
	"ザーサイ","ツケモノ","ステーキ","ムニエル","ハルマキ","ハルサメ","ヌードル","ピッツァ","リゾット","ナマハム","オリーブ","アオノリ","アゲダマ","アセロラ","エダマメ","カイワレ","カズノコ","カニカマ","カマボコ",
	"カラスミ","ニンニク","カワハギ","カンヅメ","カンテン","カンパチ","アツアゲ","キクラゲ","キンカン","サーモン","ギンナン","クルトン","クレソン","クレープ","クロダイ","クロマメ","クロレラ","コショウ",
	"サトイモ","シュガー","サケカス","ザーサイ","サボテン","シシトウ","シシャモ","シナモン","シラウオ","スッポン","ゼンマイ","ゼラチン","ソラマメ","タバスコ","タピオカ","トウガン","ドジョウ","トビウオ","トリガイ",
	"トンコツ","ナガイモ","ナツメグ","アゲパン","ノザワナ","バジリコ","ハチミツ","パプリカ","ハマグリ","ハルサメ","ピクルス","ブイヨン","ベーコン","ルッコラ","レーズン","ワカサギ"];
	public static var food5:Array = 
	["グレープフルーツ","パイナップル","ラズベリー","ブルーベリー","ドラゴンフルーツ","サクランボ","ラフランス","ハンバーグ","ハンバーガー","カルボナーラ","クルマエビ","トムヤムクン","ブイヤベース","ミネストローネ",
	"ビシソワーズ","トウモロコシ","ポタージュ","サツマイモ","ジャガイモ","シーザーサラダ","マーボードウフ","ショウロンポウ","ハッポウサイ","ローストチキン","シュウマイ","ホイコーロー","ニクジャガ","スパゲティ","マーガリン",
	"ナマクリーム","カスタードクリーム","チョコレート","オリーブオイル","フォカッチャ","エスプレッソ","カフェラテ","カプチーノ","ピスタチオ","アーモンド","シシカバブ","ヨーグルト","カリフラワー","ブロッコリー","アスパラガス",
	"ピーナッツ","インゲンマメ","ソーセージ","ウスターソース","エスカルゴ","アンチョビ","オイスターソース","オイルサーディン","オマールエビ","カシューナッツ","カツオブシ","カタクリコ","カマンベールチーズ","ガムシロップ",
	"カラメルソース","ヒョウタン","アブラアゲ","ガンモドキ","キリボシダイコン","キンメダイ","グリーンピース","クロザトウ","ケチャップ","ゲッケイジュ","コウヤドウフ","ココナッツ","コチュジャン","コーンスターチ","コンデンスミルク",
	"コンニャク","コンビーフ","サクラエビ","サヤエンドウ","ドレッシング","サンショウ","シタビラメ","シチミトウガラシ","シチメンチョウ","スターフルーツ","ズッキーニ","セイヨウワサビ","ホースラディッシュ","タラバガニ","タルタルソース",
	"チリソース","チンゲンサイ","ツバメノス","トウガラシ","トウニュウ","ドライフルーツ","トロロコンブ","ナタデココ","ナツミカン","ユデタマゴ","ナポリタン","ジェラート","パッションフルーツ","パルメザンチーズ","ピスタチオ","フォアグラ",
	"フォンドボー","フキノトウ","ブラックペッパー","フランクフルト","ブルーチーズ","ペパーミント","ホタルイカ","ホウレンソウ","マスカット","マスクメロン","マーマレード","マヨネーズ","メンタイコ","モロヘイヤ","ラッキョウ","レモングラス",
	"ローズマリー","ロブスター"];
	public static var area:Array = 
	["アイスランド","アイルランド","アゼルバイジャン","アフガニスタン","アメリカ","アラブ","アルジェリア","アルゼンチン","アルバニア","アルメニア","アンゴラ","アンドラ","イエメン","イギリス","イスラエル","イタリア","イラク","イラン",
	"インド","インドネシア","ウガンダ","ウクライナ","ウズベキスタン","ウルグアイ","エクアドル","エジプト","エストニア","エチオピア","エルサルバドル","オーストラリア","オーストリア","オマーン","オランダ","ガーナ","カザフスタン","カタール",
	"カナダ","カメルーン","カンボジア","ギニア","キューバ","ギリシャ","グアテマラ","クウェート","グルジア","クロアチア","ケニア","コートジボワール","コスタリカ","コロンビア","コンゴ","サウジアラビア","サモア","ザンビア","ジャマイカ",
	"シリア","シンガポール","ジンバブエ","スイス","スウェーデン","スーダン","スペイン","スリランカ","スロバキア","スロベニア","セルビア","セネガル","ソマリア","タイ","カンコク","タジキスタン","タンザニア","チェコ","チュウゴク","チュニジア",
	"キタチョウセン","チリ","デンマーク","ドイツ","トーゴ","ドミニカ","トルコ","トンガ","ナイジェリア","ナミビア","ニホン","ニュージーランド","ネパール","ノルウェー","パキスタン","バチカン","パナマ","バハマ","パプアニューギニア","パラグアイ",
	"バーレーン","ハンガリー","バングラデシュ","フィジー","フィリピン","フィンランド","ブータン","ブラジル","フランス","ブルガリア","ブルネイ","ベトナム","ベネズエラ","ベラルーシ","ペルー","ベルギー","ポーランド","ボスニア","ボツワナ","ボリビア",
	"ポルトガル","ホンジュラス","マケドニア","マダガスカル","マレーシア","ミクロネシア","ミナミアフリカ","ミャンマー","メキシコ","モザンビーク","モナコ","モルディブ","モロッコ","モンゴル","モンテネグロ","ヨルダン","ラオス","ラトビア","リトアニア",
	"リビア","リヒテンシュタイン","リベリア","ルーマニア","ルクセンブルク","ルワンダ","レバノン","ロシア","コソボ","タイワン"]; 
}