STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228088
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2561 · P5121

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/87941893?noj=FRM87941893-3DC" width="1" height="1"></div>

basics1.swf

This is the info page for
Flash #122379

(Click the ID number above for more basic data on this flash file.)


Text
KILL
S

Damage

Score

104

104

104

Game is paused.

ActionScript [AS3]

Section 1
//Engine (com.asgamer.basics1.Engine) package com.asgamer.basics1 { import flash.display.*; import flash.events.*; import com.senocular.utils.*; import flash.geom.*; import flash.ui.*; public class Engine extends MovieClip { private const WALL_COLOR:uint; private const FINISH_COLOR:uint = 0xFF00; private const WALKABLE_COLOR:uint = 0xDDDDDD; private const NORTH:String = "N"; private const TILE_SIZE:uint = 250; private const START_COLOR:uint = 0xFF0000; private const MAZE_WIDTH:uint = 5; private const MAZE_HEIGHT:uint = 5; private const SOUTH:String = "S"; private const WEST:String = "W"; private const EAST:String = "E"; private var _height:uint; private var msxBottom:Number;// = -15 private var key:KeyObject; private var msxTop:Number;// = 15 private var speed:Number;// = 4 private var numStars:int;// = 10 private var friction2:Number;// = 0.95 var walkable:Boolean; private var _maze:Array; private var pausedMovie:pausedMc; private var stageRef:Stage; private var vx:Number;// = 0 private var vy:Number;// = 0 private var _width:uint; private var xspeed:Number;// = 0 private var speedS:Number;// = 2 private var friction:Number;// = 0.8 public var _container:Sprite; private var scoreHUD:ScoreHUD; private var power:Number;// = 0.8 private var texture:Texture; private var screenShade:ScreenShade; private var notPausingGame:Boolean;// = false private var tile2:Sprite; private var _start:Point; private var ourBall:Ball; private var yspeed:Number;// = 0 private var maxspeed:Number;// = 0.2 private var target:Ship; private var msx:Number; private var ourShadow:playerShadow; private var ourShip:Ship; private var parallaxField:ParallaxField; private var _finish:Point; private var _moves:Array; public static var enemyList:Array = new Array(); public static var wallsList:Array = new Array(); public static var enemy2List:Array = new Array(); public function Engine():void{ var mainContainer:MovieClip; var myKeyDown:Function; var i:int; WALL_COLOR = (Math.random() * 0xFFFFFF); numStars = 10; msxTop = 15; msxBottom = -15; speedS = 2; speed = 4; vx = 0; vy = 0; friction = 0.8; maxspeed = 0.2; power = 0.8; yspeed = 0; xspeed = 0; friction2 = 0.95; walkable = new Boolean(true); notPausingGame = false; super(); myKeyDown = function (_arg1:KeyboardEvent):void{ if (_arg1.keyCode == Keyboard.UP){ vy = (vy + speed); yspeed = (yspeed - power); if (ourShip.y > 440){ _container.y = (_container.y - 3); }; } else { if (_arg1.keyCode == Keyboard.DOWN){ vy = (vy - speed); yspeed = (yspeed + power); if (ourShip.y < 60){ _container.y = (_container.y + 3); }; }; }; if (_arg1.keyCode == Keyboard.LEFT){ vx = (vx + speed); xspeed = (xspeed - power); if (ourShip.x > 440){ _container.x = (_container.x - 3); }; } else { if (_arg1.keyCode == Keyboard.RIGHT){ vx = (vx - speed); xspeed = (xspeed + power); if (ourShip.x < 60){ _container.x = (_container.x + 3); }; }; }; this.stageRef = stageRef; }; screenShade = new ScreenShade(); screenShade.x = (stage.stageWidth / 2); screenShade.y = (stage.stageHeight / 2); stage.addChild(screenShade); pausedMovie = new pausedMc(); addChild(pausedMovie); addEventListener(Event.ACTIVATE, onActivate); addEventListener(Event.DEACTIVATE, onDeactivate); pausedMovie.x = (stage.stageWidth / 2); pausedMovie.alpha = 0.8; pausedMovie.y = (stage.stageHeight / 2); stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; stage.addEventListener(MouseEvent.CLICK, _generate); _width = ((MAZE_WIDTH * 2) + 1); _height = ((MAZE_HEIGHT * 2) + 1); _start = new Point(1, 1); _finish = new Point((_height - 2), (_width - 2)); _container = new Sprite(); _generate(); ourShadow = new playerShadow(); ourShadow.x = (stage.stageWidth / 2); ourShadow.y = (stage.stageHeight / 2); stage.addChild(ourShadow); ourBall = new Ball(); ourBall.x = (stage.stageWidth / 2); ourBall.y = (stage.stageHeight / 2); stage.addChild(ourBall); texture = new Texture(); texture.x = (stage.stageWidth / 2); texture.y = (stage.stageHeight / 2); stage.addChild(texture); ourShip = new Ship(stage); ourShip.x = (stage.stageWidth / 2); ourShip.y = (stage.stageHeight / 2); stage.addChild(ourShip); scoreHUD = new ScoreHUD(stage); stage.addChild(scoreHUD); mainContainer = new MovieClip(); addChild(mainContainer); parallaxField = new ParallaxField(); parallaxField.createField(mainContainer, 0, 0, 650, 650, 5, 0, 0); stage.addEventListener(KeyboardEvent.KEY_DOWN, onMyKeyDown); stage.addEventListener(KeyboardEvent.KEY_UP, onMyKeyUp); stage.addEventListener(KeyboardEvent.KEY_DOWN, myKeyDown); i = 0; while (i < numStars) { stage.addChildAt(new Star(stage), stage.getChildIndex(ourShip)); i = (i + 1); }; addEventListener(Event.ENTER_FRAME, loop, false, 0, true); } private function _drawSide(_arg1:uint):Sprite{ var _local2:Sprite; _local2 = new Sprite(); _local2.graphics.beginFill(_arg1); _local2.graphics.drawRect(0, 0, (TILE_SIZE / 4), (TILE_SIZE / 4)); _local2.graphics.endFill(); _local2.alpha = 0.4; return (_local2); } private function enemyKilled(_arg1:Event){ scoreHUD.updateKills(1); scoreHUD.updateScore(_arg1.currentTarget.points); } private function onEnterFrm(_arg1:Event):void{ } private function onMyKeyUp(_arg1:KeyboardEvent):void{ switch (_arg1.keyCode){ case Keyboard.UP: parallaxField.upPressed = false; case Keyboard.DOWN: parallaxField.downPressed = false; break; case Keyboard.LEFT: parallaxField.leftPressed = false; break; case Keyboard.RIGHT: parallaxField.rightPressed = false; break; }; } private function _randInt(_arg1:int, _arg2:int):int{ return (int(((Math.random() * ((_arg2 - _arg1) + 1)) + _arg1))); } private function _initMaze():void{ var _local1:int; var _local2:int; _maze = new Array(_width); _local1 = 0; while (_local1 < _height) { _maze[_local1] = new Array(_height); _local2 = 0; while (_local2 < _width) { _maze[_local1][_local2] = true; _local2++; }; _local1++; }; _maze[_start.x][_start.y] = false; } private function checkHitShip():void{ if (parallaxField.hitTestObject(ourShip)){ ourShip.y = (ourShip.y - 10); }; } private function _drawMaze():void{ var _local1:Sprite; var _local2:Sprite; var _local3:int; var _local4:int; if (contains(_container)){ removeChild(_container); }; _container = new Sprite(); addChild(_container); _local3 = 0; while (_local3 < _height) { _local4 = 0; while (_local4 < _width) { _local1 = ((_maze[_local3][_local4])==true) ? _drawWallTile(WALL_COLOR) : _drawTile(WALKABLE_COLOR); _local1.x = (_local3 * TILE_SIZE); _local1.y = (_local4 * TILE_SIZE); walkable = true; _container.addChild(_local1); _local2 = ((_maze[_local3][_local4])==false) ? _drawSide(WALL_COLOR) : _giveWalk(FINISH_COLOR); _local2.x = (_local3 * TILE_SIZE); _local2.y = ((_local4 * TILE_SIZE) * Math.random()); walkable = false; _container.addChild(_local2); _local4++; }; _local3++; }; _local1 = _drawTile(START_COLOR); _local1.x = (_start.x * TILE_SIZE); _local1.y = (_start.y * TILE_SIZE); _local1.alpha = 0.5; _container.addChild(_local1); } private function loop(_arg1:Event):void{ var _local2:Stinger; var _local3:Stinger2; var _local4:Wall; setChildIndex(_container, 0); updateEye(); checkHitShip(); ourShadow.y = (ourShip.y + 15); ourShadow.x = ourShip.x; _container.y = (_container.y + vy); _container.x = (_container.x + vx); vy = (vy * friction); vx = (vx * friction); this.target = target; if (_container.y > 5){ _container.y = 5; } else { if ((_container.y + _container.height) < 500){ _container.y = (500 - _container.height); }; }; if (_container.x > 5){ _container.x = 5; } else { if ((_container.x + _container.width) < 500){ _container.x = (500 - _container.width); }; }; if (notPausingGame){ if (Math.floor((Math.random() * 200)) == 5){ _local2 = new Stinger(stage, ourShip); _local2.addEventListener(Event.REMOVED_FROM_STAGE, removeEnemy, false, 0, true); _local2.addEventListener("killed", enemyKilled, false, 0, true); enemyList.push(_local2); stage.addChild(_local2); }; if (Math.floor((Math.random() * 300)) == 4){ _local3 = new Stinger2(stage, ourShip); _local3.addEventListener(Event.REMOVED_FROM_STAGE, removeEnemy2, false, 0, true); _local3.addEventListener("killed", enemyKilled, false, 0, true); enemy2List.push(_local3); stage.addChild(_local3); }; if (Math.floor((Math.random() * 900)) == 3){ _local4 = new Wall(stage, ourShip); _local4.addEventListener(Event.REMOVED_FROM_STAGE, removeWalls, false, 0, true); _local4.addEventListener("broken", wallsBroken, false, 0, true); wallsList.push(_local4); stage.addChild(_local4); }; }; } private function updateEye(){ texture.mask = ourBall; ourBall.y = (ourShip.y + 50); ourBall.x = ourShip.x; xspeed = (xspeed * friction2); yspeed = (yspeed * friction2); this.texture.y = (this.texture.y + yspeed); this.texture.x = (this.texture.x + xspeed); if (texture.x > 300){ texture.x = (texture.x - 250); }; } private function _createMaze():void{ var _local1:int; var _local2:int; var _local3:String; var _local4:Point; _local4 = _start.clone(); _moves = new Array(); _moves.push((_local4.y + (_local4.x * _width))); while (_moves.length) { _local3 = ""; if (((((((((_local4.x + 2) < _height)) && ((_maze[(_local4.x + 2)][_local4.y] == true)))) && (!(((_local4.x + 2) == false))))) && (!(((_local4.x + 2) == (_height - 1)))))){ _local3 = (_local3 + SOUTH); }; if (((((((((_local4.x - 2) >= 0)) && ((_maze[(_local4.x - 2)][_local4.y] == true)))) && (!(((_local4.x - 2) == false))))) && (!(((_local4.x - 2) == (_height - 1)))))){ _local3 = (_local3 + NORTH); }; if (((((((((_local4.y - 2) >= 0)) && ((_maze[_local4.x][(_local4.y - 2)] == true)))) && (!(((_local4.y - 2) == false))))) && (!(((_local4.y - 2) == (_width - 1)))))){ _local3 = (_local3 + WEST); }; if (((((((((_local4.y + 2) < _width)) && ((_maze[_local4.x][(_local4.y + 2)] == true)))) && (!(((_local4.y + 2) == false))))) && (!(((_local4.y + 2) == (_width - 1)))))){ _local3 = (_local3 + EAST); }; if (_local3.length > 0){ _local2 = _randInt(0, (_local3.length - 1)); switch (_local3.charAt(_local2)){ case NORTH: _maze[(_local4.x - 2)][_local4.y] = false; _maze[(_local4.x - 1)][_local4.y] = false; _local4.x = (_local4.x - 2); break; case SOUTH: _maze[(_local4.x + 2)][_local4.y] = false; _maze[(_local4.x + 1)][_local4.y] = false; _local4.x = (_local4.x + 2); break; case WEST: _maze[_local4.x][(_local4.y - 2)] = false; _maze[_local4.x][(_local4.y - 1)] = false; _local4.y = (_local4.y - 2); break; case EAST: _maze[_local4.x][(_local4.y + 2)] = false; _maze[_local4.x][(_local4.y + 1)] = false; _local4.y = (_local4.y + 2); break; }; _moves.push((_local4.y + (_local4.x * _width))); } else { _local1 = _moves.pop(); _local4.x = int((_local1 / _width)); _local4.y = (_local1 % _width); }; }; } private function _generate(_arg1:MouseEvent=null):void{ _initMaze(); _createMaze(); _drawMaze(); } public function _drawWallTile(_arg1:uint):Sprite{ var _local2:Sprite; _local2 = new Sprite(); _local2.graphics.beginFill(_arg1); _local2.graphics.drawRect(0, 0, TILE_SIZE, TILE_SIZE); _local2.graphics.endFill(); _local2.alpha = 0.4; return (_local2); } private function wallsBroken(_arg1:Event){ scoreHUD.updateScore(_arg1.currentTarget.points); } private function onMyKeyDown(_arg1:KeyboardEvent):void{ switch (_arg1.keyCode){ case Keyboard.UP: parallaxField.upPressed = true; case Keyboard.DOWN: parallaxField.downPressed = true; break; case Keyboard.LEFT: parallaxField.leftPressed = true; break; case Keyboard.RIGHT: parallaxField.rightPressed = true; break; }; _arg1.updateAfterEvent(); } private function removeEnemy2(_arg1:Event){ enemy2List.splice(enemy2List.indexOf(_arg1.currentTarget), 1); } private function _drawTile(_arg1:uint):Sprite{ var _local2:Sprite; _local2 = new Sprite(); _local2.graphics.beginFill(_arg1); _local2.graphics.drawRect(0, 0, TILE_SIZE, TILE_SIZE); _local2.graphics.endFill(); return (_local2); } private function removeEnemy(_arg1:Event){ enemyList.splice(enemyList.indexOf(_arg1.currentTarget), 1); } private function onDeactivate(_arg1:Event):void{ removeEventListener(Event.ENTER_FRAME, onEnterFrm); ourShip.removeEventListener("hit", shipHit); addChild(pausedMovie); notPausingGame = true; pausedMovie.alpha = 0.7; trace(notPausingGame); notPausingGame = false; } private function shipHit(_arg1:Event){ scoreHUD.updateHits(1); } private function removeWalls(_arg1:Event){ wallsList.splice(wallsList.indexOf(_arg1.currentTarget), 1); } private function _giveWalk(_arg1:uint):Sprite{ var _local2:Sprite; _local2 = new Sprite(); _local2.graphics.beginFill(_arg1); _local2.graphics.drawCircle(0, 0, (TILE_SIZE / 16)); _local2.graphics.endFill(); _local2.alpha = 1; return (_local2); } private function onActivate(_arg1:Event):void{ addEventListener(Event.ENTER_FRAME, onEnterFrm); ourShip.addEventListener("hit", shipHit, false, 0, true); notPausingGame = !(notPausingGame); trace(notPausingGame); pausedMovie.alpha = 0.1; removeChild(pausedMovie); } } }//package com.asgamer.basics1
Section 2
//LaserBlue (com.asgamer.basics1.LaserBlue) package com.asgamer.basics1 { import flash.display.*; import flash.events.*; import com.senocular.utils.*; import flash.utils.*; import flash.ui.*; import flash.filters.*; public class LaserBlue extends MovieClip { private var friction:Number;// = 1 private var canLive:Boolean;// = true private var boomTimer:Timer; private var canGuide:Boolean;// = true private var gravity:Number;// = -2 private var key:KeyObject; private var maxspeed:Number;// = 13 private var bulletXSpeed:Number;// = 0 private var guideTimer:Timer; private var stageRef:Stage; private var speed:Number;// = 8 private var lifeTimer:Timer; private var vx:Number;// = 0 private var vy:Number;// = 0 private var speedX:Number;// = 8 private var speedY:Number;// = 8 private var bulletYSpeed:Number;// = 15 public function LaserBlue(_arg1:Stage, _arg2:Number, _arg3:Number):void{ bulletYSpeed = 15; bulletXSpeed = 0; gravity = -2; speed = 8; speedX = 8; speedY = 8; vx = 0; vy = 0; friction = 1; maxspeed = 13; canGuide = true; canLive = true; super(); guideTimer = new Timer(300, 1); guideTimer.addEventListener(TimerEvent.TIMER, guideTimerHandler, false, 0, true); boomTimer = new Timer(1700, 1); boomTimer.addEventListener(TimerEvent.TIMER, boomTimerHandler, false, 0, true); lifeTimer = new Timer(2000, 1); lifeTimer.addEventListener(TimerEvent.TIMER, lifeTimerHandler, false, 0, true); this.stageRef = _arg1; this.x = _arg2; this.y = _arg3; key = new KeyObject(_arg1); guideTimer.start(); boomTimer.start(); lifeTimer.start(); addEventListener(Event.ENTER_FRAME, loop, false, 0, true); } private function removeSelf():void{ removeEventListener(Event.ENTER_FRAME, loop); lifeTimer.stop(); this.scaleX = (this.scaleX * 2); if (stageRef.contains(this)){ stageRef.removeChild(this); }; } private function guideTimerHandler(_arg1:TimerEvent):void{ canGuide = false; } private function lifeTimerHandler(_arg1:TimerEvent):void{ canLive = false; stageRef.addChild(new SmallImplosion(stageRef, x, y)); removeSelf(); } private function loop(_arg1:Event):void{ var _local2:int; var _local3:int; var _local4:int; if (canGuide){ if (key.isDown(Keyboard.LEFT)){ vx = (vx - speedX); } else { if (key.isDown(Keyboard.RIGHT)){ vx = (vx + speedX); }; }; if (key.isDown(Keyboard.UP)){ vy = (vy - speedY); } else { if (key.isDown(Keyboard.DOWN)){ vy = (vy + speedY); } else { vy = (vy - (speedY / 2)); }; }; }; x = (x + vx); y = (y + vy); if (vx > maxspeed){ vx = maxspeed; } else { if (vx < -(maxspeed)){ vx = -(maxspeed); }; }; if (vy > maxspeed){ vy = maxspeed; } else { if (vy < -(maxspeed)){ vy = -(maxspeed); }; }; if (x <= 4){ vx = (vx * -1); } else { if (x >= 495){ vx = (vx * -1); }; }; if (y <= 10){ vy = (vy * -1); } else { if (y >= 495){ vy = (vy * -1); }; }; _local2 = 0; while (_local2 < Engine.enemyList.length) { if (hitTestObject(Engine.enemyList[_local2].hit)){ Engine.enemyList[_local2].takeHit(); removeSelf(); }; _local2++; }; _local3 = 0; while (_local3 < Engine.enemy2List.length) { if (hitTestObject(Engine.enemy2List[_local3].hit)){ Engine.enemy2List[_local3].takeHit(); removeSelf(); }; _local3++; }; _local4 = 0; while (_local4 < Engine.wallsList.length) { if (hitTestObject(Engine.wallsList[_local4].hit)){ Engine.wallsList[_local4].takeHit(); removeSelf(); }; _local4++; }; } private function boomTimerHandler(_arg1:TimerEvent):void{ var _local2:GlowFilter; scaleX = (scaleX * 0.5); scaleY = (scaleY * 0.5); rotation = (rotation + (vx + vy)); _local2 = new GlowFilter(); _local2.color = 0xFF0000; this.filters = [_local2]; } } }//package com.asgamer.basics1
Section 3
//ParallaxField (com.asgamer.basics1.ParallaxField) package com.asgamer.basics1 { import flash.display.*; import flash.events.*; import flash.utils.*; public class ParallaxField extends MovieClip { private var friction:Number;// = 0.05 private var containerX:int; private var containerY:int; private var containerHeight:int; private var isStarted:Boolean;// = false private var starBox:Sprite; private var maxSpeed:Number;// = 0.06 private var _rightPressed:Boolean;// = false private var _leftPressed:Boolean;// = false private var _downPressed:Boolean;// = false private var starsArray:Array; private var acceleration:Number;// = -0.05 private var _upPressed:Boolean;// = false private var containerWidth:int; private var pathToContainer:MovieClip; private var starArrayLength:int; private var speedX:Number; private var speedY:Number; private static var STAR_NORMAL:String = "normal"; private static var STAR_SMALL:String = "small"; private static var STAR_LARGE:String = "large"; private static var STAR_EXTRALARGE:String = "extralarge"; public function ParallaxField(){ acceleration = -0.05; starsArray = []; friction = 0.05; maxSpeed = 0.06; isStarted = false; _upPressed = false; _downPressed = false; _leftPressed = false; _rightPressed = false; super(); } private function updateSpeed():void{ if (upPressed){ speedY = (speedY - acceleration); } else { if (downPressed){ speedY = (speedY + acceleration); } else { speedY = (speedY * friction); }; }; if (rightPressed){ speedX = (speedX + acceleration); } else { if (leftPressed){ speedX = (speedX - acceleration); } else { speedX = (speedX * friction); }; }; } public function get upPressed():Boolean{ return (_upPressed); } public function get leftPressed():Boolean{ return (_leftPressed); } public function set leftPressed(_arg1:Boolean):void{ _leftPressed = _arg1; } public function set upPressed(_arg1:Boolean):void{ _upPressed = _arg1; } public function get downPressed():Boolean{ return (_downPressed); } public function createField(_arg1:MovieClip, _arg2:int, _arg3:int, _arg4:int, _arg5:int, _arg6:int, _arg7:int, _arg8:int):void{ trace("createField"); pathToContainer = _arg1; containerX = _arg2; containerY = _arg3; containerWidth = _arg4; containerHeight = _arg5; speedX = _arg7; speedY = _arg8; createStarBox(); addStars(_arg6, "small"); addStars(_arg6, "normal"); addStars(_arg6, "large"); addStars(_arg6, "extralarge"); enable(); } public function get rightPressed():Boolean{ return (_rightPressed); } private function updateStars():void{ var _local1:MovieClip; var _local2:int; starArrayLength = starsArray.length; _local2 = 0; while (_local2 < starArrayLength) { _local1 = starsArray[_local2]; _local1.x = (_local1.x + (speedX * _local1.speedModifier)); _local1.y = (_local1.y + (speedY * _local1.speedModifier)); if (_local1.x >= ((containerWidth - _local1.width) + containerX)){ _local1.x = containerX; _local1.y = ((Math.random() * (containerHeight - _local1.height)) + containerY); } else { if (_local1.x <= containerX){ _local1.x = ((containerWidth + containerX) - _local1.width); _local1.y = ((Math.random() * (containerHeight - _local1.height)) + containerY); }; }; if (_local1.y >= ((containerHeight - _local1.height) + containerY)){ _local1.x = ((Math.random() * (containerWidth - _local1.width)) + containerX); _local1.y = containerY; } else { if (_local1.y <= containerY){ _local1.x = ((Math.random() * (containerWidth - _local1.width)) + containerX); _local1.y = ((containerHeight + containerY) - _local1.height); }; }; _local2++; }; } private function createStarBox():void{ var _local1:Sprite; trace("Creating star container..."); trace((" path: " + pathToContainer)); trace((" x: " + containerX)); trace((" y: " + containerY)); trace((" width: " + containerWidth)); trace((" height: " + containerHeight)); starBox = new Sprite(); starBox.graphics.beginFill(0); starBox.x = containerX; starBox.y = containerY; starBox.width = containerWidth; starBox.height = containerHeight; _local1 = new Sprite(); _local1.graphics.beginFill(0xFF0000); _local1.graphics.drawRect(containerX, containerY, containerWidth, containerHeight); pathToContainer.addChild(_local1); starBox.mask = _local1; pathToContainer.addChild(starBox); trace(" Container Created \n"); } public function enable():void{ if (!isStarted){ trace("Starting parallax effect..."); isStarted = true; pathToContainer.addEventListener(Event.ENTER_FRAME, gameLoop); } else { trace("Parallax effect already running."); }; } public function addStars(_arg1:int, _arg2:String):void{ var _local3:Number; var _local4:String; var _local5:Number; var _local6:Class; var _local7:int; var _local8:MovieClip; trace("Adding stars..."); if (_arg2 == STAR_EXTRALARGE){ _local4 = "StarExtraLarge"; _local5 = 3; _local3 = Math.round((_arg1 * 3)); }; if (_arg2 == STAR_LARGE){ _local4 = "StarLarge"; _local5 = 2.5; _local3 = Math.round((_arg1 * 0.8)); } else { if (_arg2 == STAR_NORMAL){ _local4 = "StarNormal"; _local5 = 2.3; _local3 = Math.round((_arg1 * 0.6)); } else { if (_arg2 == STAR_SMALL){ _local3 = Math.round((_arg1 * 1)); _local4 = "StarSmall"; _local5 = 2; }; }; }; trace((" type: " + _local4)); trace((" amount: " + _local3)); _local7 = 0; while (_local7 < _local3) { _local6 = (getDefinitionByName(_local4) as Class); _local8 = new (_local6); _local8.x = ((Math.random() * (containerWidth - _local8.width)) + containerX); _local8.y = ((Math.random() * (containerHeight - _local8.height)) + containerY); _local8.speedModifier = _local5; starsArray.push(_local8); pathToContainer.addChild(_local8); _local7++; }; trace("Stars Added \n"); } private function gameLoop(_arg1:Event):void{ updateSpeed(); updateStars(); } public function set rightPressed(_arg1:Boolean):void{ _rightPressed = _arg1; } public function set downPressed(_arg1:Boolean):void{ _downPressed = _arg1; } public function disable():void{ if (isStarted){ trace("Stopping parallax effect..."); isStarted = false; pathToContainer.removeEventListener(Event.ENTER_FRAME, gameLoop); } else { trace("Parallax effect is not running."); }; } } }//package com.asgamer.basics1
Section 4
//Particle (com.asgamer.basics1.Particle) package com.asgamer.basics1 { import flash.display.*; public class Particle { public var fade:Number;// = 0 public var yVel:Number;// = 0 public var xVel:Number;// = 0 public var shrink:Number;// = -2 public var gravity:Number;// = 2 public var clip:DisplayObject; public var drag:Number;// = 0.3 public function Particle(_arg1:Class, _arg2:DisplayObjectContainer, _arg3:Number, _arg4:Number){ xVel = 0; yVel = 0; drag = 0.3; gravity = 2; shrink = -2; fade = 0; super(); clip = new (_arg1); _arg2.addChild(clip); clip.x = _arg3; clip.y = _arg4; } public function update():void{ clip.x = (xVel + Math.ceil((Math.random() * 12))); clip.y = (clip.y - (yVel + Math.ceil((Math.random() * 12)))); xVel = (xVel * drag); yVel = (yVel * drag); clip.scaleX = (clip.scaleX * shrink); clip.scaleY = (clip.scaleY * shrink); clip.alpha = (clip.alpha + fade); } public function destroy():void{ clip.parent.removeChild(clip); } } }//package com.asgamer.basics1
Section 5
//ScoreHUD (com.asgamer.basics1.ScoreHUD) package com.asgamer.basics1 { import flash.display.*; import flash.text.*; public class ScoreHUD extends MovieClip { public var s_kills:Number;// = 0 public var hits:TextField; public var score:TextField; private var stageRef:Stage; public var s_hits:Number;// = 0 public var s_score:Number;// = 0 public var kills:TextField; public function ScoreHUD(_arg1:Stage){ s_score = 0; s_hits = 0; s_kills = 0; super(); this.stageRef = _arg1; kills.text = "0"; hits.text = "0"; score.text = "0"; x = 5; y = ((_arg1.stageHeight - height) - 430); } public function updateScore(_arg1:Number):void{ s_score = (s_score + _arg1); score.text = String(s_score); } public function updateHits(_arg1:Number):void{ s_hits = (s_hits + _arg1); hits.text = String(s_hits); } public function updateKills(_arg1:Number):void{ s_kills = (s_kills + _arg1); kills.text = String(s_kills); } } }//package com.asgamer.basics1
Section 6
//ScreenShade (com.asgamer.basics1.ScreenShade) package com.asgamer.basics1 { import flash.display.*; public dynamic class ScreenShade extends MovieClip { } }//package com.asgamer.basics1
Section 7
//Ship (com.asgamer.basics1.Ship) package com.asgamer.basics1 { import flash.display.*; import flash.events.*; import com.senocular.utils.*; import flash.utils.*; import flash.ui.*; public class Ship extends MovieClip { private var friction:Number;// = 0.0098 private var power;// = 0.3 private var canFire:Boolean;// = true private var gravity:Number;// = 0 private var key:KeyObject; private var maxspeed:Number;// = 0.1 private var speed:Number;// = 0.02 private var yspeed;// = 0 private var friction2;// = 0.95 private var target:Star; public var hit:MovieClip; private var fireTimer:Timer; private var stageRef:Stage; public var vx:Number;// = 0 public var vy:Number;// = 0 private var xspeed;// = 0 public function Ship(_arg1:Stage):void{ gravity = 0; speed = 0.02; vx = 0; vy = 0; friction = 0.0098; maxspeed = 0.1; power = 0.3; yspeed = 0; xspeed = 0; friction2 = 0.95; canFire = true; super(); addFrameScript(0, frame1); addEventListener(Event.ACTIVATE, onActivate); addEventListener(Event.DEACTIVATE, onDeactivate); this.stageRef = _arg1; key = new KeyObject(_arg1); this.target = target; fireTimer = new Timer(600, 1); fireTimer.addEventListener(TimerEvent.TIMER, fireTimerHandler, false, 0, true); addEventListener(Event.ENTER_FRAME, loop, false, 0, true); } private function fireBullet():void{ if (canFire){ stageRef.addChild(new LaserBlue(stageRef, (x + vx), (y - 10))); canFire = false; fireTimer.start(); vy = (vy + gravity); }; } function frame1(){ stop(); } public function loop(_arg1:Event):void{ if (key.isDown(Keyboard.LEFT)){ vx = (vx - speed); } else { if (key.isDown(Keyboard.RIGHT)){ vx = (vx + speed); } else { vx = (vx * friction); }; }; if (key.isDown(Keyboard.UP)){ vy = (vy - speed); } else { if (key.isDown(Keyboard.DOWN)){ vy = (vy + speed); } else { vy = (vy * friction); }; }; if (key.isDown(Keyboard.SPACE)){ fireBullet(); }; x = (x + vx); y = (y + vy); if (vx > maxspeed){ vx = maxspeed; } else { if (vx < -(maxspeed)){ vx = -(maxspeed); }; }; if (vy > maxspeed){ vy = maxspeed; } else { if (vy < -(maxspeed)){ vy = -(maxspeed); }; }; rotation = (rotation + vx); if (x > (stageRef.stageWidth - 26)){ x = (stageRef.stageWidth - 26); vx = -(vx); } else { if (x < 26){ x = 26; vx = -(vx); }; }; if (y > (stageRef.stageHeight - 26)){ y = (stageRef.stageHeight - 26); vy = -(vy); } else { if (y < 26){ y = 26; vy = -(vy); }; }; } public function takeHit():void{ dispatchEvent(new Event("hit")); gotoAndPlay("destroyed"); vx = (vx * -1); vy = (vy * -1); } private function onDeactivate(_arg1:Event):void{ speed = 0; vx = 0; vy = 0; friction = 0; maxspeed = 0; } private function fireTimerHandler(_arg1:TimerEvent):void{ canFire = true; } private function onActivate(_arg1:Event):void{ speed = 2; vx = 0; vy = 0; friction = 0.98; maxspeed = 13; } } }//package com.asgamer.basics1
Section 8
//SmallImplosion (com.asgamer.basics1.SmallImplosion) package com.asgamer.basics1 { import flash.display.*; import flash.events.*; public class SmallImplosion extends MovieClip { public var particles:Array; private var stageRef:Stage; public function SmallImplosion(_arg1:Stage, _arg2:Number, _arg3:Number){ addFrameScript(0, frame1); this.stageRef = _arg1; this.x = _arg2; this.y = _arg3; addEventListener(Event.ENTER_FRAME, loop, false, 0, true); } public function randRange(_arg1:Number, _arg2:Number){ return (((Math.random() * (_arg2 - _arg1)) + _arg1)); } function frame1(){ particles = new Array(); addEventListener(Event.ENTER_FRAME, frameLoop); } public function frameLoop(_arg1:Event){ var _local2:Particle; var _local3:int; _local3 = 0; while (_local3 < particles.length) { particles[_local3].update(); _local3++; }; _local2 = new Particle(Spark, this, 0, 0); _local2.xVel = randRange(-1, 1); _local2.yVel = (_local2.yVel + 4); _local2.drag = 0.05; _local2.gravity = -0.8; _local2.clip.scaleX = (_local2.clip.scaleY = randRange(0.5, 0.8)); _local2.shrink = 1.02; _local2.fade = 0.02; _local2.clip.alpha = 0.3; particles.push(_local2); while (particles.length > 20) { _local2 = particles.shift(); _local2.destroy(); }; } private function loop(_arg1:Event){ if (currentFrame == totalFrames){ removeSelf(); }; } private function removeSelf():void{ removeEventListener(Event.ENTER_FRAME, loop); if (stageRef.contains(this)){ stageRef.removeChild(this); }; } } }//package com.asgamer.basics1
Section 9
//Spark (com.asgamer.basics1.Spark) package com.asgamer.basics1 { import flash.display.*; public dynamic class Spark extends MovieClip { public function Spark(){ addFrameScript(8, frame9); } function frame9(){ stop(); } } }//package com.asgamer.basics1
Section 10
//Star (com.asgamer.basics1.Star) package com.asgamer.basics1 { import flash.display.*; import flash.events.*; public class Star extends MovieClip { private var speed:Number; private var target:Ship; public var hit:MovieClip; private var stageRef:Stage; public function Star(_arg1:Stage){ this.stageRef = _arg1; setupStar(true); gotoAndStop(Math.max(1, (Math.floor((Math.round((Math.random() * 90)) / 30)) * 30))); addEventListener(Event.ENTER_FRAME, loop, false, 0, true); } public function setupStar(_arg1:Boolean=false):void{ y = (_arg1) ? (Math.random() * stageRef.stageHeight) : 0; x = (Math.random() * stageRef.stageWidth); alpha = 0; this.target = target; speed = (2 + (Math.random() * 2)); } public function loop(_arg1:Event):void{ y = (y + alpha); x = (x + alpha); if (y > stageRef.stageHeight){ setupStar(); }; } } }//package com.asgamer.basics1
Section 11
//Stinger (com.asgamer.basics1.Stinger) package com.asgamer.basics1 { import flash.display.*; import flash.events.*; import com.senocular.utils.*; import flash.utils.*; import flash.ui.*; public class Stinger extends MovieClip { private var friction:Number;// = 0.0098 public var points:int;// = 1 private var rando:Number; public var scaleFind:Number; private var canFire:Boolean;// = true private var ay:Number;// = -0.02 private var ax:Number;// = 0.02 public var getTime:Number; private var moveTimer:Timer; private var key:KeyObject; private var maxspeed:Number;// = 0.1 private var speed:Number;// = 1 private var target:Ship; public var hit:MovieClip; private var stageRef:Stage; private var unpausingGame:Boolean; private var canMove:Boolean;// = true private var vx:Number;// = 0.02 private var vy:Number;// = -0.4 private var fireTimer:Timer; private var gx:Number;// = 0 private var gy:Number;// = 0 public function Stinger(_arg1:Stage, _arg2:Ship):void{ vy = -0.4; ay = -0.02; speed = 1; friction = 0.0098; maxspeed = 0.1; vx = 0.02; ax = 0.02; gx = 0; gy = 0; unpausingGame = new Boolean(true); rando = (Math.ceil((Math.random() * 10)) - 5); canMove = true; canFire = true; points = 1; super(); addFrameScript(8, frame9); stop(); fireTimer = new Timer(900, 1); fireTimer.addEventListener(TimerEvent.TIMER, fireTimerHandler, false, 0, true); getTime = (Math.floor((Math.random() * 4100)) + 3000); moveTimer = new Timer(getTime, 9); moveTimer.addEventListener(TimerEvent.TIMER, moveTimerHandler, false, 0, true); this.stageRef = _arg1; this.target = _arg2; key = new KeyObject(_arg1); x = 0; y = (Math.random() * _arg1.stageWidth); scaleFind = ((Math.random() * 41) + 10); if (scaleFind > 25){ scaleX = 1; } else { if (scaleFind < 25){ scaleX = -1; }; }; addEventListener(Event.ACTIVATE, onActivate); addEventListener(Event.DEACTIVATE, onDeactivate); addEventListener(Event.ENTER_FRAME, loop, false, 0, true); } private function onActivate(_arg1:Event):void{ unpausingGame = true; } private function fireWeapon():void{ if (canFire){ gotoAndPlay("alert"); y = (y - vy); if (x < target.x){ stageRef.addChild(new StingerBullet(stageRef, target, x, y, 9)); } else { if (x > target.x){ stageRef.addChild(new StingerBullet(stageRef, target, x, y, -9)); }; }; }; } function frame9(){ gotoAndStop(1); } private function fireWeapon2():void{ var _local1:int; _local1 = 0; while (_local1 < Engine.enemy2List.length) { if (y < Engine.enemy2List[_local1].y){ stageRef.addChild(new Stinger2Bullet(stageRef, target, x, y, 8)); } else { if (y > Engine.enemy2List[_local1].y){ stageRef.addChild(new Stinger2Bullet(stageRef, target, x, y, -8)); }; }; _local1++; }; } private function loop(_arg1:Event):void{ var _local2:int; if (unpausingGame){ moveTimer.start(); if (currentLabel != "destroyed"){ vy = (vy + ay); x = (x - vy); y = (y - 0.8); if (key.isDown(Keyboard.LEFT)){ x = (x + rando); } else { if (key.isDown(Keyboard.RIGHT)){ x = (x - rando); } else { gx = (gx * friction); }; }; if (key.isDown(Keyboard.UP)){ y = (y + rando); } else { if (key.isDown(Keyboard.DOWN)){ y = (y - rando); } else { gy = (gy * friction); }; }; if (y > stageRef.stageHeight){ removeSelf(); }; if (((((y - 8) < target.y)) && (((y + 3) > target.y)))){ fireWeapon(); }; _local2 = 0; while (_local2 < Engine.enemy2List.length) { if (((((y - 5) < Engine.enemy2List[_local2].y)) && (((y + 5) > Engine.enemy2List[_local2].y)))){ fireWeapon2(); }; _local2++; }; }; }; if (currentLabel == "destroyedComplete"){ removeSelf(); }; } private function onDeactivate(_arg1:Event):void{ unpausingGame = false; } private function moveTimerHandler(_arg1:TimerEvent):void{ canMove = true; vx = (vx * rando); y = (y + rando); scaleX = (scaleX * -1); } public function takeHit():void{ if (currentLabel != "destroyed"){ dispatchEvent(new Event("killed")); stageRef.addChild(new SmallImplosion(stageRef, (x - 10), (y + 10))); gotoAndPlay("destroyed"); } else { removeSelf(); }; } private function fireTimerHandler(_arg1:TimerEvent):void{ canFire = true; } private function removeSelf():void{ removeEventListener(Event.ENTER_FRAME, loop); if (stageRef.contains(this)){ stageRef.removeChild(this); }; } } }//package com.asgamer.basics1
Section 12
//Stinger2 (com.asgamer.basics1.Stinger2) package com.asgamer.basics1 { import flash.display.*; import flash.events.*; import com.senocular.utils.*; import flash.utils.*; import flash.ui.*; public class Stinger2 extends MovieClip { private var friction:Number;// = 0.0098 public var points:int;// = 20 private var rando:Number; private var ay:Number;// = 0 private var ax:Number;// = 0.02 public var getTime:Number; private var moveTimer:Timer; private var key:KeyObject; private var maxspeed:Number;// = 0.1 private var speed:Number;// = 2 private var target:Ship; public var hit:MovieClip; private var stageRef:Stage; private var unpausingGame:Boolean; private var canMove:Boolean;// = true private var vx:Number;// = 0.02 private var vy:Number;// = 0 private var gx:Number;// = 0 private var gy:Number;// = 0 public function Stinger2(_arg1:Stage, _arg2:Ship):void{ speed = 2; friction = 0.0098; maxspeed = 0.1; vx = 0.02; ax = 0.02; vy = 0; ay = 0; gx = 0; gy = 0; canMove = true; points = 20; rando = (Math.ceil((Math.random() * 2)) - 2); unpausingGame = new Boolean(true); super(); stop(); this.stageRef = _arg1; this.target = _arg2; key = new KeyObject(_arg1); x = 520; y = (Math.random() * _arg1.stageHeight); getTime = (Math.floor((Math.random() * 4100)) + 3000); moveTimer = new Timer(getTime, 9); moveTimer.addEventListener(TimerEvent.TIMER, moveTimerHandler, false, 0, true); addEventListener(Event.ENTER_FRAME, loop, false, 0, true); addEventListener(Event.ACTIVATE, onActivate); addEventListener(Event.DEACTIVATE, onDeactivate); } private function onActivate(_arg1:Event):void{ unpausingGame = true; } private function fireWeapon():void{ if (y < target.y){ stageRef.addChild(new Stinger2Bullet(stageRef, target, x, y, -8)); } else { if (y > target.y){ stageRef.addChild(new Stinger2Bullet(stageRef, target, x, y, 8)); }; }; } private function fireWeapon2():void{ var _local1:int; _local1 = 0; while (_local1 < Engine.enemyList.length) { if (y < Engine.enemyList[_local1].y){ stageRef.addChild(new Stinger2Bullet(stageRef, target, x, y, -8)); } else { if (y > Engine.enemyList[_local1].y){ stageRef.addChild(new Stinger2Bullet(stageRef, target, x, y, 8)); }; }; _local1++; }; } private function onDeactivate(_arg1:Event):void{ unpausingGame = false; } private function moveTimerHandler(_arg1:TimerEvent):void{ canMove = true; vx = (vx * rando); y = (y + rando); scaleX = (scaleX * -1); } public function takeHit():void{ if (currentLabel != "destroyed"){ dispatchEvent(new Event("killed")); rotation = (rotation + (Math.random() * 360)); stageRef.addChild(new SmallImplosion(stageRef, x, y)); gotoAndPlay("destroyed"); }; } private function loop(_arg1:Event):void{ var _local2:int; if (unpausingGame){ vx = (vx + ax); x = (x - vx); vy = (vy + ay); y = (y - vy); }; if (hitTestObject(target.hit)){ target.takeHit(); stageRef.addChild(new SmallImplosion(stageRef, x, y)); gotoAndPlay("destroyed"); }; if (currentLabel != "destroyed"){ if (key.isDown(Keyboard.LEFT)){ x = (x + speed); } else { if (key.isDown(Keyboard.RIGHT)){ x = (x - speed); } else { gx = (gx * friction); }; }; if (key.isDown(Keyboard.UP)){ y = (y + speed); } else { if (key.isDown(Keyboard.DOWN)){ y = (y - speed); } else { gy = (gy * friction); }; }; moveTimer.start(); if (y > stageRef.stageHeight){ y = (y - 5); }; if (((((x - 5) < target.x)) && (((x + 5) > target.x)))){ fireWeapon(); }; _local2 = 0; while (_local2 < Engine.enemyList.length) { if (((((x - 5) < Engine.enemyList[_local2].x)) && (((x + 5) > Engine.enemyList[_local2].x)))){ fireWeapon2(); }; _local2++; }; }; if (currentLabel == "destroyedComplete"){ removeSelf(); }; } private function removeSelf():void{ removeEventListener(Event.ENTER_FRAME, loop); if (stageRef.contains(this)){ stageRef.removeChild(this); }; } } }//package com.asgamer.basics1
Section 13
//Stinger2Bullet (com.asgamer.basics1.Stinger2Bullet) package com.asgamer.basics1 { import flash.display.*; import flash.events.*; public class Stinger2Bullet extends MovieClip { private var target:Ship; private var stageRef:Stage; private var vx:Number; public function Stinger2Bullet(_arg1:Stage, _arg2:Ship, _arg3:Number, _arg4:Number, _arg5:Number):void{ this.stageRef = _arg1; this.target = _arg2; this.x = _arg3; this.y = _arg4; this.vx = _arg5; addEventListener(Event.ENTER_FRAME, loop, false, 0, true); } private function loop(_arg1:Event):void{ var _local2:int; y = (y - vx); if ((((x > stageRef.stageWidth)) || ((x < 0)))){ removeSelf(); }; if (hitTestObject(target.hit)){ target.takeHit(); stageRef.addChild(new SmallImplosion(stageRef, x, y)); removeSelf(); }; _local2 = 0; while (_local2 < Engine.enemyList.length) { if (hitTestObject(Engine.enemyList[_local2].hit)){ Engine.enemyList[_local2].takeHit(); removeSelf(); }; _local2++; }; } private function removeSelf():void{ removeEventListener(Event.ENTER_FRAME, loop); if (stageRef.contains(this)){ stageRef.removeChild(this); }; } } }//package com.asgamer.basics1
Section 14
//StingerBullet (com.asgamer.basics1.StingerBullet) package com.asgamer.basics1 { import flash.display.*; import flash.events.*; import flash.utils.*; import flash.filters.*; public class StingerBullet extends MovieClip { private var target:Ship; private var lifeTimer:Timer; private var stageRef:Stage; private var vx:Number; private var vy:Number;// = 1 public function StingerBullet(_arg1:Stage, _arg2:Ship, _arg3:Number, _arg4:Number, _arg5:Number):void{ var _local6:GlowFilter; vy = 1; super(); lifeTimer = new Timer(500, 1); lifeTimer.addEventListener(TimerEvent.TIMER, lifeTimerHandler, false, 0, true); this.stageRef = _arg1; this.target = _arg2; this.x = _arg3; this.y = _arg4; this.vx = _arg5; addEventListener(Event.ENTER_FRAME, loop, false, 0, true); _local6 = new GlowFilter(); _local6.color = 0xFF0000; this.filters = [_local6]; lifeTimer.start(); } private function lifeTimerHandler(_arg1:TimerEvent):void{ removeSelf(); } private function loop(_arg1:Event):void{ var _local2:int; x = (x + vx); y = (y + vy); if ((((x > stageRef.stageWidth)) || ((x < 0)))){ removeSelf(); }; if (hitTestObject(target.hit)){ target.takeHit(); stageRef.addChild(new SmallImplosion(stageRef, x, y)); removeSelf(); }; _local2 = 0; while (_local2 < Engine.enemy2List.length) { if (hitTestObject(Engine.enemy2List[_local2].hit)){ Engine.enemy2List[_local2].takeHit(); removeSelf(); }; _local2++; }; } private function removeSelf():void{ removeEventListener(Event.ENTER_FRAME, loop); if (stageRef.contains(this)){ stageRef.removeChild(this); }; } } }//package com.asgamer.basics1
Section 15
//TiledMazeGen (com.asgamer.basics1.TiledMazeGen) package com.asgamer.basics1 { import flash.display.*; import flash.events.*; import flash.geom.*; public class TiledMazeGen extends Sprite { private const START_COLOR:uint = 0xFF0000; private const MAZE_WIDTH:uint = 20; private const WALL_COLOR:uint = 0; private const FINISH_COLOR:uint = 0xFF00; private const MAZE_HEIGHT:uint = 20; private const SOUTH:String = "S"; private const WEST:String = "W"; private const WALKABLE_COLOR:uint = 0xDDDDDD; private const NORTH:String = "N"; private const TILE_SIZE:uint = 10; private const EAST:String = "E"; private var _container:Sprite; private var _start:Point; private var _height:uint; private var _finish:Point; private var _moves:Array; private var _width:uint; private var _maze:Array; public function TiledMazeGen():void{ stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; stage.addEventListener(MouseEvent.CLICK, _generate); _width = ((MAZE_WIDTH * 2) + 1); _height = ((MAZE_HEIGHT * 2) + 1); _start = new Point(1, 1); _container = new Sprite(); _generate(); } private function _randInt(_arg1:int, _arg2:int):int{ return (int(((Math.random() * ((_arg2 - _arg1) + 1)) + _arg1))); } private function _initMaze():void{ var _local1:int; var _local2:int; _maze = new Array(_width); _local1 = 0; while (_local1 < _height) { _maze[_local1] = new Array(_height); _local2 = 0; while (_local2 < _width) { _maze[_local1][_local2] = true; _local2++; }; _local1++; }; _maze[_start.x][_start.y] = false; } private function _drawTile(_arg1:uint):Sprite{ var _local2:Sprite; _local2 = new Sprite(); _local2.graphics.beginFill(_arg1); _local2.graphics.drawRect(0, 0, TILE_SIZE, TILE_SIZE); _local2.graphics.endFill(); return (_local2); } private function _drawMaze():void{ var _local1:Sprite; var _local2:int; var _local3:int; if (contains(_container)){ removeChild(_container); }; _container = new Sprite(); addChild(_container); _local2 = 0; while (_local2 < _height) { _local3 = 0; while (_local3 < _width) { _local1 = ((_maze[_local2][_local3])==true) ? _drawTile(WALL_COLOR) : _drawTile(WALKABLE_COLOR); _local1.x = (_local2 * TILE_SIZE); _local1.y = (_local3 * TILE_SIZE); _container.addChild(_local1); _local3++; }; _local2++; }; _local1 = _drawTile(START_COLOR); _local1.x = (_start.x * TILE_SIZE); _local1.y = (_start.y * TILE_SIZE); _container.addChild(_local1); } private function _createMaze():void{ var _local1:int; var _local2:int; var _local3:String; var _local4:Point; _local4 = _start.clone(); _moves = new Array(); _moves.push((_local4.y + (_local4.x * _width))); while (_moves.length) { _local3 = ""; if (((((((((_local4.x + 2) < _height)) && ((_maze[(_local4.x + 2)][_local4.y] == true)))) && (!(((_local4.x + 2) == false))))) && (!(((_local4.x + 2) == (_height - 1)))))){ _local3 = (_local3 + SOUTH); }; if (((((((((_local4.x - 2) >= 0)) && ((_maze[(_local4.x - 2)][_local4.y] == true)))) && (!(((_local4.x - 2) == false))))) && (!(((_local4.x - 2) == (_height - 1)))))){ _local3 = (_local3 + NORTH); }; if (((((((((_local4.y - 2) >= 0)) && ((_maze[_local4.x][(_local4.y - 2)] == true)))) && (!(((_local4.y - 2) == false))))) && (!(((_local4.y - 2) == (_width - 1)))))){ _local3 = (_local3 + WEST); }; if (((((((((_local4.y + 2) < _width)) && ((_maze[_local4.x][(_local4.y + 2)] == true)))) && (!(((_local4.y + 2) == false))))) && (!(((_local4.y + 2) == (_width - 1)))))){ _local3 = (_local3 + EAST); }; if (_local3.length > 0){ _local2 = _randInt(0, (_local3.length - 1)); switch (_local3.charAt(_local2)){ case NORTH: _maze[(_local4.x - 2)][_local4.y] = false; _maze[(_local4.x - 1)][_local4.y] = false; _local4.x = (_local4.x - 2); break; case SOUTH: _maze[(_local4.x + 2)][_local4.y] = false; _maze[(_local4.x + 1)][_local4.y] = false; _local4.x = (_local4.x + 2); break; case WEST: _maze[_local4.x][(_local4.y - 2)] = false; _maze[_local4.x][(_local4.y - 1)] = false; _local4.y = (_local4.y - 2); break; case EAST: _maze[_local4.x][(_local4.y + 2)] = false; _maze[_local4.x][(_local4.y + 1)] = false; _local4.y = (_local4.y + 2); break; }; _moves.push((_local4.y + (_local4.x * _width))); } else { _local1 = _moves.pop(); _local4.x = int((_local1 / _width)); _local4.y = (_local1 % _width); }; }; } private function _generate(_arg1:MouseEvent=null):void{ _initMaze(); _createMaze(); _drawMaze(); } } }//package com.asgamer.basics1
Section 16
//Wall (com.asgamer.basics1.Wall) package com.asgamer.basics1 { import flash.display.*; import flash.events.*; public class Wall extends MovieClip { public var points:int;// = 0 private var ay:Number;// = 0.2 private var target:Ship; public var hit:MovieClip; private var stageRef:Stage; private var vy:Number;// = -0.5 public function Wall(_arg1:Stage, _arg2:Ship):void{ vy = -0.5; ay = 0.2; points = 0; super(); stop(); this.stageRef = _arg1; this.target = _arg2; x = (Math.random() * _arg1.stageWidth); y = -10; addEventListener(Event.ENTER_FRAME, loop, false, 0, true); } private function loop(_arg1:Event):void{ if (hitTestObject(target.hit)){ target.takeHit(); stageRef.addChild(new SmallImplosion(stageRef, x, y)); target.y = (target.y + 20); gotoAndPlay("destroyed"); }; if (currentLabel != "destroyed"){ vy = (vy + ay); y = (y + vy); if (y > stageRef.stageHeight){ removeSelf(); }; if (((((y - 15) < target.y)) && (((y + 15) > target.y)))){ fireWeapon(); }; }; if (currentLabel == "destroyedComplete"){ removeSelf(); }; } public function takeHit():void{ if (currentLabel != "destroyed"){ dispatchEvent(new Event("broken")); gotoAndPlay("destroyed"); }; } private function fireWeapon():void{ } private function removeSelf():void{ removeEventListener(Event.ENTER_FRAME, loop); if (stageRef.contains(this)){ stageRef.removeChild(this); }; } } }//package com.asgamer.basics1
Section 17
//KeyObject (com.senocular.utils.KeyObject) package com.senocular.utils { import flash.display.*; import flash.events.*; import flash.utils.*; import flash.ui.*; public dynamic class KeyObject extends Proxy { private static var keysDown:Object; private static var stage:Stage; public function KeyObject(_arg1:Stage){ construct(_arg1); } private function keyPressed(_arg1:KeyboardEvent):void{ keysDown[_arg1.keyCode] = true; } public function construct(_arg1:Stage):void{ KeyObject.stage = _arg1; keysDown = new Object(); _arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed); _arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased); } override "http://www.adobe.com/2006/actionscript/flash/proxy"?? function getProperty(_arg1){ return (((_arg1 in Keyboard)) ? Keyboard[_arg1] : -1); } public function isDown(_arg1:uint):Boolean{ return (Boolean((_arg1 in keysDown))); } private function keyReleased(_arg1:KeyboardEvent):void{ delete keysDown[_arg1.keyCode]; } public function deconstruct():void{ stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed); stage.removeEventListener(KeyboardEvent.KEY_UP, keyReleased); keysDown = new Object(); KeyObject.stage = null; } } }//package com.senocular.utils
Section 18
//Ball (Ball) package { import flash.display.*; public dynamic class Ball extends MovieClip { } }//package
Section 19
//pausedMc (pausedMc) package { import flash.display.*; public dynamic class pausedMc extends MovieClip { } }//package
Section 20
//playerShadow (playerShadow) package { import flash.display.*; public dynamic class playerShadow extends MovieClip { } }//package
Section 21
//StarExtraLarge (StarExtraLarge) package { import flash.display.*; public dynamic class StarExtraLarge extends MovieClip { } }//package
Section 22
//StarLarge (StarLarge) package { import flash.display.*; public dynamic class StarLarge extends MovieClip { } }//package
Section 23
//StarNormal (StarNormal) package { import flash.display.*; public dynamic class StarNormal extends MovieClip { } }//package
Section 24
//StarSmall (StarSmall) package { import flash.display.*; public dynamic class StarSmall extends MovieClip { } }//package
Section 25
//Texture (Texture) package { import flash.display.*; public dynamic class Texture extends MovieClip { } }//package

