Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stop();
- var song:Sound = new Sound();
- song.attachSound("song.wav");
- fort.swapDepths(1002100);
- s1.swapDepths(1003125);
- s2.swapDepths(1003134);
- s3.swapDepths(1003334);
- song.start(0,99);
- song.start(0,99);
- var akshot:Sound = new Sound();
- akshot.attachSound("ak.wav");
- var damage:Sound = new Sound();
- damage.attachSound("damage.wav");
- var pCol:Sound = new Sound();
- pCol.attachSound("pCol.wav");
- akshot.setVolume(20);
- import flash.filters.BlurFilter;
- import mx.transitions.Tween;
- import mx.transitions.easing.Strong;
- var totalBlur:Number = 8;
- var noBlur :Number = 0;
- keyListener = new Object();
- sBlur = 0;
- keyListener.onKeyDown = function() {
- num = Key.getAscii();
- if(num == 112 || num == 32){
- gamePause = !gamePause;
- if(sBlur == 0){
- sBlur = 1;
- }else{
- sBlur = 0;
- }
- }
- }
- Key.addListener(keyListener);
- depth = 10;
- speed = 2;
- jumping = 0;
- ducking = 0;
- falling = 0;
- touchingGround = 0;
- rightWall = 0;
- leftWall = 0;
- right = 1;
- MouseDown = 0;
- delay = 0;
- enemyAttach = 0;
- ySpeed = 0;
- shake = 0;
- score = 0;
- kills = 0;
- wave = 1;
- ammo = new Array(200, 0, 0, 0, 0);
- gunUsed = 0;
- money = 0;
- health = 100;
- bullets = new Array();
- bulletX = new Array();
- bulletY = new Array();
- enemies = new Array();
- enemyLives = new Array();
- fallingSpeedA = new Array();
- delayA = new Array();
- shootingA = new Array(); // Equivalent to MouseDown for player.
- leftWall_a = new Array();
- rightWall_a = new Array();
- rightA = new Array();
- touchingGroundA = new Array();
- fallingA = new Array();
- duckingA = new Array();
- jumpingA = new Array();
- rightSpeed = new Array();
- leftSpeed = new Array();
- enemyType = new Array();
- xSpeed = 0;
- ySpeed = 0;
- friction2 = .85;
- gravity = .8;
- engravity = .5;
- friction = .99;
- attachMovie("pBottom","player", 1000000);
- player._x = Stage.width/2;
- player._y = (Stage.height/2) + (Stage.height/6);
- function updateStats(){
- s3.scoreTxt = score;
- s3.killsTxt = kills;
- s3.levelTxt = wave;
- s3.ammoTxt = ammo[gunUsed];
- s3.moneyTxt = money;
- s2._xscale = health;
- s3.hTxt = health + "/100";
- }
- updateStats();
- attachMovie("player_top","player_top", 1000001);
- player_top._x = Stage.width/2;
- player_top._y = (Stage.height/2) + (Stage.height/6);;
- toMove = 0;
- gamePause = false;
- pScale = 75;
- player._xscale = player._yscale = 75;
- player_top._xscale = player_top._yscale = 75;
- function onEnterFrame(){
- if(sBlur == 1){
- var blur:BlurFilter = new BlurFilter(totalBlur, totalBlur, 3);
- _root.filters = new Array(blur);
- var blurTween:Tween;
- blurTween = new Tween(blur, "blurX", Strong.easeOut, blur.blurX, noBlur, 1.0, true);
- blurTween.onMotionChanged = function() {
- blur.blurY = blur.blurX;
- _root.filters = new Array(blur);
- }
- }
- if(sBlur == 0){
- _root.filters = null;
- }
- if(!gamePause){
- if(_xmouse > player._x){
- right = 1;
- }
- player_top.gun.gun._x = player_top.gun.aa._x;
- player_top.gun.gun._y = player_top.gun.aa._y;
- if((Key.isDown(Key.RIGHT) || Key.isDown(68)) && rightWall == 0 && ducking != 1){
- xSpeed += speed;
- if(level.ground.hitTest(player._x, player._y + 50, true)){
- player.gotoAndStop(2);
- player_top.gotoAndStop(3);
- }else{
- player_top.gotoAndPlay(7);
- }
- player._xscale = pScale;
- }
- else if((Key.isDown(Key.LEFT) || Key.isDown(65)) && leftWall == 0 && ducking != 1){
- xSpeed -= speed;
- if(level.ground.hitTest(player._x, player._y + 50, true)){
- player.gotoAndStop(2);
- player_top.gotoAndStop(4);
- }
- else{
- player_top.gotoAndStop(8);
- }
- player._xscale = -pScale;
- }else{
- if(Key.isDown(Key.DOWN) || Key.isDown(83) || !level.ground.hitTest(player._x, player._y + 50, true)){
- }else{
- if(player._xscale == pScale){
- player_top.gotoAndStop(1);
- }else{
- player_top.gotoAndStop(2);
- }
- player.gotoAndStop(1);
- }
- }
- //player_top.gun._y = -18;
- if((Key.isDown(Key.DOWN) || Key.isDown(83)) && level.ground.hitTest(player._x, player._y + 50, true)){
- if(player._xscale == pScale){
- player_top.gotoAndStop(5);
- player.gotoAndStop(3);
- }else{
- player_top.gotoAndStop(6);
- player.gotoAndStop(3);
- }
- //player_top.gun._y = 0;
- }
- xSpeed *= friction2;
- //player._x += xSpeed;
- level._x -= xSpeed;
- fort._x -= xSpeed;
- wall2._x -= xSpeed;
- ducking = 0;
- if((Key.isDown(Key.DOWN) || Key.isDown(83))){
- ducking = 1;
- }
- if(level.ground.hitTest(player._x, player._y + (45) - 6, true)){
- touchingGround = 1;
- ySpeed = 0;
- falling = 0;
- }else{
- touchingGround = 0;
- falling = 1;
- }
- if(falling == 1){
- ySpeed += gravity;
- ySpeed *= friction;
- }
- if(jumping == 1){
- ySpeed = - 15;
- jumping = 0;
- }
- //player._y += ySpeed;
- level._y -= ySpeed;
- fort._y -= ySpeed;
- wall2._y -= ySpeed;
- if((Key.isDown(Key.UP) || Key.isDown(87)) && falling == 0){
- touchingGround = 0;
- jumping = 1;
- }
- if(!level.ground.hitTest(player._x, player._y + 50, true)){
- player.gotoAndStop(4);
- if(player._xscale == pScale){
- player_top.gotoAndStop(7);
- }else{
- player_top.gotoAndStop(8);
- }
- }
- if(jumping == 1 && touchingGround == 1){
- jumping = 0;
- }
- var playPlace = player._y;
- while(level.ground.hitTest(player._x, player._y + (45) - 7, true)){
- player._y -= .1; // Murked
- }
- toMove = player._y - (playPlace);
- player._y = playPlace;
- level._y -= toMove;
- fort._y -= toMove;
- wall2._y -= toMove;
- for(i = pUps.length - 1; i >= 0; i--){
- pUps[i]._y += toMove;
- }
- for(i = enemies.length - 1; i >= 0; i--){
- enemies[i]._y -= toMove;
- }
- for(i = bullets.length - 1; i >= 0; i--){
- bullets[i]._y -= toMove;
- }
- for(i = deadEnemies.length -1; i >= 0; i--){
- deadEnemies[i]._y -= toMove;
- }
- var playPlace2 = player._x;
- while(wall2.hitTest(player._x + (player._width/2), player._y, true)){
- player._x -= 1; // Murked
- wall2.t1.gotoAndPlay(2);
- wall2.t2.gotoAndPlay(2);
- }
- while(wall2.hitTest(player._x - (player._width/2), player._y, true)){
- player._x += 1; // Murked
- wall2.t1.gotoAndPlay(2);
- wall2.t2.gotoAndPlay(2);
- }
- toMove = player._x - (playPlace2);
- player._x = playPlace2;
- level._x -= toMove;
- fort._x -= toMove;
- wall2._x -= toMove;
- for(i = pUps.length - 1; i >= 0; i--){
- pUps[i]._x -= toMove;
- }
- for(i = enemies.length - 1; i >= 0; i--){
- enemies[i]._x -= toMove;
- }
- for(i = bullets.length - 1; i >= 0; i--){
- bullets[i]._x -= toMove;
- }
- for(i = deadEnemies.length -1; i >= 0; i--){
- deadEnemies[i]._x -= toMove;
- }
- //player._y = (Stage.height/2) + (Stage.height/4);
- var xMouseDist = ((Stage.width/2) - _xmouse)/4;
- var yMouseDist = ((Stage.height/2) + (Stage.height/6) - _ymouse)/4;
- var distToGoX = (((Stage.width/2) + xMouseDist) - player._x)/4;
- var distToGoY = (((Stage.height/2) + (Stage.height/6) + yMouseDist) - player._y)/4;
- player._y += distToGoY;
- level._y +=distToGoY;
- fort._y += distToGoY;
- wall2._x += distToGoX;
- wall2._y += distToGoY;
- player._x += distToGoX;
- level._x +=distToGoX;
- fort._x +=distToGoX;
- for(i = pUps.length - 1; i >= 0; i--){
- pUps[i]._x += distToGoX;
- pUps[i]._y += distToGoY;
- }
- for(i = enemies.length - 1; i >= 0; i--){
- enemies[i]._y += distToGoY;
- enemies[i]._x += distToGoX;
- }
- for(i = bullets.length - 1; i >= 0; i--){
- bullets[i]._y += distToGoY;
- bullets[i]._x += distToGoX;
- }
- for(i = deadEnemies.length -1; i >= 0; i--){
- deadEnemies[i]._x += distToGoX;
- deadEnemies[i]._y += distToGoY;
- }
- player_top._x = player._x;
- player_top._y = player._y;
- var dx:Number = _xmouse - (player_top._x + player_top.gun._x + player_top.gun.gun._x);
- var dy:Number = _ymouse - (player_top._y + player_top.gun._y + player_top.gun.gun._y);
- var radians:Number = Math.atan2(dy, dx);
- player_top.gun.gun._rotation = radians * 180 / Math.PI;
- if(_xmouse < player_top._x){
- player_top.gun.gun._xscale = 100;
- }
- if(_xmouse > player_top._x){
- player_top.gun.gun._xscale = -100;
- }
- if(_xmouse >= player_top._x){
- player_top.gun.gun._rotation += 180;
- }
- shooting();
- enemyCreate();
- enemyMovement();
- bulletMovement();
- shaker();
- pMoves();
- deadEnemiesMovement();
- player_top.gun.gun._x = player_top.gun.aa._x;
- player_top.gun.gun._y = player_top.gun.aa._y;
- player_top.gun.gun._rotation -= 5;
- if(_xmouse >= player._x){
- player_top.gun.gun._rotation += 10;
- }
- player_top.gun.gotoAndStop(player.gun._currentframe);
- wall2._x = level._x + 525.15 + 95.7;
- fort._x = level._x + 429.5;
- wall2._y = level._y + 174.35 - 305.7;
- fort._y = level._y - 80.45;
- }
- }
- onMouseDown = function(){
- MouseDown = 1;
- }
- onMouseUp = function(){
- MouseDown = 0;
- }
- function shaker(){
- if(shake == 0){
- }
- else if(shake == 1){
- shake += 1;
- _root._x += Math.cos(player_top.gun.gun._rotation*Math.PI/180)*5;
- _root._y += Math.sin(player_top.gun.gun._rotation*Math.PI/180)*5;
- }
- else if(shake == 2){
- shake = 3;
- _root._x = Math.cos(player_top.gun.gun._rotation*Math.PI/180)*4;
- _root._y = Math.sin(player_top.gun.gun._rotation*Math.PI/180)*4;
- }
- else if(shake == 3){
- shake = 4;
- _root._x = Math.cos(player_top.gun.gun._rotation*Math.PI/180)*3;
- _root._y = Math.sin(player_top.gun.gun._rotation*Math.PI/180)*3;
- }
- else if(shake == 4){
- shake = 0;
- _root._x = 0;
- _root._y = 0;
- }
- tt._x = 318.9 - _root._x;
- tt._y = 288.65 - _root._y;
- s1._x = 348 - _root._x;
- s1._y = 9.5 - _root._y;
- s2._x = 9.5 - _root._x;
- s2._y = 9 - _root._y;
- s3._x = 351.95 - _root._x;
- s3._y = 25.2 - _root._y;
- }
- xmoveAdd = 0;
- ymoveAdd = 0;
- currentX = 0;
- currentY = 0;
- function shooting(){
- delay -= 1;
- if(MouseDown == 1 && delay <= 0){
- if(shake == 0){
- shake = 1;
- }
- ammo[gunUsed] -= 1;
- updateStats();
- akshot.start();
- player_top.gun.gun.gShot.gotoAndStop(randRange(2,4));
- bc = attachMovie("bCasing", "bCasing" + depth, depth);
- depth++;
- if(_xmouse >= player._x){
- player_top.gun.gun._rotation += 180;
- }
- xmoveAdd2 = (Math.cos(player_top.gun.gun._rotation * Math.PI / 180)*10);
- ymoveAdd2 = (Math.sin(player_top.gun.gun._rotation * Math.PI / 180)*10);
- currentX2 = player_top._x + (player_top.gun._x + (player_top.gun.gun._x)*(2.65))+(xmoveAdd2*3);
- currentY2 = player_top._y + (player_top.gun._y + (player_top.gun.gun._y)*(2.65))+(ymoveAdd2*3);
- bc._x = currentX2;
- bc._y = currentY2;
- if(_xmouse >= player._x){
- player_top.gun.gun._rotation += 180;
- }
- var upLift = (Math.random()*5)+5;
- var xDire = (Math.random()*4)-2;
- var rotAng = Math.random()*10;
- bc.onEnterFrame = function(){
- upLift -= .7;
- this._y -= upLift;
- this._x += xDire;
- this._alpha -= 2;
- this._x -= xSpeed;
- this._rotation += rotAng;
- if(this._alpha <= 0){
- this.removeMovieClip();
- }
- }
- delay = 5;
- triangle.removeMovieClip();
- createEmptyMovieClip ("triangle", 900555 + depth);
- depth++;
- with (triangle){
- lineStyle(1, 0xFFFFFF);
- if(_xmouse >= player_top._x){
- player_top.gun.gun._rotation += 180;
- }
- xmoveAdd = (Math.cos(player_top.gun.gun._rotation * Math.PI / 180)*10)+Math.random();
- ymoveAdd = (Math.sin(player_top.gun.gun._rotation * Math.PI / 180)*10)+Math.random();
- currentX = player_top._x + (player_top.gun._x + (player_top.gun.gun._x)*(2.65))+(xmoveAdd*7);
- currentY = player_top._y + (player_top.gun._y + (player_top.gun.gun._y)*(2.65))+(ymoveAdd*7);
- moveTo((player_top._x + (player_top.gun._x + (player_top.gun.gun._x)*(2.65)))+(xmoveAdd*7), (player_top._y + (player_top.gun._y + (player_top.gun.gun._y)*(2.65)))+(ymoveAdd*7));
- for(t = 100; t>= 0; t--){
- currentX += xmoveAdd;
- currentY += ymoveAdd;
- lineTo(currentX, currentY);
- for(i = enemies.length - 1; i >= 0; i--){
- if(enemies[i].hitTest(currentX, currentY, true)){
- t = -5;
- enemyLives[i] -= 1;
- damage.start();
- damage.start();
- ep = _root.attachMovie("partExp", "partExt" + depth, depth);
- depth++;
- ep._x = currentX;
- ep._y = currentY;
- ep.gotoAndStop(randRange(1,3));
- ep._xscale = ep._yscale = 75;
- if(player._x - currentX >= 0){
- ep._xscale *= -1;
- }
- if(enemyLives[i] <= 0){
- si = _root.attachMovie("scoreInc", "scoreInc" + depth, depth);
- depth++;
- si._x = currentX;
- si._y = currentY;
- si.tNum.tNum = "+" + 10;
- deadEnemies.push(enemies[i]);
- removeEnemy(0);
- }
- }
- }
- if(level.ground.hitTest(currentX, currentY, true)){
- fs = _root.attachMovie("floorShot", "floor" + depth, depth);
- depth++;
- fs.gotoAndStop(randRange(1,3));
- currentX += xmoveAdd;
- currentY += ymoveAdd;
- lineTo(currentX, currentY);
- fs._x = currentX;
- fs._y = currentY;
- t = -5;
- }
- }
- if(_xmouse >= player_top._x){
- player_top.gun.gun._rotation -= 180;
- }
- }
- player_top.gun.gun._rotation -= 2;
- triangle.onEnterFrame = function(){
- triangle._alpha -= triangle._alpha/4;
- if(triangle._alpha <= 5){
- triangle.removeMovieClip();
- }
- }
- }
- }
- function bulletMovement(){
- for(i = bullets.length; i >= 0; i--){
- bullets[i]._x -= xSpeed;
- bullets[i]._y -= ySpeed;
- bullets[i]._x += bulletX[i];
- bullets[i]._y += bulletY[i];
- if(level.ground.hitTest(bullets[i]._x,bullets[i]._y,true)){
- bullets[i].removeMovieClip();
- bullets.splice(i,1);
- bulletX.splice(i,1);
- bulletY.splice(i,1);
- }
- if(outside.hitTest(bullets[i]._x,bullets[i]._y,true)){
- bullets[i].removeMovieClip();
- bullets.splice(i,1);
- bulletX.splice(i,1);
- bulletY.splice(i,1);
- }
- }
- }
- function enemyCreate(){
- enemyAttach -= 1;
- if(enemyAttach <= 0){
- enemyAttach = 65;
- var eType = randRange(1,3);
- if(eType == 1){
- en = attachMovie("enemy1","enemy" + depth,depth);
- enemyLives.push(6);
- rightSpeed.push(2);
- leftSpeed.push(2);
- }
- if(eType == 2){
- en = attachMovie("enemy2","enemy" + depth,depth);
- enemyLives.push(2);
- rightSpeed.push(5);
- leftSpeed.push(5);
- }
- if(eType == 3){
- en = attachMovie("enemy3","enemy" + depth,depth);
- enemyLives.push(4);
- rightSpeed.push(4);
- leftSpeed.push(4);
- }
- depth++;
- if(randRange(0,1) == 1){
- en._x = -en._width/2;
- }else{
- en._x = Stage.width + (en._width/2);
- }
- if(wall2._x >= 1000){
- en._x = Stage.width + (en._width/2);
- }
- if(wall2._x <= -300){
- en._x = -en._width/2;
- }
- en._y = level._y + 50;
- en._xscale = en._yscale = 75;
- enemies.push(en);
- enemyType.push(eType);
- //Enemy vars
- fallingSpeedA.push(0);
- delayA.push(0);
- shootingA.push(0);
- leftWall_a.push(0);
- rightWall_a.push(0);
- rightA.push(1);
- touchingGroundA.push(0);
- fallingA.push(0);
- duckingA.push(0);
- jumpingA.push(0);
- }
- }
- function enemyMovement(){
- for(i = enemies.length - 1; i >= 0; i--){
- enemies[i]._x -= xSpeed;
- enemies[i]._y -= ySpeed;
- if(player._x < enemies[i]._x && enemies[i]._currentframe != 2){
- enemies[i]._x -= rightSpeed[i];
- enemies[i]._xscale = 75;
- }
- if(player._x > enemies[i]._x && enemies[i]._currentframe != 2){
- enemies[i]._x += leftSpeed[i];
- enemies[i]._xscale = -75;
- }
- if(enemies[i]._currentframe == 2 && enemies[i].d1._currentframe == 5 && enemies[i].hitTest(player)){
- health -= 10;
- redD.gotoAndPlay(2);
- if(health <= 0){
- health = 0;
- }
- updateStats();
- if(enemyType[i] == 3){
- removeEnemy(1);
- }
- }
- if(enemies[i].hitTest(player)){
- enemies[i].gotoAndStop(2);
- if(enemyType[i] == 2){
- deadEnemies.push(enemies[i]);
- removeEnemy(0);
- health -= 10;
- redD.gotoAndPlay(2);
- if(health <= 0){
- health = 0;
- }
- updateStats();
- }
- }
- if(level.ground.hitTest(enemies[i]._x, enemies[i]._y + (enemies[i]._height/2) - 6, true)){
- touchingGroundA[i] = 1;
- fallingSpeedA[i] = 0;
- fallingA[i] = 0;
- }else{
- touchingGroundA[i] = 0;
- fallingA[i] = 1;
- }
- if(fallingA[i] == 1){
- fallingSpeedA[i] += engravity;
- fallingSpeedA[i] *= friction;
- }
- if(jumpingA[i] == 1){
- fallingSpeedA[i] = - 15;
- jumpingA[i] = 0;
- }
- enemies[i]._y += fallingSpeedA[i];
- while(level.ground.hitTest(enemies[i]._x,enemies[i]._y - (enemies[i]._height/2), true)){
- enemies[i]._y += 1;
- fallingSpeedA[i] = 0;
- }
- if(jumpingA[i] == 1 && touchingGroundA[i] == 1){
- jumpingA[i] = 0;
- }
- if(level.ground.hitTest(enemies[i]._x + (enemies[i]._width/2) + 1, enemies[i]._y, true)){
- rightWall_a[i] = 1;
- }else{
- rightWall_a[i] = 0;
- }
- if(level.ground.hitTest(enemies[i]._x - (enemies[i]._width/2) + 1, enemies[i]._y, true)){
- leftWall_a[i] = 1;
- }else{
- leftWall_a[i] = 0;
- }
- while(level.ground.hitTest(enemies[i]._x,enemies[i]._y + (enemies[i]._height/2) - 7, true)){
- enemies[i]._y -= 1;
- }
- while(level.ground.hitTest(enemies[i]._x + (enemies[i]._width/2), enemies[i]._y, true)){
- enemies[i]._x -= 1;
- }
- while(level.ground.hitTest(enemies[i]._x - (enemies[i]._width/2), enemies[i]._y, true)){
- enemies[i]._x += 1;
- }
- if(outside.hitTest(enemies[i]._x,enemies[i]._y,true)){
- removeEnemy(0);
- }
- }
- }
- pUps = new Array();
- pTypes = new Array();
- function pMoves(){
- for(i = pUps.length - 1; i >= 0; i--){
- pUps[i]._x -= xSpeed;
- pUps[i]._y -= ySpeed;
- while(level.ground.hitTest(pUps[i]._x, pUps[i]._y + (pUps[i]._height/2), true)){
- pUps[i]._y -= .2;
- }
- while(!level.ground.hitTest(pUps[i]._x, pUps[i]._y + (pUps[i]._height/2), true)){
- pUps[i]._y += .2;
- }
- if(player.hitTest(pUps[i])){
- if(pTypes[i] == 3){
- money += wave*10;
- }
- if(pTypes[i] == 1){
- health += 2;
- if(health >= 100){
- health = 100;
- }
- }
- if(pTypes[i] == 2){
- ammo[gunUsed] += 50;
- }
- updateStats();
- pCol.start();
- pCol.start();
- deadEnemies.push(pUps[i]);
- pUps[i].gotoAndStop(2);
- pUps.splice(i,1);
- pTypes.splice(i,1);
- }
- }
- }
- enemyWorth = new Array(10, 20, 30);
- function removeEnemy(ner){
- //enemies[i].removeMovieClip();
- kills += 1;
- score += enemyWorth[enemyType[i]-1];
- updateStats();
- var pType = randRange(1,3);
- if(pType == 1){
- power = attachMovie("p1", "p" + depth, depth);
- depth++;
- }
- if(pType == 2){
- power = attachMovie("p2", "p" + depth, depth);
- depth++;
- }
- if(pType == 3){
- power = attachMovie("p3", "p" + depth, depth);
- depth++;
- }
- power._x = enemies[i]._x;
- power._y = enemies[i]._y;
- power._xscale = power._yscale = 75;
- pUps.push(power);
- pTypes.push(pType);
- enemies[i].gotoAndStop(3);
- if(ner == 1){
- enemies[i].gotoAndStop(4);
- }
- enemies.splice(i,1);
- //Enemy vars
- fallingSpeedA.splice(i,1);
- delayA.splice(i,1);
- shootingA.splice(i,1);
- leftWall_a.splice(i,1);
- rightWall_a.splice(i,1);
- rightA.splice(i,1);
- touchingGroundA.splice(i,1);
- fallingA.splice(i,1);
- duckingA.splice(i,1);
- jumpingA.splice(i,1);
- enemyLives.splice(i,1);
- rightSpeed.splice(i,1);
- leftSpeed.splice(i,1);
- enemyType.splice(i,1);
- }
- deadEnemies = new Array();
- function deadEnemiesMovement(){
- for(i = deadEnemies.length -1; i >= 0; i--){
- deadEnemies[i]._x -= xSpeed;
- deadEnemies[i]._y -= ySpeed;
- if(!level.ground.hitTest(deadEnemies[i]._x, deadEnemies[i]._y + 30, true)){
- deadEnemies[i]._y += 10;
- }
- if(deadEnemies[i].q._currentframe == undefined){
- deadEnemies.splice(i,1);
- }
- }
- }
- function randRange(smallNum:Number, bigNum:Number):Number {
- return (Math.floor(Math.random()*(bigNum-smallNum+1))+smallNum);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement