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

o-pei

import net.hires.debug.Stats;
/**
 * Copyright _mutast ( http://wonderfl.net/user/_mutast )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/sfhi
 */

// forked from checkmate's Checkmate Vol.6 Amatuer
package {
    import flash.display.Sprite;
    import caurina.transitions.properties.DisplayShortcuts;
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.BitmapDataChannel;
	import flash.display.BlendMode;
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.filters.ConvolutionFilter;
	import flash.filters.DisplacementMapFilter;
	import flash.filters.DisplacementMapFilterMode;
	import flash.geom.Matrix;
	import flash.geom.Point;
	import flash.net.URLRequest;
	//import net.hires.debug.Stats;
	import flash.events.Event;
	import flash.filters.BlurFilter;
	import org.papervision3d.lights.PointLight3D;
	import org.papervision3d.materials.ColorMaterial;
	import org.papervision3d.materials.shadematerials.GouraudMaterial;
	import org.papervision3d.materials.shadematerials.PhongMaterial;
	import org.papervision3d.objects.DisplayObject3D;
	import org.papervision3d.objects.primitives.Sphere;
	import org.papervision3d.render.QuadrantRenderEngine;
	import org.papervision3d.view.BasicView;
    [SWF(backgroundColor="#dfa688", frameRate=30)]
    public class CheckmateAmatuer extends BasicView {
        var bmd:BitmapData;
		var offsets:Array;
		var bm:Bitmap;
		var white:Sprite;
		var chi1:DisplayObject3D;
		var chi2:DisplayObject3D;
		var base:DisplayObject3D;
		var offnum1:Number;
		var offnum2:Number;
		var pernum:Number;
		var flg:Boolean = true;
		var alhnum:Number = 0.5;
		var rot:int;
		var roty:Number;
                var rotx:Number;
        public function CheckmateAmatuer() {
            /*
            コードでエッチなものごとを描写してください。
            公序良俗は守ってください。
            
            Represent something sexual by codes.
            DO NOT be offensive to public order and morals.
            */
            white = new Sprite;
			white.graphics.beginFill(0xffffff);
			white.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
			white.graphics.endFill();
			offsets = new Array(new Point(), new Point());
			bmd = new BitmapData(stage.stageWidth, stage.stageHeight, false, 0xffffff);
			bm = new Bitmap(bmd);
			addChild(bm);
			bm.blendMode = BlendMode.ADD;
			
			addChild(white);
			white.blendMode = BlendMode.ADD;
			//white.alpha = 0.5;
			base = new DisplayObject3D;
			chi1 = new DisplayObject3D;
			chi2 = new DisplayObject3D;
			scene.addChild(base);
			base.addChild(chi1);
			base.addChild(chi2);
			var blur:BlurFilter = new BlurFilter(8, 8, 2);
			var material:ColorMaterial = new ColorMaterial(0xffcbad);
			var sphere1:Sphere = new Sphere(material, 500, 8, 8);
			var sphere2:Sphere = new Sphere(material, 500, 8, 8);
			chi1.addChild(sphere1);
			chi2.addChild(sphere2);
			//var chiM:ColorMaterial = new ColorMaterial(0xdbab97);
			var chiM:ColorMaterial = new ColorMaterial(0xf7bcca);
			var chik:Sphere = new Sphere(chiM, 50, 8, 8);
			var chikk:Sphere = new Sphere(chiM, 50, 8, 8);
			chi1.addChild(chik);
			chi2.addChild(chikk);
			chik.z = chikk.z = -490;
			chik.scaleX = chikk.scaleX = chikk.scaleY = chik.scaleY = 1.52;
			chik.scaleZ = chikk.scaleZ = 0.5;
			var chisM:ColorMaterial = new ColorMaterial(0xe28981);
			var chis:Sphere = new Sphere(chisM, 20, 4, 4);
			var chiss:Sphere = new Sphere(chisM, 20, 4, 4);
			chi1.addChild(chis);
			chi2.addChild(chiss);
			chis.z = chiss.z = -515;
			base.useOwnContainer = true;
			chi1.x -= 300;
			chi2.x = 300;
			base.filters = [blur];
			startRendering();
			//swapChildrenAt(0, numChildren - 2);
			numset();
			
			addEventListener(Event.ENTER_FRAME, loop);
        }
        public function loop(evt:Event):void {
			if (flg) {
				if (alhnum > -1) {
					alhnum -= 0.015;
				}else if (alhnum <= -0.5) {
					flg = false;
					alhnum = -0.5;
				}
			}else {
				if (alhnum < 0.5) {
					alhnum += 0.02;
				}else if (alhnum >= 0.5) {
					flg = true;
					numset();
					alhnum = 0.5;
				}
			}
			rot = (rot + 5 % 360);
			chi1.scaleX = chi1.scaleY = chi2.scaleX = chi2.scaleY = (Math.sin(rot * Math.PI / 180)) / 10 + 1;
			chi1.scaleZ = chi2.scaleZ = (Math.cos(rot * Math.PI/180))/10 + 1;
			offsets[0].y += offnum1;
			offsets[1].x += offnum2;
			bmd.perlinNoise(300, 305, 2, pernum, false, false, BitmapDataChannel.BLUE, true, offsets);
			white.alpha = alhnum;
			base.rotationY += roty;
                        base.rotationX = rotx;
		}
		public function numset():void {
			base.rotationY = 0;
			base.rotationZ = Math.floor(Math.random() * 100) - 50;
			base.scaleZ = Math.floor(Math.random() * 80) / 100 + 0.4;
			base.x = Math.floor(Math.random() * stage.stageWidth / 2);
			base.y = Math.floor(Math.random() * stage.stageHeight / 2);
			offnum1 = Math.floor(Math.random() * 40) / 10 - 2;
			offnum2 = Math.floor(Math.random() * 40) / 10 - 2;
			pernum = Math.random() * 100;
			roty = (Math.floor(Math.random() * 7) - 3) / 10;
			rotx = Math.floor(Math.random() * 40) - 20;
		}
    }
}