Library Items

Symbol 1 GraphicUsed by:2
Symbol 2 MovieClip {Texture}Uses:1
Symbol 3 GraphicUsed by:4
Symbol 4 MovieClip {StarSmall}Uses:3
Symbol 5 GraphicUsed by:6
Symbol 6 MovieClip {StarNormal}Uses:5
Symbol 7 GraphicUsed by:8 17
Symbol 8 MovieClip {StarLarge}Uses:7
Symbol 9 GraphicUsed by:14
Symbol 10 GraphicUsed by:14
Symbol 11 GraphicUsed by:12
Symbol 12 MovieClipUses:11Used by:14 17 32 41 59
Symbol 13 GraphicUsed by:14
Symbol 14 MovieClip {com.asgamer.basics1.Ship}Uses:9 10 12 13
Symbol 15 GraphicUsed by:17
Symbol 16 GraphicUsed by:17
Symbol 17 MovieClip {com.asgamer.basics1.Star}Uses:7 12 15 16
Symbol 18 ShapeTweeningUsed by:23
Symbol 19 GraphicUsed by:23
Symbol 20 ShapeTweeningUsed by:23
Symbol 21 ShapeTweeningUsed by:23
Symbol 22 GraphicUsed by:23
Symbol 23 MovieClip {com.asgamer.basics1.LaserBlue}Uses:18 19 20 21 22
Symbol 24 GraphicUsed by:32
Symbol 25 GraphicUsed by:28
Symbol 26 GraphicUsed by:28
Symbol 27 GraphicUsed by:28
Symbol 28 MovieClipUses:25 26 27Used by:32 41
Symbol 29 GraphicUsed by:32
Symbol 30 GraphicUsed by:32
Symbol 31 GraphicUsed by:32
Symbol 32 MovieClip {com.asgamer.basics1.Stinger2}Uses:24 28 29 30 12 31
Symbol 33 GraphicUsed by:41
Symbol 34 ShapeTweeningUsed by:41
Symbol 35 GraphicUsed by:41
Symbol 36 GraphicUsed by:41
Symbol 37 GraphicUsed by:41
Symbol 38 ShapeTweeningUsed by:41
Symbol 39 ShapeTweeningUsed by:41
Symbol 40 GraphicUsed by:41
Symbol 41 MovieClip {com.asgamer.basics1.Stinger}Uses:33 28 34 35 12 36 37 38 39 40
Symbol 42 ShapeTweeningUsed by:45
Symbol 43 ShapeTweeningUsed by:45
Symbol 44 GraphicUsed by:45
Symbol 45 MovieClip {com.asgamer.basics1.Stinger2Bullet}Uses:42 43 44
Symbol 46 GraphicUsed by:47
Symbol 47 MovieClip {com.asgamer.basics1.StingerBullet}Uses:46
Symbol 48 MovieClip {com.asgamer.basics1.SmallImplosion}
Symbol 49 FontUsed by:50 51 52 53 54 55 64
Symbol 50 TextUses:49Used by:56
Symbol 51 TextUses:49Used by:56
Symbol 52 TextUses:49Used by:56
Symbol 53 EditableTextUses:49Used by:56
Symbol 54 EditableTextUses:49Used by:56
Symbol 55 EditableTextUses:49Used by:56
Symbol 56 MovieClip {com.asgamer.basics1.ScoreHUD}Uses:50 51 52 53 54 55
Symbol 57 GraphicUsed by:59
Symbol 58 GraphicUsed by:59
Symbol 59 MovieClip {com.asgamer.basics1.Wall}Uses:57 12 58
Symbol 60 ShapeTweeningUsed by:62
Symbol 61 GraphicUsed by:62
Symbol 62 MovieClip {com.asgamer.basics1.Spark}Uses:60 61
Symbol 63 GraphicUsed by:65
Symbol 64 EditableTextUses:49Used by:65
Symbol 65 MovieClip {pausedMc}Uses:63 64
Symbol 66 GraphicUsed by:67
Symbol 67 MovieClip {com.asgamer.basics1.TiledMazeGen}Uses:66
Symbol 68 GraphicUsed by:69
Symbol 69 MovieClip {playerShadow}Uses:68
Symbol 70 GraphicUsed by:71
Symbol 71 MovieClip {Ball}Uses:70
Symbol 72 GraphicUsed by:73
Symbol 73 MovieClip {StarExtraLarge}Uses:72
Symbol 74 GraphicUsed by:75
Symbol 75 MovieClip {com.asgamer.basics1.ScreenShade}Uses:74

