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: 人が忍者っぽく走る

todo: mml like language
todo: title
// forked from h_sakurai's 人が忍者っぽく走る
// write as3 code here..
// todo: mml like language
// todo: title
// 
package {
    import flash.display.*;
    import flash.text.*;
    import flash.events.*;
    import flash.geom.*;
    [SWF(width = "465", height = "465", backgroundColor = "0xffffff", frameRate = "30")] 
    public class A extends Sprite {
        public var txt:TextField = new TextField();
        public var log:TextField = new TextField();
        private var key:Key = new Key(stage, txt);
        public var ship:Ship;
        private var enemy:Enemy = new Enemy();
        public var enemys:Vector.<Enemy> = new Vector.<Enemy>;
        public var bullets:Vector.<Bullet>= new Vector.<Bullet>;
        public var particles:Vector.<Particle>= new Vector.<Particle>;
        public var glasses:Vector.<Glass>= new Vector.<Glass>;
        public var shots:Vector.<Shot>= new Vector.<Shot>;
        public var gameover:TextField = new TextField();
//        public var sprites:Vector.<Sprite> = new Vector.<Sprite>;
        public var camera:Sprite = new Sprite();
        public var score:int = 0;
        public var rank:int = 0;
        public var pp:PerspectiveProjection = new PerspectiveProjection();
        public var center:Point = new Point(0,0);
        public var field:Field = new Field();
        function A() {
            a = this;
            camera.addChild(field);
            pp.projectionCenter = center;
            camera.transform.perspectiveProjection = pp;
            this.x = 465/2;
            this.y = 465/2;
            addChild(camera);
            ship = new Ship(230,450);
            camera.addChild(ship);
            for(var i:int = 0; i < 500;i++)
                camera.addChild(bullets[i] = new Bullet());
            for(i = 0; i < 500;i++)
                camera.addChild(particles[i] = new Particle());
            for(i = 0; i < 100;i++)
                camera.addChild(glasses[i] = new Glass());
            for(i = 0; i < 5;i++)
                camera.addChild(shots[i] = new Shot());
            for(i = 0; i < 10;i++)
                camera.addChild(enemys[i] = new Enemy());
            with(txt){
                x = y= -223;
                width = 100;
                height = 20;
                textColor = 0xffffff;
                autoSize = "left";
                background = true;
                backgroundColor = 0;
            }
            camera.addChild(txt);

            with(gameover) {
                x = y = -40;
                textColor = 0xffffff;
                background = true;
                backgroundColor = 0;
                text = "GAME OVER";
                autoSize = "left";
            }
            camera.addChild(gameover);

            addChild(log);
            addEventListener("enterFrame",onEnter);
        }
        private function onEnter(e:Event):void {
            field.move();
//            sprites.length = 0;
            var enemyCnt:int = 0;
            for each (var enemy:Enemy in enemys) {
                if(enemy.visible) {
//                    sprites.push(enemy);
                    enemyCnt++;
                    enemy.move();
                }
            }
            for each (var s:Shot in shots)
                if(s.visible) {
//                    sprites.push(s);
                    s.move();
                    for each(enemy in enemys) {
                        if(enemy.visible && Math.abs(enemy.x-s.x)<60 && Math.abs(enemy.y-s.y)<60&& Math.abs(enemy.z-s.z)<1000) {
                            score += 100;
                            rank = score / 1000;
                            addParticles(enemy.x, enemy.y,enemy.z,-50,20);
                            enemy.visible = false;
                        }
                    }
                }
            if(Math.random() < 0.02+0.01 * rank) {
                addEnemy(int(19*Math.random()));
            }
            if(gameover.visible && (Key["start"]||Key["click"])) {
                score = 0;
                rank = 1;
                gameover.visible = false;
                ship.init();
            }
            if(!gameover.visible)ship.move();
            else {ship.x=0;ship.y=0;}
            if(ship.y > center.y) center.y+=2;
            if(ship.y < center.y) center.y-=2;
            
            pp.projectionCenter =center;
            camera.transform.perspectiveProjection = pp;

//            sprites.push(ship);
            for each (var b:Bullet in bullets) 
                if(b.visible) {
//                    sprites.push(b);
                    b.move();
                    if(ship.exists && b.z < 1 && Math.abs(ship.x-b.x)<30 && Math.abs(ship.y-b.y)<30) {
                        addParticles(ship.x, ship.y,ship.z,0, 20);
                        ship.visible = false;ship.move();
                        ship.exists = false;
                        gameover.visible = true;
                    }
                }
            for each (var p:Particle in particles)
                if(p.visible) {
//                    sprites.push(p);
                    p.move();
                }
            for each (var g:Glass in glasses)
                if(g.visible) {
                    g.move();
                }
            if(Math.random()<.2)addGlass(Math.random()*8000-4000, 220, 4000, 60, 0);
//            sprites.sort(function(x:Sprite, y:Sprite):Number {return y.z-x.z;});
//            var i:int = 0;
//            for(i=0;i<sprites.length;i++)
//                camera.setChildIndex(sprites[i],i+1);
//            txt.text = "SCORE "+score+" "+i+" "+sprites.length;
            txt.text = "SCORE "+score;
            Key["click"]=false;
        }
        public function addParticles(x:Number, y:Number, z:Number,vz:Number, n:int):void {
            for (var i:int = 0; i < n; i++)
                addParticle(x,y,z,vz, Math.random() * 100);
        }

        public function addBulletN(x:Number, y:Number, z:Number, rad:Number,n:int, r:Number):void {
            for (var i:int = 0; i < n; i++) {
                addBullet(x,y,z,rad+(i-n/2.0)*r);
            }
        }
        public function addBullet(x:Number, y:Number,z:Number, rad:Number):void {
            for each (var b:Bullet in bullets) {
                if(b.visible) continue;
                b.init(x,y,z,rad);
                return;
            }
        }
        public function addShot(x:Number, y:Number, z:Number, rad:Number):void {
            for each (var b:Shot in shots) {
                if(b.visible) continue;
                b.init(x,y,z,rad);
                return;
            }
        }
        public function addParticle(x:Number, y:Number, z:Number,vz:Number, rad:Number):void {
            for each (var b:Particle in particles) {
                if(b.visible) continue;
                b.init(x,y,z,vz,rad);
                return;
            }
        }
        public function addGlass(x:Number, y:Number, z:Number,vz:Number, rad:Number):void {
            for each (var b:Glass in glasses) {
                if(b.visible) continue;
                b.init(x,y,z,vz,rad);
                return;
            }
        }

        public function addEnemy(mode:int):void {
            for each (var b:Enemy in enemys) {
                if(b.visible) continue;
                b.init(mode);
                return;
            }
        }
    }
}

import flash.events.*;
import flash.display.*;
import flash.text.*;
//const blend:String = "darken";
//const blend:String = "subtract";
//const blend:String = "difference";
const blend:String = "multiply";//MULTIPLY
function col(a:int):int {return a;}
var a:A;

class Field extends Sprite {
    function Field() {
        var b:BitmapData = new BitmapData(2,2,false);
//        b.setPixel(0,0,0x008800);
//        b.setPixel(0,1,0x000000);
//        b.setPixel(1,0,0x118811);
//        b.setPixel(1,1,0x114411);

        b.setPixel(0,0,0xaaffaa);
        b.setPixel(0,1,0xaaaaaa);
        b.setPixel(1,0,0xccffcc);
        b.setPixel(1,1,0xcccccc);

        graphics.beginBitmapFill(b,null,true,false);
        graphics.drawRect(-512,0,1024,512);
        graphics.endFill();
        rotationX = 90;
        scaleX = 80;
        scaleY =80*2;
        y=230;
    }
    public function move():void {
        z = (z - 100);
        if(z <= -480*2)z+=480*2;//500;
        x-=a.ship.x/5;
        if(x >= 480)x-=480;z
        if(x <= 0)x+=480;z
    }
}

var springs:Vector.<Spring> = new Vector.<Spring>;
var balls:Vector.<Ball> = new Vector.<Ball>;
class Ship extends Sprite {
    private var speed:Number = 16;
    public var exists:Boolean;
    private var timer:uint = 0;

