Section 1
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "2.0.1.0";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 2
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "2.0.1.0";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 3
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 4
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.display.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function set height(_arg1:Number):void;
function get scaleY():Number;
function move(_arg1:Number, _arg2:Number):void;
function get scaleX():Number;
function set mask(_arg1:DisplayObject):void;
function set scaleX(_arg1:Number):void;
function set name(_arg1:String):void;
function set scaleY(_arg1:Number):void;
function get visible():Boolean;
function get measuredWidth():Number;
function set visible(_arg1:Boolean):void;
function get alpha():Number;
function get height():Number;
function get width():Number;
function get parent():DisplayObjectContainer;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set y(_arg1:Number):void;
function get x():Number;
function get y():Number;
function set alpha(_arg1:Number):void;
}
}//package mx.core
Section 5
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function get repeaters():Array;
function get instanceIndices():Array;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 6
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 7
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "2.0.1.0";
}
}//package mx.core
Section 8
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import flash.display.*;
import mx.core.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "2.0.1.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local3:DisplayObject;
var _local4:String;
var _local5:Array;
_local3 = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
var _local2:String;
var _local3:int;
var _local4:int;
if (!_arg1){
return (null);
};
_local2 = getQualifiedClassName(_arg1);
_local3 = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
_local4 = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 9
//Enemy (Enemy)
package {
import flash.geom.*;
public class Enemy extends VRSprite {
public var snd_damage:int;// = 2
public var life:int;
public var snd_destroy:int;// = 4
public var attack:int;// = 1
public var score:int;// = 100
protected var damageCnt:int;// = 0
public static const DAMAGE_CNT:int = 10;
public function Enemy(_arg1:Game, _arg2:VRRegion=null, _arg3:int=-1):void{
score = 100;
attack = 1;
damageCnt = 0;
snd_damage = Snd.HIT;
snd_destroy = Snd.DESTROY;
super(_arg1, _arg2);
life = _arg3;
if (life < 0){
snd_damage = Snd.REFLECT;
};
}
public function onDestroyed():void{
var _local1:Scrap;
_local1 = new ScrapFire(game, region.x, region.y, region.z);
game.addScrap(_local1);
}
public function damage(_arg1:int):Boolean{
if (life < 0){
Snd.play(snd_damage);
return (false);
};
life = (life - _arg1);
if (life <= 0){
life = 0;
Snd.play(snd_destroy);
onDestroyed();
return (true);
};
Snd.play(snd_damage);
damageCnt = DAMAGE_CNT;
return (false);
}
override public function move():Boolean{
if (damageCnt > 0){
damageCnt--;
if ((damageCnt & 1)){
transform.colorTransform = new ColorTransform(0, 0, 0, 1, 0xFF, 0, 0, 0);
} else {
transform.colorTransform = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
};
};
return (true);
}
}
}//package
Section 10
//EnemyImo (EnemyImo)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class EnemyImo extends Enemy {
private const imoCls2:Class;
private const imoCls1:Class;
public var homing:Number;
public var shotCnt:int;
public var bm:Array;
public var bmIndex:int;
public var shotFreq:int;
public var vx:Number;
public var vy:Number;
public var vz:Number;
public function EnemyImo(_arg1:Game=null, _arg2:Number=0):void{
var _local3:int;
imoCls1 = EnemyImo_imoCls1;
imoCls2 = EnemyImo_imoCls2;
super(_arg1, new VRRegion(0, 0, Game.Z_MAX, 48, 48, 48), 1);
region.x = (Rnd.next(((Game.X_MAX * 2) + 1)) - Game.X_MAX);
region.y = (Rnd.next(((Game.Y_MAX * 2) + 1)) - Game.Y_MAX);
life = 1;
shotFreq = Math.floor(((_arg2 * 3) + 1));
shotCnt = (Rnd.next(25) + 25);
vx = 0;
vy = 0;
vz = ((-(_arg2) * 4) - 6);
homing = (_arg2 + 0.2);
bm = new Array();
bm[0] = (new imoCls1() as Bitmap);
bm[1] = (new imoCls2() as Bitmap);
bmIndex = 0;
score = (Math.floor(((10 * (_arg2 + 1)) * (_arg2 + 1))) * 10);
_local3 = 0;
while (_local3 < 2) {
bm[_local3].x = -94;
bm[_local3].y = -128;
_local3++;
};
addChild(bm[0]);
}
public function shoot():void{
var _local1:Number;
var _local2:EnemyShot;
if (region.z < (Game.Z_SCREEN * 2)){
return;
};
_local1 = 12;
_local2 = new EnemyShot(game, region.x, region.y, (region.z + region.zSize), _local1, game.kudoi, 0, 1);
game.addEnemyShot(_local2);
}
override public function move():Boolean{
var _local1:VRRegion;
var _local2:Number;
var _local3:Number;
super.move();
bmIndex = (1 - bmIndex);
removeChildAt(0);
addChild(bm[bmIndex]);
region.x = (region.x + vx);
region.y = (region.y + vy);
region.z = (region.z + vz);
_local1 = game.kudoi.region;
_local3 = ((_local1.z - region.z) / vz);
if (_local3 > 10){
_local2 = (_local1.x - (region.x + (vx * _local3)));
if (_local2 > region.xSize){
vx = (vx + homing);
if (vx > 12){
vx = 12;
};
} else {
if (_local2 < -(region.xSize)){
vx = (vx - homing);
if (vx < -12){
vx = -12;
};
};
};
_local2 = (_local1.y - (region.y + (vy * _local3)));
if (_local2 > region.ySize){
vy = (vy + homing);
if (vy > 12){
vy = 12;
};
} else {
if (_local2 < -(region.ySize)){
vy = (vy - homing);
if (vy < -12){
vy = -12;
};
};
};
};
shotCnt = (shotCnt - shotFreq);
if (shotCnt <= 0){
shotCnt = (shotCnt + (Rnd.next(21) + 30));
shoot();
};
return (true);
}
}
}//package
Section 11
//EnemyImo_imoCls1 (EnemyImo_imoCls1)
package {
import mx.core.*;
public class EnemyImo_imoCls1 extends BitmapAsset {
}
}//package
Section 12
//EnemyImo_imoCls2 (EnemyImo_imoCls2)
package {
import mx.core.*;
public class EnemyImo_imoCls2 extends BitmapAsset {
}
}//package
Section 13
//EnemyKanri (EnemyKanri)
package {
import flash.display.*;
public class EnemyKanri extends Enemy {
private const kanriCls:Class;
public var shoot:Boolean;// = false
public var hit:int;// = 0
public var hitMax:int;
public function EnemyKanri(_arg1:Game=null, _arg2:Number=0):void{
var _local3:int;
var _local4:Bitmap;
var _local5:Number;
kanriCls = EnemyKanri_kanriCls;
shoot = false;
hit = 0;
super(_arg1, new VRRegion(0, 0, Game.Z_MAX, 30, 30, 30), -1);
attack = 1;
hitMax = (8 - (_arg2 * 6));
_local4 = (new kanriCls() as Bitmap);
_local4.x = -50;
_local4.y = -53;
addChild(_local4);
_local5 = ((Rnd.next(360) * Math.PI) / 180);
region.x = ((Game.X_MAX * Math.cos(_local5)) / 2);
region.y = ((Game.Y_MAX * Math.sin(_local5)) / 2);
}
override public function damage(_arg1:int):Boolean{
hit++;
if (hit == hitMax){
hit = 0;
shoot = true;
};
return (super.damage(_arg1));
}
override public function move():Boolean{
var _local1:EnemyShot;
var _local2:int;
var _local3:Number;
if (shoot){
_local2 = 0;
while (_local2 < 8) {
_local1 = new EnemyShot(game, region.x, region.y, (region.z + region.zSize), 10, game.kudoi, 1, 1);
_local3 = ((Math.PI * _local2) / 4);
_local1.vx = (Math.cos(_local3) * 12);
_local1.vy = (Math.sin(_local3) * 12);
game.addEnemyShot(_local1);
_local2++;
};
shoot = false;
};
region.z = (region.z - 4);
return (true);
}
}
}//package
Section 14
//EnemyKanri_kanriCls (EnemyKanri_kanriCls)
package {
import mx.core.*;
public class EnemyKanri_kanriCls extends BitmapAsset {
}
}//package
Section 15
//EnemyMiko (EnemyMiko)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
import flash.utils.*;
public class EnemyMiko extends Enemy {
private const mikoCls1:Class;
private const mikoCls2:Class;
public var shotCnt:int;
public var bm:Array;
public var bmIndex:int;
public var shotSpeed:Number;
public var numShot:int;
public var rotSpeed:int;
public var vz:Number;
public var rot:int;
public var rollSpeed:Number;
public function EnemyMiko(_arg1:Game=null, _arg2:Number=0):void{
var _local3:int;
mikoCls1 = EnemyMiko_mikoCls1;
mikoCls2 = EnemyMiko_mikoCls2;
super(_arg1, new VRRegion(0, 0, Game.Z_MAX, 42, 54, 16), 1);
region.x = (Rnd.next((Game.X_MAX + 1)) - (Game.X_MAX / 2));
region.y = (Rnd.next((Game.Y_MAX + 1)) - (Game.Y_MAX / 2));
life = (4 + (_arg2 * 4));
shotCnt = 100;
numShot = ((_arg2 * 4) + 8);
shotSpeed = ((_arg2 * 5) + 8);
rot = Rnd.next(360);
rotSpeed = 6;
if (Rnd.coinToss()){
rotSpeed = (360 - rotSpeed);
};
rollSpeed = ((_arg2 * 4) + 8);
score = (Math.floor(((10 * (_arg2 + 1)) * (_arg2 + 1))) * 100);
vz = -4;
bm = new Array();
bm[0] = (new mikoCls1() as Bitmap);
bm[1] = (new mikoCls2() as Bitmap);
bmIndex = 0;
_local3 = 0;
while (_local3 < 2) {
bm[_local3].x = -48;
bm[_local3].y = -64;
_local3++;
};
addChild(bm[0]);
}
public function shoot():void{
var _local1:EnemyShot;
var _local2:Number;
var _local3:int;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local8:Number;
var _local9:Number;
if (region.z < (Game.Z_SCREEN * 2)){
return;
};
_local4 = (Rnd.number() * Math.PI);
_local8 = Math.cos(_local4);
_local9 = Math.sin(_local4);
_local2 = ((Math.PI / 3) / (numShot - 1));
_local4 = (-(Math.PI) / 6);
_local3 = 0;
while (_local3 < numShot) {
_local5 = (Math.sin(_local4) * shotSpeed);
_local7 = (Math.cos(_local4) * shotSpeed);
_local6 = 0;
_local1 = new EnemyShot(game, region.x, region.y, (region.z + region.zSize), 1, null, 0, 1);
_local1.vz = -(_local7);
_local1.vx = (_local5 * _local8);
_local1.vy = (_local5 * _local9);
game.addEnemyShot(_local1);
_local4 = (_local4 + _local2);
_local3++;
};
}
override public function move():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:Number;
super.move();
bmIndex = (1 - bmIndex);
removeChildAt(0);
addChild(bm[bmIndex]);
rot = (rot + rotSpeed);
if (rot >= 360){
rot = (rot - 360);
};
_local3 = ((rot * Math.PI) / 180);
_local1 = (Math.cos(_local3) * rollSpeed);
_local2 = (Math.sin(_local3) * rollSpeed);
region.x = (region.x + _local1);
region.y = (region.y + _local2);
region.z = (region.z + vz);
shotCnt--;
if (shotCnt <= 0){
shotCnt = 25;
shoot();
};
return (true);
}
}
}//package
Section 16
//EnemyMiko_mikoCls1 (EnemyMiko_mikoCls1)
package {
import mx.core.*;
public class EnemyMiko_mikoCls1 extends BitmapAsset {
}
}//package
Section 17
//EnemyMiko_mikoCls2 (EnemyMiko_mikoCls2)
package {
import mx.core.*;
public class EnemyMiko_mikoCls2 extends BitmapAsset {
}
}//package
Section 18
//EnemyShot (EnemyShot)
package {
import flash.display.*;
public class EnemyShot extends VRSprite {
public const MAX_SPEED:int = 12;
public var homing:Number;
public var homingDelay:int;// = 12
public var attack:int;
public var target:VRSprite;
public var homingDuration:int;// = 50
public var vx:Number;
public var vy:Number;
public var vz:Number;
private static const shotCls1:Class = EnemyShot_shotCls1;
private static const shotCls2:Class = EnemyShot_shotCls2;
public function EnemyShot(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=8, _arg6:VRSprite=null, _arg7:Number=0, _arg8:int=1):void{
var _local9:Bitmap;
homingDelay = 12;
homingDuration = 50;
super(_arg1, new VRRegion(_arg2, _arg3, _arg4, 8, 8, 8));
vx = 0;
vy = 0;
vz = -(_arg5);
homing = _arg7;
attack = _arg8;
target = _arg6;
if (homing > 0){
_local9 = (new shotCls1() as Bitmap);
} else {
_local9 = (new shotCls2() as Bitmap);
};
_local9.x = -16;
_local9.y = -16;
addChild(_local9);
if (homing <= 0){
snipe(_arg5, target);
};
if (target == null){
homing = 0;
};
}
public function snipe(_arg1:Number=8, _arg2:VRSprite=null):void{
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
if (_arg2 == null){
return;
};
_local3 = (_arg2.region.x - region.x);
_local4 = (_arg2.region.y - region.y);
_local5 = (_arg2.region.z - region.z);
_local6 = Math.sqrt((((_local3 * _local3) + (_local4 * _local4)) + (_local5 * _local5)));
if (_local6 == 0){
return;
};
_local6 = (_arg1 / _local6);
vx = (_local3 * _local6);
vy = (_local4 * _local6);
vz = (_local5 * _local6);
}
override public function move():Boolean{
var _local1:Number;
var _local2:Number;
rotation = (rotation + 30);
if (homing > 0){
if (homingDelay > 0){
homingDelay--;
} else {
if (homingDuration > 0){
homingDuration--;
_local2 = ((target.region.z - region.z) / vz);
if (_local2 > 0){
_local1 = (target.region.x - (region.x + (vx * _local2)));
if (_local1 > 4){
vx = (vx + homing);
if (vx > MAX_SPEED){
vx = MAX_SPEED;
};
} else {
if (_local1 < -4){
vx = (vx - homing);
if (vx < -(MAX_SPEED)){
vx = -(MAX_SPEED);
};
};
};
_local1 = (target.region.y - (region.y + (vy * _local2)));
if (_local1 > 4){
vy = (vy + homing);
if (vy > MAX_SPEED){
vy = MAX_SPEED;
};
} else {
if (_local1 < -4){
vy = (vy - homing);
if (vy < -(MAX_SPEED)){
vy = -(MAX_SPEED);
};
};
};
};
};
};
};
region.x = (region.x + vx);
region.y = (region.y + vy);
region.z = (region.z + vz);
return (true);
}
}
}//package
Section 19
//EnemyShot_shotCls1 (EnemyShot_shotCls1)
package {
import mx.core.*;
public class EnemyShot_shotCls1 extends BitmapAsset {
}
}//package
Section 20
//EnemyShot_shotCls2 (EnemyShot_shotCls2)
package {
import mx.core.*;
public class EnemyShot_shotCls2 extends BitmapAsset {
}
}//package
Section 21
//EnemyTire (EnemyTire)
package {
import flash.display.*;
public class EnemyTire extends Enemy {
private const tireCls:Class;
public var bm:Bitmap;
public var vx:Number;
public var vy:Number;
public var vz:Number;
public function EnemyTire(_arg1:Game=null, _arg2:Number=0):void{
tireCls = EnemyTire_tireCls;
super(_arg1, new VRRegion(0, 0, Game.Z_MAX, 54, 54, 16), 1);
bm = (new tireCls() as Bitmap);
bm.x = -64;
bm.y = -64;
addChild(bm);
region.x = (Rnd.next(((Game.X_MAX * 2) + 1)) - Game.X_MAX);
region.y = Game.Y_MAX;
life = Math.floor(((_arg2 * 5) + 2));
vx = ((_arg2 * 6) + 2);
if (region.x > 0){
vx = -(vx);
};
vy = -20;
vz = -6;
score = (Math.floor(((10 * (_arg2 + 1)) * (_arg2 + 1))) * 30);
}
override public function move():Boolean{
var _local1:VRRegion;
var _local2:Number;
var _local3:Number;
var _local4:EnemyShot;
super.move();
rotation = (rotation + 6);
region.x = (region.x + vx);
region.y = (region.y + vy);
region.z = (region.z + vz);
if (region.y >= Game.Y_MAX){
region.y = Game.Y_MAX;
if (Rnd.coinToss()){
vy = -32;
} else {
vy = -16;
};
if (region.x < -(Game.X_MAX)){
vx = Math.abs(vx);
} else {
if (region.x > Game.X_MAX){
vx = -(Math.abs(vx));
} else {
if (Rnd.next(4) == 0){
vx = -(vx);
};
};
};
if (region.z > (Game.Z_SCREEN * 2)){
_local4 = new EnemyShot(game, region.x, region.y, (region.z - region.zSize), 8, game.kudoi, 1);
_local4.vx = 0;
_local4.vy = -16;
game.addEnemyShot(_local4);
};
} else {
_local3 = vy;
vy = (vy + 0.5);
if ((((region.z > (Game.Z_SCREEN * 2))) && (((_local3 * vy) <= 0)))){
_local4 = new EnemyShot(game, region.x, region.y, (region.z - region.zSize), 12, game.kudoi, 0);
game.addEnemyShot(_local4);
};
};
return (true);
}
}
}//package
Section 22
//EnemyTire_tireCls (EnemyTire_tireCls)
package {
import mx.core.*;
public class EnemyTire_tireCls extends BitmapAsset {
}
}//package
Section 23
//FPSChecker (FPSChecker)
package {
import flash.events.*;
import flash.utils.*;
import flash.system.*;
public class FPSChecker extends Label {
protected var timeBase:int;
protected var frame:int;
public var fps:int;
public function FPSChecker(_arg1:int):void{
var _local2:int;
super("--fps");
fps = _arg1;
timeBase = getTimer();
frame = 0;
addEventListener(Event.ENTER_FRAME, onEnterFrame);
}
protected function onEnterFrame(_arg1:Event):void{
var _local2:int;
frame++;
_local2 = getTimer();
if ((_local2 - timeBase) < 1000){
return;
};
timeBase = _local2;
text = (frame + "fps");
if (fps > 0){
text = (text + ((" (" + stage.frameRate) + ")"));
};
text = (text + ((" use " + Math.floor((System.totalMemory / 0x0400))) + "KB"));
draw();
if (fps > 0){
if (frame < fps){
stage.frameRate++;
} else {
if (frame > fps){
stage.frameRate--;
};
};
};
frame = 0;
}
}
}//package
Section 24
//Game (Game)
package {
import flash.events.*;
import flash.display.*;
import flash.geom.*;
public class Game extends Sprite {
private const backCls:Class;
public var joyX:Number;// = 0
public var joyY:Number;// = 0
public var joyTrig:Boolean;// = false
public var scrapList:VRSprite;
public var clicked:Boolean;// = false
public var hiscore:int;
public var hiscoreLabel:Label;
public var lifeLabel:Label;
public var enemyShotList:VRSprite;
public var itemList:VRSprite;
public var enemyInterval:int;
public var useMouse:Boolean;// = true
public var screen:VRScreen;
public var enemyList:VRSprite;
public var level:int;
public var scoreLabel:Label;
public var score:int;
public var tick:int;
public var kudoi:Kudoi;
public var enemyCnt:int;
public var shotList:VRSprite;
public var levelLabel:Label;
private var opFunction:Function;
private var joy:uint;// = 0
public var enemyNum:int;
public var labelBase:Sprite;
public var enemyLevel:Number;
private var mouseDown:Boolean;// = false
public var enemyType:int;
public static const Z_SCREEN:Number = 96;
public static const X_MAX:Number = 320;
public static const Y_MAX:Number = 240;
public static const Z_MIN:Number = 24;
public static const Z_MAX:Number = 960;
public function Game():void{
var _local1:Sprite;
var _local2:Bitmap;
var _local3:FPSChecker;
backCls = Game_backCls;
joyX = 0;
joyY = 0;
joyTrig = false;
clicked = false;
useMouse = true;
joy = 0;
mouseDown = false;
shotList = new VRSprite(null);
enemyList = new VRSprite(null);
enemyShotList = new VRSprite(null);
itemList = new VRSprite(null);
scrapList = new VRSprite(null);
super();
scrollRect = new Rectangle(0, 0, 640, 480);
stage.scaleMode = StageScaleMode.NO_SCALE;
mouseChildren = false;
buttonMode = true;
score = 0;
hiscore = 0;
_local2 = (new backCls() as Bitmap);
addChild(_local2);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyListener);
stage.addEventListener(KeyboardEvent.KEY_UP, keyListener);
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouseListener);
stage.addEventListener(MouseEvent.MOUSE_UP, mouseListener);
addEventListener(Event.ENTER_FRAME, enterFrameListener);
labelBase = new Sprite();
addChild(labelBase);
scoreLabel = new Label("SC 0", 4286611711, 0, 16);
scoreLabel.x = 320;
scoreLabel.y = 8;
labelBase.addChild(scoreLabel);
hiscoreLabel = new Label("TOP 0", 4294934656, 0, 16);
hiscoreLabel.x = 480;
hiscoreLabel.y = 8;
labelBase.addChild(hiscoreLabel);
levelLabel = new Label("LEVEL 1", 4286611711, 0, 16);
levelLabel.x = 16;
levelLabel.y = 8;
labelBase.addChild(levelLabel);
lifeLabel = new Label("LIFE 5", 4294918208, 0, 16);
lifeLabel.x = 160;
lifeLabel.y = 8;
labelBase.addChild(lifeLabel);
_local3 = new FPSChecker(0);
_local3.x = 8;
_local3.y = ((480 - _local3.height) - 8);
addChild(_local3);
title();
}
public function addEnemyShot(_arg1:EnemyShot):void{
if (_arg1 != null){
screen.addChildAt(_arg1, 0);
enemyShotList.addNext(_arg1);
};
}
private function keyListener(_arg1:KeyboardEvent):void{
var _local2:uint;
_local2 = Joy.fromKeyCode(_arg1.keyCode);
if (_arg1.type == KeyboardEvent.KEY_DOWN){
joy = (joy | _local2);
} else {
joy = (joy & ~(_local2));
};
}
public function addShot(_arg1:KudoiShot):void{
if (_arg1 != null){
screen.addChildAt(_arg1, 0);
shotList.addNext(_arg1);
};
}
private function enterFrameListener(_arg1:Event):void{
joyTrig = ((mouseDown) || ((joy & Joy.A)));
opFunction();
}
public function addItem(_arg1:Item):void{
if (_arg1 != null){
screen.addChildAt(_arg1, 0);
itemList.addNext(_arg1);
};
}
public function addEnemy(_arg1:Enemy):void{
if (_arg1 != null){
screen.addChildAt(_arg1, 0);
enemyList.addNext(_arg1);
};
}
public function start():void{
}
private function mouseListener(_arg1:MouseEvent):void{
mouseDown = _arg1.buttonDown;
if (mouseDown){
clicked = true;
};
}
public function showScore():void{
scoreLabel.text = ("SC " + score);
scoreLabel.draw();
if (score > hiscore){
hiscore = score;
hiscoreLabel.text = ("TOP " + hiscore);
hiscoreLabel.draw();
};
levelLabel.text = ("LEVEL " + (level + 1));
levelLabel.draw();
}
public function showLife():void{
if (!kudoi){
return;
};
lifeLabel.text = ("LIFE " + kudoi.life);
lifeLabel.draw();
}
public function isClicked(_arg1:Boolean=true):Boolean{
var _local2:Boolean;
_local2 = clicked;
if (_arg1){
clicked = false;
};
return (_local2);
}
public function addScrap(_arg1:Scrap):void{
if (_arg1 != null){
screen.addChildAt(_arg1, 0);
scrapList.addNext(_arg1);
};
}
private function title():void{
var lab:Label;
if (screen){
removeChild(screen);
screen = null;
};
kudoi = null;
shotList.next = null;
enemyList.next = null;
enemyShotList.next = null;
itemList.next = null;
scrapList.next = null;
lab = new Label("くどいさん\n の\nぶっそうねー\n 大作戦", 4294926464, 0, 48);
addChild(lab);
lab.x = ((640 - lab.width) / 2);
lab.y = 128;
showScore();
isClicked();
opFunction = function ():void{
if (isClicked()){
removeChild(lab);
lab = null;
game();
};
};
}
private function gameover():void{
var lab:Label;
var cnt:int;
Snd.stopBGM();
showScore();
lab = new Label("げーむおーばー", 4294926464, 0, 40);
addChild(lab);
lab.x = ((640 - lab.width) / 2);
lab.y = 128;
isClicked();
cnt = 25;
opFunction = function ():void{
if (cnt > 0){
cnt--;
};
if (((isClicked()) && ((cnt <= 0)))){
removeChild(lab);
lab = null;
title();
};
};
}
public function move():Boolean{
var _local1:VRSprite;
var _local2:VRSprite;
var _local3:VRSprite;
var _local4:VRSprite;
var _local5:Boolean;
var _local6:KudoiShot;
var _local7:EnemyShot;
var _local8:Enemy;
var _local9:Item;
var _local10:int;
var _local11:Boolean;
var _local12:Boolean;
var _local13:Number;
var _local14:int;
_local12 = false;
if (useMouse){
joyX = (mouseX - kudoi.x);
joyY = (mouseY - kudoi.y);
};
tick++;
if (tick >= (25 * 30)){
tick = 0;
level++;
if (level > 19){
level = 19;
};
};
if (enemyNum == 0){
enemyCnt--;
if (enemyCnt <= 0){
_local10 = Rnd.next(100);
if (_local10 < 60){
enemyType = 0;
enemyNum = 8;
} else {
if (_local10 < 90){
enemyType = 1;
enemyNum = 4;
} else {
if (_local10 < 97){
enemyType = 2;
enemyNum = 2;
} else {
enemyType = 3;
enemyNum = 1;
};
};
};
_local13 = ((19 - level) / 19);
_local13 = (((19 - level) / 19) * _local13);
_local13 = (1 - _local13);
enemyLevel = ((((Rnd.number() + Rnd.number()) * _local13) + (_local13 * 2)) / 4);
if (enemyLevel < 0){
enemyLevel = 0;
} else {
if (enemyLevel > 1){
enemyLevel = 1;
};
};
enemyCnt = (enemyInterval * ((1 + enemyLevel) - _local13));
if (enemyCnt < 25){
enemyCnt = 25;
} else {
if (enemyCnt > 200){
enemyCnt = 200;
};
};
};
};
if (enemyNum > 0){
enemyNum--;
switch (enemyType){
case 0:
_local8 = new EnemyImo(this, enemyLevel);
break;
case 1:
_local8 = new EnemyTire(this, enemyLevel);
break;
case 2:
_local8 = new EnemyMiko(this, enemyLevel);
break;
case 3:
default:
_local8 = new EnemyKanri(this, enemyLevel);
break;
};
addEnemy(_local8);
};
_local11 = kudoi.move();
_local2 = shotList;
while ((_local1 = _local2.next) != null) {
_local5 = false;
if (((_local1.move()) && (isInSight(_local1)))){
_local2 = _local1;
} else {
_local2.removeNext();
screen.removeChild(_local1);
};
};
_local2 = enemyList;
while ((_local1 = _local2.next) != null) {
_local8 = (_local1 as Enemy);
_local5 = false;
if (!_local8.move()){
_local5 = true;
};
if (!_local5){
_local4 = shotList;
while ((_local3 = _local4.next) != null) {
if (_local8.region.collision(_local3.region)){
_local6 = (_local3 as KudoiShot);
_local5 = _local8.damage(_local6.attack);
_local4.removeNext();
screen.removeChild(_local3);
if (_local5){
score = (score + _local8.score);
showScore();
break;
};
} else {
_local4 = _local3;
};
};
};
if (!_local5){
if (_local8.region.collision(kudoi.region)){
kudoi.damage(_local8.attack);
_local12 = true;
};
};
if (!isInSight(_local8)){
_local5 = true;
};
if (_local5){
_local2.removeNext();
screen.removeChild(_local1);
} else {
_local2 = _local1;
};
};
_local2 = enemyShotList;
while ((_local1 = _local2.next) != null) {
_local7 = (_local1 as EnemyShot);
_local5 = false;
if (!_local7.move()){
_local5 = true;
};
if (!_local5){
if (_local7.region.collision(kudoi.region)){
kudoi.damage(_local7.attack);
_local12 = true;
_local5 = true;
};
};
if (!isInSight(_local7)){
_local5 = true;
};
if (_local5){
_local2.removeNext();
screen.removeChild(_local1);
} else {
_local2 = _local1;
};
};
_local2 = itemList;
while ((_local1 = _local2.next) != null) {
_local9 = (_local1 as Item);
_local5 = false;
if (!_local9.move()){
_local5 = true;
};
if (((!(_local5)) && (_local11))){
if (_local9.region.collision(kudoi.region)){
_local9.special();
_local5 = true;
};
};
if (!isInSight(_local9)){
_local5 = true;
};
if (_local5){
_local2.removeNext();
screen.removeChild(_local1);
} else {
_local2 = _local1;
};
};
_local2 = scrapList;
while ((_local1 = _local2.next) != null) {
if (((_local1.move()) && (isInSight(_local1)))){
_local2 = _local1;
} else {
_local2.removeNext();
screen.removeChild(_local1);
};
};
if (_local12){
showLife();
};
screen.view();
return (_local11);
}
private function game():void{
screen = new VRScreen(X_MAX, Y_MAX, Z_SCREEN, Z_MIN);
addChildAt(screen, 1);
kudoi = new Kudoi(this, 0, 0, Z_SCREEN);
kudoi.x = X_MAX;
kudoi.y = Y_MAX;
screen.addChild(kudoi);
Snd.playBGM(Snd.BGM);
enemyCnt = 25;
enemyInterval = 75;
tick = 0;
level = 0;
enemyNum = 0;
score = 0;
showScore();
showLife();
opFunction = function ():void{
if (!move()){
gameover();
};
};
}
public static function isInSight(_arg1:VRSprite):Boolean{
return ((((_arg1.region.z < Z_MAX)) && ((_arg1.region.z > Z_MIN))));
}
}
}//package
Section 25
//Game_backCls (Game_backCls)
package {
import mx.core.*;
public class Game_backCls extends BitmapAsset {
}
}//package
Section 26
//Item (Item)
package {
public class Item extends VRSprite {
public var type:int;
public var vz:Number;
public function Item(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=2, _arg6:int=0):void{
super(_arg1, new VRRegion(_arg2, _arg3, _arg4, 0, 0, 0));
type = _arg6;
vz = _arg5;
}
public function special():void{
}
override public function move():Boolean{
region.z = (region.z + vz);
return (true);
}
}
}//package
Section 27
//Joy (Joy)
package {
import flash.ui.*;
public class Joy {
public static const A:uint = 16;
public static const C:uint = 64;
public static const LEFT:uint = 8;
protected static const CODE_Z:uint = "Z".charCodeAt();
public static const B:uint = 32;
protected static const CODE_X:uint = "X".charCodeAt();
public static const UP:uint = 1;
public static const DOWN:uint = 2;
protected static const CODE_C:uint = "C".charCodeAt();
protected static const CODE_K:uint = "K".charCodeAt();
protected static const CODE_L:uint = "L".charCodeAt();
protected static const CODE_space:uint = " ".charCodeAt();
public static const RIGHT:uint = 4;
protected static const CODE_H:uint = "H".charCodeAt();
protected static const CODE_J:uint = "J".charCodeAt();
public static function fromKeyCode(_arg1:uint):uint{
switch (_arg1){
case Keyboard.LEFT:
case CODE_H:
return (LEFT);
case Keyboard.RIGHT:
case CODE_L:
return (RIGHT);
case Keyboard.UP:
case CODE_K:
return (UP);
case Keyboard.DOWN:
case CODE_J:
return (DOWN);
case CODE_Z:
case CODE_space:
return (A);
case CODE_X:
return (B);
case CODE_C:
return (C);
};
return (0);
}
}
}//package
Section 28
//Kudoi (Kudoi)
package {
import flash.display.*;
import flash.geom.*;
public class Kudoi extends VRSprite {
public const SHOT_CNT_QUICK:int = 5;
public const SHOT_CNT:int = 12;
public const DAMAGE_CNT:int = 50;
public var life:int;
public var shotCnt:int;// = 0
public var maxSpeed:int;// = 16
public var attack:int;// = 1
public var wideShot:Number;// = 2
public var damageCnt:int;// = 0
public var lifeMax:int;// = 5
public var quickDraw:Boolean;// = true
private var hair:Bitmap;
private static const hairCls:Class = Kudoi_hairCls;
private static const kudoiCls:Class = Kudoi_kudoiCls;
public function Kudoi(_arg1:Game, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0):void{
var _local5:Bitmap;
maxSpeed = 16;
lifeMax = 5;
damageCnt = 0;
attack = 1;
wideShot = 2;
shotCnt = 0;
quickDraw = true;
super(_arg1, new VRRegion(_arg2, _arg3, (_arg4 + 17), 32, 32, 12));
_local5 = (new kudoiCls() as Bitmap);
_local5.x = -48;
_local5.y = -84;
addChild(_local5);
hair = (new hairCls() as Bitmap);
addChild(hair);
life = lifeMax;
}
private function shoot():void{
var _local1:KudoiShot;
if (game.joyTrig){
if (shotCnt > 0){
shotCnt--;
} else {
_local1 = new KudoiShot(game, region.x, region.y, region.z, wideShot, attack);
game.addShot(_local1);
Snd.play(Snd.SHOOT);
if (quickDraw){
shotCnt = SHOT_CNT_QUICK;
} else {
shotCnt = SHOT_CNT;
};
};
} else {
shotCnt = 0;
};
}
public function damage(_arg1:int):Boolean{
if (damageCnt > 0){
return (false);
};
life = (life - _arg1);
if (life < 0){
life = 0;
};
damageCnt = DAMAGE_CNT;
Snd.play(Snd.DAMAGE);
return (true);
}
private function animation():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
if (scaleX < 0){
hair.rotation = (hair.rotation + 60);
} else {
hair.rotation = (hair.rotation - 60);
};
_local1 = ((hair.rotation * Math.PI) / 180);
_local2 = Math.cos(_local1);
_local3 = Math.sin(_local1);
_local4 = ((16 * _local2) - (24 * _local3));
_local5 = ((16 * _local3) + (24 * _local2));
hair.x = (16 - _local4);
hair.y = (-52 - _local5);
}
override public function move():Boolean{
var _local1:Number;
var _local2:Number;
var _local3:Number;
animation();
if (damageCnt > 0){
damageCnt--;
if ((damageCnt & 1)){
transform.colorTransform = new ColorTransform(0, 0, 0, 1, 0xFF, 0, 0, 0);
} else {
transform.colorTransform = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);
};
};
_local2 = game.joyX;
_local3 = game.joyY;
if (life > 0){
if (_local2 < -(maxSpeed)){
_local2 = -(maxSpeed);
} else {
if (_local2 > maxSpeed){
_local2 = maxSpeed;
};
};
region.x = (region.x + _local2);
if (region.x > 0){
vScaleX = 1;
} else {
vScaleX = -1;
};
if (_local3 < -(maxSpeed)){
_local3 = -(maxSpeed);
} else {
if (_local3 > maxSpeed){
_local3 = maxSpeed;
};
};
region.y = (region.y + _local3);
if (region.x < -(Game.X_MAX)){
region.x = -(Game.X_MAX);
} else {
if (region.x > Game.X_MAX){
region.x = Game.X_MAX;
};
};
if (region.y < -(Game.Y_MAX)){
region.y = -(Game.Y_MAX);
} else {
if (region.y > Game.Y_MAX){
region.y = Game.Y_MAX;
};
};
shoot();
return (true);
//unresolved jump
};
rotation = (rotation + 12);
region.y = (region.y + maxSpeed);
return ((region.y < (Game.Y_MAX + 128)));
}
}
}//package
Section 29
//Kudoi_hairCls (Kudoi_hairCls)
package {
import mx.core.*;
public class Kudoi_hairCls extends BitmapAsset {
}
}//package
Section 30
//Kudoi_kudoiCls (Kudoi_kudoiCls)
package {
import mx.core.*;
public class Kudoi_kudoiCls extends BitmapAsset {
}
}//package
Section 31
//KudoiShot (KudoiShot)
package {
import flash.display.*;
public class KudoiShot extends VRSprite {
public const SPEED:int = 20;
public var attack:int;
public var vz:Number;
private static const shotCls:Class = KudoiShot_shotCls;
public function KudoiShot(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number=1, _arg6:int=1):void{
var _local7:Bitmap;
var _local8:Number;
_local8 = (20 * _arg5);
super(_arg1, new VRRegion(_arg2, _arg3, _arg4, _local8, _local8, SPEED));
vz = SPEED;
attack = _arg6;
_local7 = (new shotCls() as Bitmap);
_local7.x = -24;
_local7.y = -24;
addChild(_local7);
vScaleX = _arg5;
vScaleY = _arg5;
}
override public function move():Boolean{
region.z = (region.z + vz);
return (true);
}
}
}//package
Section 32
//KudoiShot_shotCls (KudoiShot_shotCls)
package {
import mx.core.*;
public class KudoiShot_shotCls extends BitmapAsset {
}
}//package
Section 33
//Label (Label)
package {
import flash.display.*;
import flash.text.*;
public class Label extends Sprite {
public var size:Number;
public var text:String;
public var color1:uint;
public var color2:uint;
public var font:String;
protected var textShadow:TextField;
protected var textField:TextField;
public function Label(_arg1:String, _arg2:uint=0xFFFFFF, _arg3:uint=0, _arg4:Number=12, _arg5:String="_等幅"):void{
color1 = _arg2;
color2 = _arg3;
size = _arg4;
text = _arg1;
font = _arg5;
textShadow = new TextField();
textShadow.autoSize = TextFieldAutoSize.LEFT;
textShadow.selectable = false;
addChild(textShadow);
textShadow.x = 2;
textField = new TextField();
textField.autoSize = TextFieldAutoSize.LEFT;
textField.selectable = false;
addChild(textField);
draw();
}
public function draw():void{
textField.defaultTextFormat = new TextFormat(font, size, color1, true);
textField.text = text;
textShadow.defaultTextFormat = new TextFormat(font, size, color2, true);
textShadow.text = text;
}
}
}//package
Section 34
//Rnd (Rnd)
package {
public class Rnd {
private static var state:int = new Date().time;
public static function next(_arg1:int):int{
var _local2:int;
var _local3:int;
if (_arg1 == 0){
return (0);
};
_local2 = Math.floor((state / 127773));
_local3 = (state % 127773);
state = ((16807 * _local3) - (2836 * _local2));
if (state <= 0){
state = (state + 2147483647);
};
state = (state & 2147483647);
if (state == 0){
state = 1;
};
return ((state % _arg1));
}
public static function number():Number{
return ((Rnd.next(65536) / 65536));
}
public static function coinToss():Boolean{
return ((next(2) == 0));
}
public static function sign():int{
if (next(2) == 0){
return (1);
};
return (-1);
}
}
}//package
Section 35
//Scrap (Scrap)
package {
public class Scrap extends VRSprite {
public var vx:Number;// = 0
public var vy:Number;// = 0
public var vz:Number;// = 0
public var rest:int;
public static const REST:int = 25;
public function Scrap(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number):void{
vx = 0;
vy = 0;
vz = 0;
super(_arg1, new VRRegion(_arg2, _arg3, _arg4));
rest = REST;
}
override public function move():Boolean{
rest--;
if (rest <= 0){
return (false);
};
vAlpha = (rest / REST);
region.x = (region.x + vx);
region.y = (region.y + vy);
region.z = (region.z + vz);
return (true);
}
}
}//package
Section 36
//ScrapFire (ScrapFire)
package {
import flash.display.*;
public class ScrapFire extends Scrap {
private static const fireCls:Class = ScrapFire_fireCls;
public function ScrapFire(_arg1:Game, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Bitmap;
super(_arg1, _arg2, _arg3, _arg4);
_local5 = (new fireCls() as Bitmap);
_local5.x = -16;
_local5.y = -16;
addChild(_local5);
vScaleX = 8;
vScaleY = 8;
}
}
}//package
Section 37
//ScrapFire_fireCls (ScrapFire_fireCls)
package {
import mx.core.*;
public class ScrapFire_fireCls extends BitmapAsset {
}
}//package
Section 38
//Snd (Snd)
package {
import flash.events.*;
import flash.media.*;
public class Snd {
private static const sndData:Array = [(new snd00() as Sound), (new snd01() as Sound), (new snd02() as Sound), (new snd03() as Sound), (new snd04() as Sound), (new snd05() as Sound)];
public static const DESTROY:int = 4;
public static const REFLECT:int = 3;
public static const BGM:int = 0;
private static const snd00:Class = Snd_snd00;
private static const snd01:Class = Snd_snd01;
private static const snd02:Class = Snd_snd02;
private static const snd03:Class = Snd_snd03;
private static const snd04:Class = Snd_snd04;
private static const snd05:Class = Snd_snd05;
public static const DAMAGE:int = 1;
public static const HIT:int = 2;
public static const SHOOT:int = 5;
private static var bgm:Sound;
private static var bgmChannel:SoundChannel;
public static function playBGM(_arg1:int):void{
stopBGM();
bgm = sndData[_arg1];
if (bgm == null){
return;
};
bgmChannel = bgm.play();
if (bgmChannel == null){
bgm = null;
return;
};
bgmChannel.addEventListener(Event.SOUND_COMPLETE, loopBGM);
}
public static function loopBGM(_arg1:Event):void{
if (bgm){
bgmChannel = bgm.play();
if (bgmChannel == null){
bgm = null;
return;
};
bgmChannel.addEventListener(Event.SOUND_COMPLETE, loopBGM);
};
}
public static function stopBGM():void{
if (bgmChannel == null){
return;
};
bgmChannel.stop();
bgmChannel.removeEventListener(Event.SOUND_COMPLETE, loopBGM);
bgm = null;
bgmChannel = null;
}
public static function play(_arg1:int):void{
var _local2:Sound;
_local2 = sndData[_arg1];
if (_local2){
_local2.play();
};
}
}
}//package
Section 39
//Snd_snd00 (Snd_snd00)
package {
import mx.core.*;
public class Snd_snd00 extends SoundAsset {
}
}//package
Section 40
//Snd_snd01 (Snd_snd01)
package {
import mx.core.*;
public class Snd_snd01 extends SoundAsset {
}
}//package
Section 41
//Snd_snd02 (Snd_snd02)
package {
import mx.core.*;
public class Snd_snd02 extends SoundAsset {
}
}//package
Section 42
//Snd_snd03 (Snd_snd03)
package {
import mx.core.*;
public class Snd_snd03 extends SoundAsset {
}
}//package
Section 43
//Snd_snd04 (Snd_snd04)
package {
import mx.core.*;
public class Snd_snd04 extends SoundAsset {
}
}//package
Section 44
//Snd_snd05 (Snd_snd05)
package {
import mx.core.*;
public class Snd_snd05 extends SoundAsset {
}
}//package
Section 45
//VRRegion (VRRegion)
package {
public class VRRegion {
public var y:Number;
public var zSize:Number;
public var xSize:Number;
public var ySize:Number;
public var x:Number;
public var z:Number;
public function VRRegion(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0, _arg5:Number=0, _arg6:Number=0):void{
x = _arg1;
y = _arg2;
z = _arg3;
xSize = _arg4;
ySize = _arg5;
zSize = _arg6;
}
public function collision(_arg1:VRRegion):Boolean{
if (_arg1 == null){
return (false);
};
if (Math.abs((x - _arg1.x)) > (xSize + _arg1.xSize)){
return (false);
};
if (Math.abs((y - _arg1.y)) > (ySize + _arg1.ySize)){
return (false);
};
if (Math.abs((z - _arg1.z)) > (zSize + _arg1.zSize)){
return (false);
};
return (true);
}
public function clone():VRRegion{
return (new VRRegion(x, y, z, xSize, ySize, zSize));
}
}
}//package
Section 46
//VRScreen (VRScreen)
package {
import flash.display.*;
public class VRScreen extends Sprite {
public var minimumZ:Number;
public var screenZ:Number;
public var objArray:Array;
public var screenHeight:Number;
public var screenWidth:Number;
public function VRScreen(_arg1:Number=320, _arg2:Number=240, _arg3:Number=32, _arg4:Number=1):void{
screenWidth = _arg1;
screenHeight = _arg2;
screenZ = _arg3;
minimumZ = _arg4;
}
public function view():void{
var _local1:Array;
var _local2:VRSprite;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:int;
_local5 = (screenZ - minimumZ);
if (_local5 <= 0){
_local5 = 1;
};
_local1 = new Array();
while (numChildren > 0) {
_local2 = (getChildAt(0) as VRSprite);
removeChildAt(0);
if (_local2 != null){
_local1.push(_local2);
_local3 = (_local2.region.z - _local2.region.zSize);
if (_local3 <= minimumZ){
_local2.visible = false;
} else {
_local2.visible = true;
_local4 = ((_local3 - minimumZ) / _local5);
if (_local4 > 1){
_local4 = 1;
} else {
if (_local4 < 0){
_local4 = 0;
};
};
_local2.alpha = (_local2.vAlpha * _local4);
_local6 = (screenZ / _local3);
_local2.x = ((_local2.region.x * _local6) + screenWidth);
_local2.y = ((_local2.region.y * _local6) + screenHeight);
_local2.scaleX = (_local2.vScaleX * _local6);
_local2.scaleY = (_local2.vScaleY * _local6);
};
};
};
_local1.sort(zCompare);
_local7 = 0;
while (_local7 < _local1.length) {
addChildAt(_local1[_local7], 0);
_local7++;
};
}
private static function zCompare(_arg1:VRSprite, _arg2:VRSprite):int{
if ((_arg1.region.z - _arg1.region.zSize) > (_arg2.region.z - _arg2.region.zSize)){
return (1);
};
return (-1);
}
}
}//package
Section 47
//VRSprite (VRSprite)
package {
import flash.display.*;
public class VRSprite extends Sprite {
public var region:VRRegion;
public var vScaleX:Number;
public var vScaleY:Number;
public var vAlpha:Number;
public var game:Game;
public var next:VRSprite;
public function VRSprite(_arg1:Game, _arg2:VRRegion=null):void{
game = _arg1;
if (_arg2 == null){
region = new VRRegion();
} else {
region = _arg2.clone();
};
vScaleX = 1;
vScaleY = 1;
vAlpha = 1;
}
public function addNext(_arg1:VRSprite):void{
_arg1.next = next;
next = _arg1;
}
public function removeNext():VRSprite{
var _local1:VRSprite;
_local1 = next;
if (_local1 == null){
return (null);
};
next = _local1.next;
_local1.next = null;
return (_local1);
}
public function move():Boolean{
return (true);
}
}
}//package