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:ida();//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:ida();//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:ida();//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:dom();//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:dom();
//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:dom();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);
}
private function dom():void {
with(graphics) {
clear();
// --------------------------
beginFill (0x000000, 100);
moveTo(-165, -50);
lineTo(-192, -97);
lineTo(-172, -154);
lineTo(-49, -225);
lineTo(-26, -212);
lineTo(21, -212);
lineTo(48, -230);
lineTo(176, -129);
lineTo(190, -58);
lineTo(137, -32);
lineTo(146, -58);
lineTo(105, -87);
lineTo(80, -64);
lineTo(35, -97);
lineTo(35, -97);
lineTo(35, -97);
lineTo(35, -97);
lineTo(35, -97);
lineTo(35, -97);
lineTo(35, -97);
lineTo(-17, -84);
lineTo(-74, -126);
lineTo(-111, -74);
lineTo(-151, -87);
lineTo(-165, -50);
endFill ();
// --------------------------
beginFill (0x660000, 100);
moveTo(-97, -104);
lineTo(-118, -123);
lineTo(-142, -97);
lineTo(-134, -45);
lineTo(-109, -42);
lineTo(-104, -67);
lineTo(-95, -71);
lineTo(-97, -104);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(-91, 58);
lineTo(-93, 58);
lineTo(-94, 59);
lineTo(-97, 60);
lineTo(-99, 62);
lineTo(-101, 63);
lineTo(-102, 64);
lineTo(-113, 74);
lineTo(-94, 75);
lineTo(-93, 75);
lineTo(-93, 75);
lineTo(-92, 75);
lineTo(-90, 75);
lineTo(-46, 64);
lineTo(-55, 49);
lineTo(-91, 58);
endFill ();
// --------------------------
beginFill (0xcc0000, 100);
moveTo(-83, -12);
lineTo(-95, 60);
lineTo(-83, 56);
lineTo(-58, 68);
lineTo(-45, 67);
lineTo(-28, 55);
lineTo(-28, 50);
lineTo(-28, 49);
lineTo(-36, 46);
lineTo(-35, -10);
lineTo(-48, -15);
lineTo(-83, -12);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(-83, -39);
lineTo(-77, -28);
lineTo(-53, -41);
lineTo(-32, -27);
lineTo(-40, -2);
lineTo(-59, 9);
lineTo(-79, -3);
lineTo(-91, -36);
lineTo(-83, -39);
endFill ();
// --------------------------
beginFill (0x0a0a0a, 100);
moveTo(-63, -57);
lineTo(-72, -24);
lineTo(-60, -14);
lineTo(-39, -28);
lineTo(-39, -58);
lineTo(-63, -57);
endFill ();
// --------------------------
beginFill (0xcc0000, 100);
moveTo(-74, -64);
lineTo(-74, -66);
lineTo(-74, -68);
lineTo(-64, -108);
lineTo(-40, -112);
lineTo(-26, -97);
lineTo(-32, -56);
lineTo(-55, -45);
lineTo(-74, -64);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(-35, -193);
lineTo(-54, -208);
lineTo(-80, -191);
lineTo(-79, -152);
lineTo(-55, -135);
lineTo(-47, -143);
lineTo(-49, -177);
lineTo(-35, -193);
endFill ();
// --------------------------
beginFill (0x660000, 100);
moveTo(-54, -138);
lineTo(-58, -180);
lineTo(-37, -195);
lineTo(-50, -179);
lineTo(-48, -144);
lineTo(-54, -138);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(-38, -120);
lineTo(-38, -120);
lineTo(-38, -119);
lineTo(-38, -117);
lineTo(-38, -115);
lineTo(-38, -112);
lineTo(-38, -108);
lineTo(-39, -64);
lineTo(-47, -72);
lineTo(-47, -95);
lineTo(-59, -111);
lineTo(-59, -120);
lineTo(-47, -113);
lineTo(-47, -127);
lineTo(-42, -127);
lineTo(-38, -120);
endFill ();
// --------------------------
beginFill (0xff6666, 100);
moveTo(-83, -39);
lineTo(-66, -20);
lineTo(-73, -18);
lineTo(-90, -36);
lineTo(-83, -39);
endFill ();
// --------------------------
beginFill (0xcc0000, 100);
moveTo(-64, -154);
lineTo(-64, -174);
lineTo(-71, -181);
lineTo(-95, -167);
lineTo(-93, -148);
lineTo(-84, -137);
lineTo(-64, -154);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(-85, -153);
lineTo(-94, -93);
lineTo(-123, -122);
lineTo(-98, -185);
lineTo(-90, -175);
lineTo(-90, -157);
lineTo(-85, -153);
endFill ();
// --------------------------
beginFill (0x660000, 100);
moveTo(87, -98);
lineTo(112, -117);
lineTo(140, -92);
lineTo(131, -39);
lineTo(103, -36);
lineTo(96, -61);
lineTo(85, -66);
lineTo(87, -98);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(91, 53);
lineTo(92, 53);
lineTo(94, 53);
lineTo(97, 55);
lineTo(99, 56);
lineTo(101, 57);
lineTo(102, 58);
lineTo(114, 67);
lineTo(94, 68);
lineTo(93, 68);
lineTo(92, 68);
lineTo(92, 68);
lineTo(90, 68);
lineTo(45, 58);
lineTo(54, 45);
lineTo(91, 53);
endFill ();
// --------------------------
beginFill (0xcc0000, 100);
moveTo(71, -13);
lineTo(95, 55);
lineTo(82, 51);
lineTo(57, 62);
lineTo(43, 61);
lineTo(26, 49);
lineTo(26, 45);
lineTo(26, 45);
lineTo(34, 42);
lineTo(23, -10);
lineTo(35, -16);
lineTo(71, -13);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(71, -35);
lineTo(64, -25);
lineTo(36, -37);
lineTo(11, -24);
lineTo(20, 0);
lineTo(43, 11);
lineTo(66, -1);
lineTo(80, -33);
lineTo(71, -35);
endFill ();
// --------------------------
beginFill (0x0a0a0a, 100);
moveTo(47, -54);
lineTo(58, -21);
lineTo(44, -10);
lineTo(19, -24);
lineTo(19, -54);
lineTo(47, -54);
endFill ();
// --------------------------
beginFill (0xcc0000, 100);
moveTo(60, -58);
lineTo(60, -60);
lineTo(60, -62);
lineTo(49, -102);
lineTo(21, -107);
lineTo(3, -91);
lineTo(10, -50);
lineTo(38, -39);
lineTo(60, -58);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(14, -187);
lineTo(37, -202);
lineTo(68, -185);
lineTo(67, -146);
lineTo(38, -130);
lineTo(29, -137);
lineTo(31, -172);
lineTo(14, -187);
endFill ();
// --------------------------
beginFill (0x990000, 100);
moveTo(-34, -193);
lineTo(11, -193);
lineTo(32, -173);
lineTo(31, -146);
lineTo(12, -134);
lineTo(-36, -134);
lineTo(-58, -151);
lineTo(-54, -178);
lineTo(-34, -193);
endFill ();
// --------------------------
beginFill (0x0a0a0a, 100);
moveTo(14, -205);
lineTo(14, -181);
lineTo(3, -175);
lineTo(-25, -175);
lineTo(-39, -184);
lineTo(-37, -205);
lineTo(14, -205);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(-42, -204);
lineTo(-42, -204);
lineTo(-35, -163);
lineTo(-24, -160);
lineTo(-31, -203);
lineTo(-42, -204);
endFill ();
// --------------------------
beginFill (0xcc0000, 100);
moveTo(-38, -216);
lineTo(-50, -213);
lineTo(-50, -203);
lineTo(-12, -196);
lineTo(30, -204);
lineTo(30, -213);
lineTo(12, -217);
lineTo(-38, -216);
endFill ();
// --------------------------
beginFill (0xcc0000, 100);
moveTo(-39, -228);
lineTo(-39, -228);
lineTo(-39, -229);
lineTo(-38, -230);
lineTo(-37, -231);
lineTo(-26, -249);
lineTo(-25, -249);
lineTo(-10, -257);
lineTo(12, -246);
lineTo(20, -225);
lineTo(-39, -228);
endFill ();
// --------------------------
beginFill (0x0a0a0a, 100);
moveTo(-39, -212);
lineTo(-39, -220);
lineTo(19, -220);
lineTo(19, -212);
lineTo(-39, -212);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(-44, -220);
lineTo(-39, -218);
lineTo(-17, -217);
lineTo(-12, -214);
lineTo(-9, -217);
lineTo(8, -217);
lineTo(21, -220);
lineTo(21, -226);
lineTo(3, -236);
lineTo(-12, -262);
lineTo(-26, -236);
lineTo(-43, -229);
lineTo(-44, -220);
endFill ();
// --------------------------
beginFill (0xff6666, 100);
moveTo(-41, -228);
lineTo(-13, -232);
lineTo(19, -226);
lineTo(19, -221);
lineTo(7, -219);
lineTo(-36, -219);
lineTo(-43, -221);
lineTo(-41, -228);
endFill ();
// --------------------------
beginFill (0x00ff00, 100);
moveTo(-30, -217);
lineTo(-30, -212);
lineTo(-21, -212);
lineTo(-21, -217);
lineTo(-30, -217);
endFill ();
// --------------------------
beginFill (0x00ff00, 100);
moveTo(0, -217);
lineTo(0, -212);
lineTo(7, -212);
lineTo(7, -217);
lineTo(0, -217);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(-32, -206);
lineTo(-12, -213);
lineTo(9, -206);
lineTo(1, -185);
lineTo(-11, -177);
lineTo(-25, -187);
lineTo(-32, -206);
endFill ();
// --------------------------
beginFill (0x0a0a0a, 100);
moveTo(-32, -141);
lineTo(-32, -95);
lineTo(11, -95);
lineTo(11, -141);
lineTo(-32, -141);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(-52, -176);
lineTo(-22, -156);
lineTo(-22, -143);
lineTo(-56, -151);
lineTo(-52, -176);
endFill ();
// --------------------------
beginFill (0xff6666, 100);
moveTo(-23, -158);
lineTo(-23, -143);
lineTo(-2, -143);
lineTo(-2, -158);
lineTo(-23, -158);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(28, -177);
lineTo(-2, -156);
lineTo(-2, -144);
lineTo(32, -151);
lineTo(28, -177);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(21, -204);
lineTo(21, -204);
lineTo(14, -163);
lineTo(4, -160);
lineTo(11, -203);
lineTo(21, -204);
endFill ();
// --------------------------
beginFill (0x660000, 100);
moveTo(37, -132);
lineTo(41, -174);
lineTo(17, -189);
lineTo(32, -173);
lineTo(30, -139);
lineTo(37, -132);
endFill ();
// --------------------------
beginFill (0x660000, 100);
moveTo(-18, -122);
lineTo(-3, -122);
lineTo(2, -105);
lineTo(18, -105);
lineTo(18, -90);
lineTo(-10, -62);
lineTo(-38, -88);
lineTo(-38, -89);
lineTo(-38, -90);
lineTo(-38, -104);
lineTo(-23, -104);
lineTo(-18, -122);
endFill ();
// --------------------------
beginFill (0xcc0000, 100);
moveTo(-17, -119);
lineTo(-17, -119);
lineTo(-16, -119);
lineTo(-6, -119);
lineTo(-2, -102);
lineTo(-2, -101);
lineTo(13, -101);
lineTo(-10, -70);
lineTo(-34, -100);
lineTo(-21, -100);
lineTo(-17, -119);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(18, -115);
lineTo(18, -114);
lineTo(18, -113);
lineTo(18, -112);
lineTo(18, -109);
lineTo(18, -106);
lineTo(18, -102);
lineTo(19, -58);
lineTo(29, -67);
lineTo(28, -89);
lineTo(43, -105);
lineTo(43, -114);
lineTo(29, -108);
lineTo(28, -122);
lineTo(23, -122);
lineTo(18, -115);
endFill ();
// --------------------------
beginFill (0xff6666, 100);
moveTo(72, -35);
lineTo(51, -16);
lineTo(59, -15);
lineTo(79, -33);
lineTo(72, -35);
endFill ();
// --------------------------
beginFill (0xcc0000, 100);
moveTo(49, -148);
lineTo(49, -169);
lineTo(57, -174);
lineTo(86, -162);
lineTo(84, -143);
lineTo(73, -131);
lineTo(49, -148);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(74, -148);
lineTo(84, -87);
lineTo(119, -116);
lineTo(89, -179);
lineTo(79, -169);
lineTo(79, -151);
lineTo(74, -148);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(83, -59);
lineTo(104, -43);
lineTo(112, -61);
lineTo(98, -78);
lineTo(100, -91);
lineTo(84, -84);
lineTo(83, -59);
endFill ();
// --------------------------
beginFill (0xff0000, 100);
moveTo(113, -113);
lineTo(140, -83);
lineTo(138, -47);
lineTo(126, -31);
lineTo(117, -36);
lineTo(115, -50);
lineTo(126, -63);
lineTo(126, -74);
lineTo(104, -96);
lineTo(104, -96);
lineTo(104, -96);
lineTo(104, -96);
lineTo(104, -96);
lineTo(104, -96);
lineTo(104, -96);
lineTo(104, -96);
lineTo(104, -96);
lineTo(104, -96);
lineTo(113, -113);
endFill ();
// --------------------------
beginFill (0x404040, 100);
moveTo(-130, -87);
lineTo(-104, -42);
lineTo(-75, -32);
lineTo(-38, -64);
lineTo(-31, -103);
lineTo(-61, -142);
lineTo(-61, -142);
lineTo(-61, -142);
lineTo(-61, -142);
lineTo(-61, -142);
lineTo(-61, -142);
lineTo(-61, -142);
lineTo(-61, -142);
lineTo(-91, -154);
lineTo(-122, -127);
lineTo(-130, -87);
endFill ();
// --------------------------
beginFill (0x0a0a0a, 100);
moveTo(-117, -89);
lineTo(-98, -56);
lineTo(-77, -50);
lineTo(-50, -72);
lineTo(-45, -100);
lineTo(-66, -128);
lineTo(-66, -128);
lineTo(-66, -128);
lineTo(-66, -128);
lineTo(-66, -128);
lineTo(-66, -128);
lineTo(-66, -128);
lineTo(-66, -128);
lineTo(-88, -136);
lineTo(-111, -117);
lineTo(-117, -89);
endFill ();
// --------------------------
beginFill (0x00fa9a, 100);
moveTo(-106, -90);
lineTo(-93, -70);
lineTo(-79, -66);
lineTo(-61, -80);
lineTo(-58, -97);
lineTo(-72, -115);
lineTo(-72, -115);
lineTo(-72, -115);
lineTo(-72, -115);
lineTo(-72, -115);
lineTo(-72, -115);
lineTo(-72, -115);
lineTo(-72, -115);
lineTo(-87, -120);
lineTo(-102, -108);
lineTo(-106, -90);
endFill ();
// --------------------------
beginFill (0xe4efd8, 100);
moveTo(-119, -127);
lineTo(-118, -127);
lineTo(-117, -127);
lineTo(-117, -127);
lineTo(-115, -129);
lineTo(-113, -129);
lineTo(-113, -132);
lineTo(-112, -132);
lineTo(-91, -150);
lineTo(-87, -136);
lineTo(-115, -116);
lineTo(-119, -127);
endFill ();
// --------------------------
beginFill (0x808080, 100);
moveTo(-170, -87);
lineTo(-104, -186);
lineTo(-170, -157);
lineTo(-188, -113);
lineTo(-170, -87);
endFill ();
// --------------------------
beginFill (0x808080, 100);
moveTo(142, -40);
lineTo(171, -95);
lineTo(187, -58);
lineTo(142, -40);
endFill ();
}
}
public function ida():void {
with(graphics){
clear();
// --------------------------
beginFill (0x6f4f36, 100);
moveTo(-133, 60);
lineTo(-97, 114);
lineTo(-33, 113);
lineTo(-12, 120);
lineTo(-11, 120);
lineTo(-10, 120);
lineTo(81, 105);
lineTo(94, 80);
lineTo(95, 80);
lineTo(120, -66);
lineTo(105, -72);
lineTo(86, -130);
lineTo(106, -141);
lineTo(91, -218);
lineTo(21, -266);
lineTo(-82, -266);
lineTo(-142, -196);
lineTo(-155, -126);
lineTo(-155, -125);
lineTo(-153, -122);
lineTo(-127, -107);
lineTo(-120, -79);
lineTo(-151, -61);
lineTo(-133, 60);
endFill ();
// --------------------------
beginFill (0xd67145, 100);
moveTo(-144, -128);
lineTo(-53, -150);
lineTo(-50, -34);
lineTo(3, -39);
lineTo(-2, -158);
lineTo(-2, -157);
lineTo(93, -147);
lineTo(85, -202);
lineTo(20, -254);
lineTo(-75, -254);
lineTo(-138, -191);
lineTo(-144, -128);
endFill ();
// --------------------------
beginFill (0x0a0a0a, 100);
moveTo(-125, -115);
lineTo(-116, -70);
lineTo(-60, -83);
lineTo(-59, -117);
lineTo(-83, -129);
lineTo(-115, -119);
lineTo(-125, -115);
endFill ();
// --------------------------
beginFill (0x0a0a0a, 100);
moveTo(14, -125);
lineTo(14, -124);
lineTo(14, -92);
lineTo(70, -81);
lineTo(91, -82);
lineTo(83, -120);
lineTo(72, -127);
lineTo(39, -135);
lineTo(14, -125);
endFill ();
// --------------------------
beginFill (0xd67145, 100);
moveTo(-117, 48);
lineTo(-134, -22);
lineTo(-116, -65);
lineTo(-64, -76);
lineTo(-66, -31);
lineTo(-100, 9);
lineTo(-95, 89);
lineTo(-117, 48);
endFill ();
// --------------------------
beginFill (0x0a0a0a, 100);
moveTo(-87, 107);
lineTo(-68, 75);
lineTo(-67, 75);
lineTo(-70, 68);
lineTo(-57, 74);
lineTo(-53, 60);
lineTo(-49, 75);
lineTo(32, 71);
lineTo(39, 63);
lineTo(43, 74);
lineTo(69, 99);
lineTo(7, 111);
lineTo(-12, 117);
lineTo(-33, 102);
lineTo(-87, 107);
endFill ();
// --------------------------
beginFill (0x0a0a0a, 100);
moveTo(-79, 51);
lineTo(-51, 9);
lineTo(22, 3);
lineTo(58, 41);
lineTo(27, 31);
lineTo(27, 32);
lineTo(-51, 37);
lineTo(-79, 51);
endFill ();
// --------------------------
beginFill (0x0a0a0a, 100);
moveTo(-53, -33);
lineTo(-53, -16);
lineTo(-2, -16);
lineTo(-2, -33);
lineTo(-53, -33);
endFill ();
// --------------------------
beginFill (0xd87538, 100);
moveTo(26, -70);
lineTo(80, -20);
lineTo(100, -21);
lineTo(109, -65);
lineTo(38, -75);
lineTo(26, -70);
endFill ();
// --------------------------
beginFill (0x006633, 100);
moveTo(-108, -111);
lineTo(-108, -86);
lineTo(-70, -86);
lineTo(-70, -111);
lineTo(-108, -111);
endFill ();
// --------------------------
beginFill (0x00ff00, 100);
moveTo(-95, -104);
lineTo(-95, -91);
lineTo(-80, -91);
lineTo(-80, -104);
lineTo(-95, -104);
endFill ();
// --------------------------
beginFill (0x006633, 100);
moveTo(29, -116);
lineTo(29, -91);
lineTo(67, -91);
lineTo(67, -116);
lineTo(29, -116);
endFill ();
// --------------------------
beginFill (0x00ff00, 100);
moveTo(42, -109);
lineTo(42, -96);
lineTo(57, -96);
lineTo(57, -109);
lineTo(42, -109);
endFill ();
// --------------------------
beginFill (0xd67145, 100);
moveTo(-48, 39);
lineTo(-48, 65);
lineTo(31, 65);
lineTo(31, 39);
lineTo(-48, 39);
endFill ();
}
}
}