    public var head:Ball=new Ball(5,0x222222);
    public var neck:Ball=new Ball();
    public var lkata:Ball=new Ball();
    public var rkata:Ball=new Ball();
    public var lhiji:Ball=new Ball();
    public var rhiji:Ball=new Ball();
    public var lte:Ball=new Ball(5,0xff8888);
    public var rte:Ball=new Ball(5,0xff8888);
    public var mune:Ball=new Ball();
    public var koshi:Ball=new Ball();
    public var lkoshi:Ball=new Ball();
    public var rkoshi:Ball=new Ball();
    public var lhiza:Ball=new Ball();
    public var rhiza:Ball=new Ball();
    public var lashi:Ball=new Ball();
    public var rashi:Ball=new Ball();
    public function Ship(x:Number, y:Number) {
        new Spring(head,neck, 10);
        new Spring(neck,lkata, 30);
        new Spring(neck,rkata, 30);
        new Spring(lkata,lhiji, 50);
        new Spring(rkata,rhiji, 50);
        new Spring(lhiji,lte, 50);
        new Spring(rhiji,rte, 50);
        new Spring(lkata,rkata, 80);
        new Spring(neck,mune, 10);
        new Spring(lkata,mune, 50);
        new Spring(rkata,mune, 50);
        new Spring(mune,koshi, 30);
        new Spring(koshi,rkoshi, 30);
        new Spring(koshi,lkoshi, 30);
        new Spring(lkoshi,rkoshi, 50);
        new Spring(lkoshi,lhiza, 80);
        new Spring(rkoshi,rhiza, 80);
        new Spring(lhiza,lashi, 80);
        new Spring(rhiza,rashi, 80);

        this.x = x;
        this.y = y;
        this.z = -1;
        visible = false;
        blendMode=blend;
        for each (var b:Ball in balls) {  b.visible = visible;}
    }
    public function init():void {
        exists = false;
        timer = 0;
        visible = true;
    }
    private var oldX:Number;
    private var oldY:Number;
    public function move():void {
        timer++;
        if(timer > 158) exists = true;
        else visible = ((timer % 10) > 5);
        if(Key["left" ])x -= speed;
        if(Key["right"])x += speed;
        if(Key["up"   ])y -= speed;
        if(Key["down" ])y += speed;
        if(oldX != a.stage.mouseX-230)
            oldX = x = a.stage.mouseX-230;
        if(oldY != a.stage.mouseY-230)
            oldY = y = a.stage.mouseY-230;

        if(x < -230+30) x = -230+30; else if(x > 230-30) x = 230-30;
        if(y < -230+50) y = -230+50; else if(y > 230-50) y = 230-50;
        if(Key["shot"]||Key["mouse"])a.addShot(x,y,z,-Math.PI/2);
        for each (var b:Ball in balls) {  b.visible = visible;}
        for(var i:int=0;i<10;i++){
            mune.x = x; mune.y = y;
            head.ay -= 2;//balls.length/2;
            //neck.ay -= balls.length/2;
            head.az += 5;
            lashi.ay ++; rashi.ay++;
            mune.z=00;
            lte.ax += 1; lte.ay += 0.5; lte.az -= 2;
            rte.ax -= 1; rte.az += 2;
            lkoshi.az -= 5;
            lkata.ax += 1; rkata.ax -= 1;
            lhiza.ax += .5; lhiza.az +=1;
            rashi.ay += 1;
            lkoshi.ax += 1; rkoshi.ax -= 1;
            //rashi.az -= 1;
            for each (var ss:Spring in springs) { ss.move();}
            for each (b in balls) { b.move();}
        }
    }
}
class Spring {
    public var a:Ball;
    public var b:Ball;
    public var length:Number;
    public var len2:Number;
    public var k:Number=0.2;
    function Spring(a:Ball,b:Ball,len:Number){
        this.a = a; this.b = b; length = len/5;
        springs.push(this);
    }
    public function move():void {
        var nx:Number=a.x-b.x;
        var ny:Number=a.y-b.y;
        var nz:Number=a.z-b.z;
        var len:Number = Math.sqrt(nx*nx+ny*ny+nz*nz);
        var f:Number=len-length;
        var ax:Number,ay:Number,az:Number;
        if(len==0) {
            ax = Math.random()-.5;
            ay = Math.random()-.5;
            az = Math.random()-.5;
        } else {
            ax = -nx/len*f*k;
            ay = -ny/len*f*k;
            az = -nz/len*f*k;
        }
        a.ax +=  ax; a.ay +=  ay; a.az += az;
        b.ax += -ax; b.ay += -ay; b.az -= az;
    }
}
class Ball extends Sprite {
    public var _radius:Number;
    public var _color:uint;
    public var _alpha:Number;

    public var mass:Number = 0;
    
    public var vx:Number = 0;
    public var vy:Number = 0;
    public var vz:Number = 0;
    public var ax:Number = 0;
    public var ay:Number = 0;
    public var az:Number = 0;
        public var drag:Boolean = false;
    public function Ball(radius:Number = 5, color:uint = 0x0066FF, alpha:Number = 0.75 ) {
        this._radius = radius+2;
        this._color = color;
        this._alpha = alpha;
        this.mass = radius * 5;
                graphics.lineStyle(8,col(color));
        //graphics.beginFill(_color, _alpha);
        graphics.drawCircle(0, 0, _radius);
        //graphics.endFill();
        //graphics.beginFill(_color, _alpha);
        //graphics.drawCircle(0, 0, _radius*2);
        //graphics.endFill();
            balls.push(this);
            a.camera.addChild(this);
            blendMode = blend;
    }
        public function move():void {
            if(!drag){
                if(y>230){az-=1; ay-=15}
                //ay+=1;
                vx+=ax; vy+=ay; vz+=az;
                x+=vx;y+=vy;z+=vz;
            }
                vx*=0.7;vy*=0.7;vz*=0.7;
                ax=0;ay=0;az=0;
        }
}





class Bullet extends Sprite{
    private var vx:Number;
    private var vy:Number;
    private var rad:Number;
    public function Bullet() {
        graphics.lineStyle(8,col(0xffff8800));
//        graphics.beginFill(col(0xffff8800));
        graphics.drawEllipse(-30,-50,60,100);
//        graphics.endFill();
        visible = false;
        blendMode=blend;
    }
    public function init(x:Number, y:Number, z:Number,rad:Number):void {
        this.vx = (a.ship.x-x)/(z/100);
        this.vy = (a.ship.y-y)/(z/100);
        this.x = x;
        this.y = y;
        this.z = z;
        this.rotation = rad;
        visible = true;
    }
    public function move():Boolean {
        rotation +=22.5;
        z -= 100;
        x += vx; y += vy;
        if (z < 0) visible = false;
        return visible ;
    }
}
class Shot extends Sprite {
    public var angle:Number;
    private var vx:Number;
    private var vy:Number;
    private var rad:Number;
    public function Shot () {
        graphics.lineStyle(8,col(0xff88ff88));
//        graphics.beginFill(col(0xff88ff88));
        graphics.drawEllipse(-100,-30,200,60);
//        graphics.endFill();
        visible = false;
        blendMode=blend;
    }
    public function init(x:Number, y:Number, z:Number, rad:Number):void {
        this.x = x;
        this.y = y;
        this.z = z;
        this.vx = x/4.5*5;
        this.vy = (-a.center.y+y)/4.5*5;
        this.z = 0;
        this.rad = rad;
        visible = true;
    }
    public function move():Boolean {
        y += vy;
        x += vx;
        z += 500;
        if (z > 3000) visible = false;
        return visible ;
        return visible ;
    }
}

class Key {
    function Key(stage:Stage,txt:TextField) {
        var kmap:Object = {37:"left", 38:"up",39:"right",40:"down",90:"shot",13:"start"};
        for each(var i:String in kmap) Key[i]=false;
        stage.addEventListener("mouseDown",function(e:MouseEvent):void {
            Key["mouse"]=true;
            Key["click"]=true;
        });
        stage.addEventListener("mouseUp",function(e:MouseEvent):void {
            Key["mouse"]=false;
        });
        stage.addEventListener("keyDown",function(e:KeyboardEvent):void {
            //txt.text = ""+e.keyCode + ":"+kmap[e.keyCode];
            if(e.keyCode in kmap) Key[kmap[e.keyCode]] = true;
        });
        stage.addEventListener("keyUp",function(e:KeyboardEvent):void {
            if(e.keyCode in kmap) Key[kmap[e.keyCode]] = false;
        });
    }
}

function normalRad(v:Number):Number {
    return v + 2 * Math.PI * (
        (v >  Math.PI) ? -1 :
        (v < -Math.PI) ? 1  : 0
    );
}

class Particle extends Sprite{
    private var vy:Number;
    private var vx:Number;
    private var vz:Number = 10;
    private var r:int;
    private var n:int;
    public function Particle() {
        n = Math.random()*255;
        graphics.lineStyle(8,col(0xff000000+0xff0000+0x0100*int(n/2)));
        //graphics.beginFill(col(0xff000000+0xff0000+0x0100*int(n/2)));
        //graphics.endFill();
        visible = false;
        blendMode=blend;
    }
    public function init(x:Number, y:Number, z:Number, vz:Number, rad:Number):void {
        r = 100;
        this.x = x;
        this.y = y;
        this.z = z;

        this.vy = Math.random() * 30 - 15;
        if(Math.random() > 0.5)this.vy -= Math.random()*60;
        this.vx = Math.random() * 30 - 15;
        this.vz = Math.random() * 30 - 15 +vz;
        visible = true;
    }
    public function move():Boolean {
        r -=4;
        if(r < 8) {
            visible = false;
            return false;
        } 
        graphics.clear();
        graphics.lineStyle(8,col(0xff000000+0xff0000+0x0100*int(n/2)));
        graphics.drawEllipse(-25,-25,r,r);
        x += vx-a.ship.x/5;
        y += vy;
        z += vz;
        vy +=3;
        if(y > 240) visible = false;
        return visible ;
    }
}

class Glass extends Sprite{
    private var vz:Number;
    public function Glass () {
        graphics.lineStyle(8,col(0xff00ff00));
        graphics.drawEllipse(-25,-25,50, 50);
        visible = false;
        blendMode=blend;
    }
    public function init(x:Number, y:Number, z:Number, vz:Number, rad:Number):void {
        this.vz = vz;
        this.x = x;
        this.y = y;
        this.z = z;
        visible = true;
    }
    public function move():Boolean {
        x += -a.ship.x/5;
        z -= vz;
        if(z < 0) visible = false;
        return visible ;
    }
}

