蜂の巣 孵卵器
かわいいマスコットキャラと魔法少女が魔女と戦う日常を描いたハートフルなストーリー展開に大きなお友達は釘付けなんだ。そういう訳でけいやk(ry
/**
* Copyright zahir ( http://wonderfl.net/user/zahir )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/qJaI
*/
// forked from zahir's 孵卵器
package {
import flash.events.TimerEvent;
import flash.utils.Timer;
import flash.display.Sprite;
public class Incubator extends Sprite {
public function Incubator(){
// write as3 code here..
var cont:Sprite = new Sprite();
addChild( cont );
var rightEye:Eye = new Eye();
cont.addChild(rightEye);
rightEye.x = 100;
rightEye.y = 100;
var leftEye:Eye = new Eye();
cont.addChild(leftEye);
leftEye.x = 365;
leftEye.y = 100;
rightEye.scaleX = rightEye.scaleY = 0.75;
leftEye.scaleX = leftEye.scaleY = 0.75;
var mouse:Mouse = new Mouse();
cont.addChild(mouse);
mouse.x = 465>>1;
mouse.y = 200;
cont.y = 100;
var t:Timer = new Timer(30, 8);
t.addEventListener( TimerEvent.TIMER, onTime );
t.start();
}
private function onTime( e:TimerEvent ):void
{
var ana:KazaAna = new KazaAna( random(25,50) );
addChild( ana );
ana.x = random( 20, 445 );
ana.y = random( 20, 445 );
}
private function random( max:Number, min:Number ):Number
{
return min + ( max - min ) * Math.random();
}
}
}
import flash.display.Graphics;
import flash.display.Shape;
class KazaAna extends Shape
{
public function KazaAna( size:int = 30 )
{
var g:Graphics = graphics;
g.lineStyle(1,106 << 16 | 63 << 8 | 73);
g.beginFill( 200 << 16 | 30 << 8 | 73);
g.drawCircle(0,0,size);
g.endFill();
g.lineStyle();
g.beginFill( 0xFFFFFF);
g.drawCircle(4,-2, size * 0.9);
g.endFill();
}
}
class Mouse extends Shape
{
public function Mouse()
{
var g:Graphics = graphics;
g.lineStyle(2, 153 << 16 | 153 << 8 | 153);
g.moveTo(0,0);
g.curveTo(40,30, 70, -10);
g.moveTo(0,0);
g.curveTo(-40,30, -70, -10);
}
}
class Eye extends Shape
{
public function Eye()
{
var g:Graphics = graphics;
g.lineStyle(3,106 << 16 | 63 << 8 | 73);
g.beginFill( 193 << 16 | 75 << 8 | 113);
g.drawCircle(0,0,50);
g.endFill();
g.lineStyle();
g.beginFill( 75 << 16 | 11 << 8 | 30);
g.drawCircle(0,0,25);
g.endFill();
g.beginFill( 0xFFFFFF);
g.drawCircle(-24,-24, 15);
g.endFill();
}
}