Section 1
//MainTimeline (masking_fla.MainTimeline)
package masking_fla {
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.media.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.text.*;
import flash.utils.*;
import flash.xml.*;
public dynamic class MainTimeline extends MovieClip {
public var version;
public var my_menu:ContextMenu;
public var mapData:Map;
public var D;
public var bg:Sprite;
public var camX;
public var camY;
public var backParent:Sprite;
public var camZ;
public var camRot;
public var bgData:BGData;
public var backArray:Array;
public var credit;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function scanLine(_arg1:Sprite, _arg2:Number){
var _local3:Sprite;
_local3 = new Sprite();
_local3.graphics.beginFill(0);
_local3.graphics.drawRect(0, _arg2, stage.stageWidth, 1);
_local3.graphics.endFill();
_arg1.mask = _local3;
}
function frame3(){
update();
gotoAndPlay(2);
}
function frame1(){
stage.align = StageAlign.TOP_LEFT;
my_menu = new ContextMenu();
my_menu.hideBuiltInItems();
version = new ContextMenuItem("Mode_7 rev. 1");
version.enabled = false;
credit = new ContextMenuItem("Rubber NAND !0x524E/n3E 2015");
credit.enabled = false;
my_menu.customItems.push(version, credit);
contextMenu = my_menu;
bg = new Sprite();
bgData = new BGData(789, 239);
bg.graphics.beginBitmapFill(bgData);
bg.graphics.drawRect(0, 0, (789 * 3), 239);
bg.graphics.endFill();
stage.addChild(bg);
backArray = new Array();
backParent = new Sprite();
stage.addChild(backParent);
mapData = new Map(0x0100, 0x0100);
populateBack(backParent, backArray, (stage.stageHeight / 2), mapData, 0x0100, 0x0100);
camX = 128;
camY = 64;
camZ = 128;
camRot = 0;
D = 0x0100;
update();
stage.addEventListener(KeyboardEvent.KEY_DOWN, reportKeyDown);
}
public function perspectiveArray(_arg1:Array, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
var _local7:*;
_local7 = 0;
while (_local7 < _arg6) {
applyPerspective(_arg1[_local7], _arg2, _arg3, _arg4, _arg5, (_local7 + (stage.stageHeight / 2)));
_local7++;
};
}
function frame2(){
update();
}
public function update(){
bg.x = ((((camRot % 360) / 360) * 789) - 789);
perspectiveArray(backArray, camX, camY, camZ, camRot, (stage.stageHeight / 2));
}
public function reportKeyDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case Keyboard.UP:
camZ = (camZ - Math.cos(((camRot / 180) * Math.PI)));
camX = (camX - Math.sin(((camRot / 180) * Math.PI)));
break;
case Keyboard.LEFT:
camRot = (camRot + 1);
break;
case Keyboard.RIGHT:
camRot = (camRot - 1);
break;
case Keyboard.DOWN:
camZ = (camZ + Math.cos(((camRot / 180) * Math.PI)));
camX = (camX + Math.sin(((camRot / 180) * Math.PI)));
break;
case Keyboard.SHIFT:
camY = (camY + 1);
break;
case Keyboard.CONTROL:
camY = (camY - 1);
break;
case Keyboard.PAGE_UP:
D = (D * 2);
break;
case Keyboard.PAGE_DOWN:
D = (D / 2);
break;
};
}
public function applyPerspective(_arg1:Sprite, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number){
var _local7:Matrix;
_local7 = new Matrix();
_local7.translate(-(_arg2), -(_arg4));
_local7.rotate(((_arg5 / 180) * Math.PI));
_local7.scale((_arg6 / _arg3), (_arg6 / _arg3));
_local7.translate((stage.stageWidth / 2), (D + _arg6));
_arg1.transform.matrix = _local7;
}
public function populateBack(_arg1:Sprite, _arg2:Array, _arg3:Number, _arg4:BitmapData, _arg5:Number, _arg6:Number){
var _local7:*;
_local7 = 0;
while (_local7 < _arg3) {
_arg2.push(new Sprite());
_arg2[_local7].graphics.beginBitmapFill(_arg4);
_arg2[_local7].graphics.drawRect(0, 0, _arg5, _arg6);
_arg2[_local7].graphics.endFill();
scanLine(_arg2[_local7], (_local7 + (stage.stageHeight / 2)));
_arg1.addChild(_arg2[_local7]);
_local7++;
};
}
}
}//package masking_fla
Section 2
//BGData (BGData)
package {
import flash.display.*;
public dynamic class BGData extends BitmapData {
public function BGData(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 3
//Map (Map)
package {
import flash.display.*;
public dynamic class Map extends BitmapData {
public function Map(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package