class Enemy extends Sprite{
    public var s:Number;
    private var prev:int;
    private var key:int;
    private var index:int;
    private var frame:int;
    private var ZOOM:Number = 100;
    private var fires:Object;
    private var txt:TextField = new TextField();
    private var format:TextFormat = new TextFormat();
    public var color:int = col(0xff8888aa);
    function Enemy() {
        format.size = 50;
        format.color = 0xff8888aa;
        format.font = "_等幅"
        addChild(txt);
        txt.text = "敵";
        txt.setTextFormat(format);
        txt.textColor=0xffffff;
        txt.x = txt.y = -40;//0;//-30-3+10;
//        graphics.beginFill(color);
//        graphics.lineStyle(8,color);
//        graphics.drawEllipse(-50,-50,100,100);
//        graphics.endFill();
        visible = false;
        setup();
        blendMode = blend;
    }
    public function init(mode_:int):void {
        mode=mode_;
        setup();
        move();
        visible=true;
    }
    protected function addKey(key:int, x:Number, y:Number, s:Number, curv:Boolean=false):void {
        if(keyMap == null) {// 最初のフレーム
            keyMap = [];
            index = key;
            frame = key;
            this.key = key;
            prev=-1;
        } else {
            keyMap[prev].next = key;
        }
        var z:Number = ZOOM/ s;
        // 3000のときにxは7.5倍
        // 1のときxは1倍
        // 3000*7.5=22500
        // z=1のときは、
        // (3000-z)*
        var a:Number =(3000-z)/2999+(z-1)/2999*7.5;
        keyMap[key]={x:x*a, y:y*a, z:z, curv:curv, prev:prev, next:0};
        prev=key;
    }
    protected function addAction(key:int, fun:Function):void {
        actionMap[key]=fun;
    }
    private var keyMap:Object;
    private var actionMap:Object = {};
    private var names:Array = ["x","y","z"];
    public function move():void {
        if(next==-1){visible = false; return;}
        var v1:Number;
        var v2:Number;
        if(frame in keyMap) key = frame;
        var next:int = keyMap[key].next;
        var prev:int = keyMap[key].prev;
        // 補完
        var t:Number = (frame - key)/(next-key);
        var t2:Number = 1 - t;
        for(var i:int = 0; i < names.length; i++) {
            var name:String = names[i];
            if(!keyMap[key].curv) {// 角
                if(!keyMap[next].curv) {// 角
                    this[name] = keyMap[key][name] * t2 + keyMap[next][name] * t;
                } else {// 次が丸
                    this[name] =
                        keyMap[key][name]   * -(t-1) * (2-t)/2 + // 0と1のとき0 -1のとき1
                        keyMap[next][name]  *       (1-(t-1))*(1+(t-1))  + // -1と1のとき0
                        keyMap[keyMap[next].next][name] * (t-1)  * (1+(t-1))/2;
                }
            } else { // 丸
                // 次も丸
                if(keyMap[next].curv) {
                    v1 =
                        keyMap[prev][name] * -t * (1-t)/2 + // 0と1のとき0 -1のとき1
                        keyMap[key][name]  *      (1-t)*(1+t)  + // -1と1のとき0
                        keyMap[next][name] * t  * (1+t)/2;
                    t2 = t - 1
                    v2 =
                        keyMap[key][name] * -t2 * (1-t2)/2 + // 0と1のとき0 -1のとき1
                        keyMap[next][name]  *      (1-t2)*(1+t2)  + // -1と1のとき0
                        keyMap[keyMap[next].next][name] * t2  * (1+t2)/2;
                    this[name] = v1*(1-t)+v2*t;
                } else {
                // 次:角
                // これは只の2時曲線
                // t=-1のとき
                    this[name] = 
                        keyMap[prev][name] * -t * (1-t)/2 + // 0と1のとき0 -1のとき1
                        keyMap[key][name]  *      (1-t)*(1+t)  + // -1と1のとき0
                        keyMap[next][name] * t  * (1+t)/2;
                }
            }
        }
        if(frame in fires) {
            a.addBullet(x,y,z,0);
        }
        if(key==frame){
            if(key in actionMap) {
                actionMap[key]();
            }
        }
        if(next == 0 && frame > key) {
            frame = index;
            key = frame;
            next = -1;
        } else {
            frame = frame + 1;
        }
    }
    private var mode:int = 0;
    public function setup():void {
        keyMap = null;
        fires = {};
        switch(mode){
case 1:text(mode,"雑",col(0xff88ccff));
addKey(0,-225,-205,1/30);
addKey(18,-5,-205,1/30);
addKey(30,215,-205,1/30);
fire(30);
addKey(60,-225,225,1);
break;
case 2:text(mode,"雑",col(0xff88ccff));
addKey(0,-225,225,1/1);
addKey(30,215,-205,1/30);
addKey(60,-225,-205,1/30);
break;
case 3:text(mode,"03",col(0xff88ccff));
addKey(0,-225,225,1/1);
addKey(30,215,-205,1/30);
addKey(60,-125,-205,1/30);
fire(60);
addKey(90,-125,225,1/1);
break;
case 4:text(mode,"04",col(0xff88ccff));
addKey(0,-225,225,1/1);
addKey(30,215,-205,1/30);
addKey(50,-5,-205,1/30);
fire(50);
addKey(80,-5,225,1/1);
break;
case 5:text(mode,"05",col(0xff8888aa));
addKey(0,-225,225,1/1);
addKey(30,215,-205,1/30);
addKey(40,155,-205,1/30);
fire(40);
addKey(70,155,225,1/1);
break;
case 6:text(mode,"06",col(0xff88ccff));
addKey(0,155,-5,1/30);
addKey(30,155,55,1/7.5);
fire(30);
addKey(60,155,-205,1/3.75);
addKey(90,155,225,1/1);
break;
case 7:text(mode,"蝶",col(0xffff44cc));
addKey(0,0,-5,1/30);
addKey(30,0,55,1/7.5);
fire(30);
addKey(60,0,-205,1/3.75);
addKey(90,0,225,1/1);
break;
case 8:text(mode,"08",col(0xffffcc88));
addKey(0,-155,-5,1/30);
addKey(30,-155,55,1/20,true);
fire(30);
addKey(60,-155,-205,1/10,true);
addKey(90,-155,225,1/1);
break;
case 9:text(mode,"09",col(0xffffcc88));
addKey( 0,-225,175,1/1);
addKey(30, 155, -5,1/5, true);
fire(30);
addKey(60,-105, -5,1/5, true);
addKey(90, 275,175,1/1);
break;
case 10:text(mode,"像",col(0xffccaa88));
addKey( 0,    0, 0,1/30);
addKey( 15,   0, 0,1/5,true);
addKey( 50, 100, 0,1/5,true);
addKey(100,   0,-100,1/5,true);
fire(100);
addKey(150,-100, 0,1/5,true);
addKey(200,   0, 100,1/5,true);
addKey(250, 100, 0,1/5,true);
addKey(270,    0, 0,1/30);
break;
case 11:text(mode,"像",col(0xffccaa88));
addKey(0,-225,225,  1/1);
addKey(20,15,-105,  1/6,true);
addKey(50,-205,-185,1/30,true);
fire(50);
addKey(90,415,225,1/1);
break;
case 12:text(mode,"像",col(0xffccaa88));
addKey(0,0,0,1/30);
addKey(50,0,125,1/1);
addKey(90,0,-325,1/1);
break;
case 13:text(mode,"大",col(0xff44aa44)); // ドム 左
addKey(0,-140,0,1/30);
addKey(30,-140,30,1/20);
addKey(45,-70,-70,1/20,true);
fire(45,2);
addKey(60,0,30,1/20);
addKey(90,-140,30,1/20);
addKey(120,200,75,1/10);
addKey(135,150,-75,1/10,true);
fire(135,2);
addKey(150,100,75,1/10);
addKey(180,200,75,1/10);
addKey(210,-325,125,1/1);
break;
case 14:text(mode,"大",col(0xff44aa44)); // ドム 右
addKey(0, 140,0,1/30);
addKey(30,140,30,1/20);
addKey(45, 70,-70,1/20,true);
fire(45,2);
addKey(60,   0,30,1/20);
addKey(90,140,30,1/20);
addKey(120,-200,75,1/10);
addKey(135,-150,-75,1/10,true);
fire(135,2);
addKey(150,-100,75,1/10);
addKey(180,-200,75,1/10);
addKey(210,325,125,1/1);
break;
case 15:text(mode,"Y",col(0xff444444)); // トモス 丸いやつ 上
addKey(0,    0,   0,1/30);
addKey(30,   0,- 80,1/9);
fire(60);
addKey(90,   0,- 80,1/9);
addKey(120,  0,-120,1/3);
fire(150);
addKey(180,  0,-120,1/3);
addKey(210,  0,-150,1/1);
fire(225);
addKey(240,  0,-150,1/1);
addKey(250,  0,   0,1/100);
break;
case 16:text(mode,"Y",col(0xff444444)); // トモス 丸いやつ 左
addKey(0,     0,   0,1/30);
addKey(30, - 65,  46,1/9);
fire(60);
addKey(90, - 65,  46,1/9);
addKey(120,- 98,  70,1/3);
fire(150);
addKey(180,- 98,  70,1/3);
addKey(210,-122,  87,1/1);
fire(225);
addKey(240,-122,  87,1/1);
addKey(250,   0,   0,1/100);
break;
case 17:text(mode,"Y",col(0xff444444)); // トモス 丸いやつ 右
addKey(0,    0,   0,1/30);
addKey(30,  65,  46,1/9);
fire(60);
addKey(90,  65,  46,1/9);
addKey(120, 98,  70,1/3);
fire(150);
addKey(180, 98,  70,1/3);
addKey(210,122,  87,1/1);
fire(215);
addKey(240,122,  87,1/1);
addKey(250,  0,   0,1/100);
break;
case 18:text(mode,"大",col(0xffee4422)); // ドム 赤いやつ
addKey(0,  -100,   0,1/30);

addKey(15, -100,  46,1/9);
addKey(22,    0, -46,1/9,true);
fire(22,2);
fire(24,2);
fire(26,2);
addKey(30,  100,  46,1/9);

addKey(45, -120,  60,1/3);
addKey(52,    0, -60,1/3,true);
fire(52,2);
fire(54,2);
fire(56,2);
addKey(60,  120,  60,1/3);

addKey(75, -130,  80,1/2);
addKey(82,    0, -80,1/2,true);
fire(82,2);
fire(84,2);
fire(86,2);
addKey(90,  130,  80,1/2);
addKey(105, -150, 150,  1);
break;

        default: mode = 1; setup();
            break;
        }
    }
    private function fire(key:int,no:int=1):void {
        fires[key]=no;
    }
    private function text(no:int,n:String,c:int):void {
        txt.text = n;
        format.color = c;
        txt.setTextFormat(format);
        color = c;
        graphics.clear();
        graphics.lineStyle(16,color);
        graphics.drawEllipse(-80,-80,160,160);

    }
}