Instance Names

"hit"Symbol 14 MovieClip {com.asgamer.basics1.Ship} Frame 1Symbol 12 MovieClip
"hit"Symbol 17 MovieClip {com.asgamer.basics1.Star} Frame 1Symbol 12 MovieClip
"hit"Symbol 32 MovieClip {com.asgamer.basics1.Stinger2} Frame 1Symbol 12 MovieClip
"hit"Symbol 41 MovieClip {com.asgamer.basics1.Stinger} Frame 1Symbol 12 MovieClip
"kills"Symbol 56 MovieClip {com.asgamer.basics1.ScoreHUD} Frame 1Symbol 53 EditableText
"hits"Symbol 56 MovieClip {com.asgamer.basics1.ScoreHUD} Frame 1Symbol 54 EditableText
"score"Symbol 56 MovieClip {com.asgamer.basics1.ScoreHUD} Frame 1Symbol 55 EditableText
"hit"Symbol 59 MovieClip {com.asgamer.basics1.Wall} Frame 1Symbol 12 MovieClip

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata not present, AS3.

Labels

"destroyed"Symbol 14 MovieClip {com.asgamer.basics1.Ship} Frame 2
"default"Symbol 32 MovieClip {com.asgamer.basics1.Stinger2} Frame 1
"alert"Symbol 32 MovieClip {com.asgamer.basics1.Stinger2} Frame 2
"destroyed"Symbol 32 MovieClip {com.asgamer.basics1.Stinger2} Frame 3
"destroyedComplete"Symbol 32 MovieClip {com.asgamer.basics1.Stinger2} Frame 5
"default"Symbol 41 MovieClip {com.asgamer.basics1.Stinger} Frame 1
"alert"Symbol 41 MovieClip {com.asgamer.basics1.Stinger} Frame 2
"destroyed"Symbol 41 MovieClip {com.asgamer.basics1.Stinger} Frame 10
"destroyedComplete"Symbol 41 MovieClip {com.asgamer.basics1.Stinger} Frame 20
"default"Symbol 59 MovieClip {com.asgamer.basics1.Wall} Frame 1
"destroyed"Symbol 59 MovieClip {com.asgamer.basics1.Wall} Frame 2
"destroyedComplete"Symbol 59 MovieClip {com.asgamer.basics1.Wall} Frame 6




http://swfchan.com/25/122379/info.shtml
Created: 4/3 -2019 00:18:39 Last modified: 4/3 -2019 00:18:39 Server time: 03/05 -2024 11:39:19