Section 1
//gameEndlvl_37 (Piggles_Quest_fla.gameEndlvl_37)
package Piggles_Quest_fla {
import flash.display.*;
public dynamic class gameEndlvl_37 extends MovieClip {
public var hero:Hero;
}
}//package Piggles_Quest_fla
Section 2
//GameLevel1_24 (Piggles_Quest_fla.GameLevel1_24)
package Piggles_Quest_fla {
import flash.display.*;
public dynamic class GameLevel1_24 extends MovieClip {
public var hero:Hero;
public var enemy1:MovieClip;
public var enemy4:MovieClip;
public var enemy2:MovieClip;
public var enemy3:MovieClip;
}
}//package Piggles_Quest_fla
Section 3
//GameLevel2_26 (Piggles_Quest_fla.GameLevel2_26)
package Piggles_Quest_fla {
import flash.display.*;
public dynamic class GameLevel2_26 extends MovieClip {
public var hero:Hero;
public var enemy1:MovieClip;
public var enemy4:MovieClip;
public var enemy2:MovieClip;
public var enemy3:MovieClip;
}
}//package Piggles_Quest_fla
Section 4
//GameLevel3_29 (Piggles_Quest_fla.GameLevel3_29)
package Piggles_Quest_fla {
import flash.display.*;
public dynamic class GameLevel3_29 extends MovieClip {
public var hero:Hero;
public var enemy1:MovieClip;
public var enemy4:MovieClip;
public var enemy2:MovieClip;
public var enemy3:MovieClip;
}
}//package Piggles_Quest_fla
Section 5
//GameLevel4_30 (Piggles_Quest_fla.GameLevel4_30)
package Piggles_Quest_fla {
import flash.display.*;
public dynamic class GameLevel4_30 extends MovieClip {
public var hero:Hero;
public var enemy1:MovieClip;
public var enemy4:MovieClip;
public var enemy2:MovieClip;
public var enemy3:MovieClip;
}
}//package Piggles_Quest_fla
Section 6
//GameLevel5_4 (Piggles_Quest_fla.GameLevel5_4)
package Piggles_Quest_fla {
import flash.display.*;
public dynamic class GameLevel5_4 extends MovieClip {
public var hero:Hero;
public var enemy1:MovieClip;
}
}//package Piggles_Quest_fla
Section 7
//GameLevel6_32 (Piggles_Quest_fla.GameLevel6_32)
package Piggles_Quest_fla {
import flash.display.*;
public dynamic class GameLevel6_32 extends MovieClip {
public var hero:Hero;
public var enemy1:MovieClip;
public var enemy4:MovieClip;
public var enemy5:MovieClip;
public var enemy2:MovieClip;
public var enemy3:MovieClip;
}
}//package Piggles_Quest_fla
Section 8
//GameLevel7_31 (Piggles_Quest_fla.GameLevel7_31)
package Piggles_Quest_fla {
import flash.display.*;
public dynamic class GameLevel7_31 extends MovieClip {
public var hero:Hero;
public var enemy1:MovieClip;
public var enemy4:MovieClip;
public var enemy2:MovieClip;
public var enemy3:MovieClip;
}
}//package Piggles_Quest_fla
Section 9
//GameLevel8_35 (Piggles_Quest_fla.GameLevel8_35)
package Piggles_Quest_fla {
import flash.display.*;
public dynamic class GameLevel8_35 extends MovieClip {
public var hero:Hero;
}
}//package Piggles_Quest_fla
Section 10
//GameLevel9_36 (Piggles_Quest_fla.GameLevel9_36)
package Piggles_Quest_fla {
import flash.display.*;
public dynamic class GameLevel9_36 extends MovieClip {
public var hero:Hero;
public var enemy1:MovieClip;
public var enemy4:MovieClip;
public var enemy5:MovieClip;
public var enemy2:MovieClip;
public var enemy6:MovieClip;
public var enemy3:MovieClip;
}
}//package Piggles_Quest_fla
Section 11
//Arial (Arial)
package {
import flash.text.*;
public dynamic class Arial extends Font {
}
}//package
Section 12
//BasicButton (BasicButton)
package {
import flash.display.*;
public dynamic class BasicButton extends SimpleButton {
}
}//package
Section 13
//blip (blip)
package {
import flash.media.*;
public dynamic class blip extends Sound {
}
}//package
Section 14
//Chest (Chest)
package {
import flash.display.*;
public dynamic class Chest extends MovieClip {
public function Chest(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package
Section 15
//Coin (Coin)
package {
import flash.media.*;
public dynamic class Coin extends Sound {
}
}//package
Section 16
//Dialog (Dialog)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.media.*;
import flash.utils.*;
import adobe.utils.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.printing.*;
import flash.system.*;
import flash.ui.*;
import flash.xml.*;
public dynamic class Dialog extends MovieClip {
public var message:TextField;
public var okButton:BasicButton;
public function Dialog(){
addFrameScript(0, frame1);
}
function frame1(){
okButton.addEventListener(MouseEvent.CLICK, MovieClip(parent).clickDialogButton);
}
}
}//package
Section 17
//Door (Door)
package {
import flash.display.*;
public dynamic class Door extends MovieClip {
public function Door(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 18
//DoorCreak (DoorCreak)
package {
import flash.media.*;
public dynamic class DoorCreak extends Sound {
}
}//package
Section 19
//Enemy2 (Enemy2)
package {
import flash.display.*;
public dynamic class Enemy2 extends MovieClip {
}
}//package
Section 20
//Floor (Floor)
package {
import flash.display.*;
public dynamic class Floor extends MovieClip {
}
}//package
Section 21
//FloorEdgeL (FloorEdgeL)
package {
import flash.display.*;
public dynamic class FloorEdgeL extends MovieClip {
}
}//package
Section 22
//FloorEdgeR (FloorEdgeR)
package {
import flash.display.*;
public dynamic class FloorEdgeR extends MovieClip {
}
}//package
Section 23
//Floorsingle (Floorsingle)
package {
import flash.display.*;
public dynamic class Floorsingle extends MovieClip {
}
}//package
Section 24
//GetDamage (GetDamage)
package {
import flash.media.*;
public dynamic class GetDamage extends Sound {
}
}//package
Section 25
//Hero (Hero)
package {
import flash.display.*;
public dynamic class Hero extends MovieClip {
public function Hero(){
addFrameScript(12, frame13, 32, frame33);
}
function frame13(){
gotoAndStop("walk");
}
function frame33(){
stop();
}
}
}//package
Section 26
//InvWall (InvWall)
package {
import flash.display.*;
public dynamic class InvWall extends MovieClip {
}
}//package
Section 27
//Key (Key)
package {
import flash.display.*;
public dynamic class Key extends MovieClip {
}
}//package
Section 28
//MainMenuLoop (MainMenuLoop)
package {
import flash.media.*;
public dynamic class MainMenuLoop extends Sound {
}
}//package
Section 29
//Music (Music)
package {
import flash.media.*;
public dynamic class Music extends Sound {
}
}//package
Section 30
//pins (pins)
package {
import flash.display.*;
public dynamic class pins extends MovieClip {
}
}//package
Section 31
//PlatformGame_vanmij (PlatformGame_vanmij)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.media.*;
import flash.utils.*;
public class PlatformGame_vanmij extends MovieClip {
private var portalSound:PortalSound;
private var endMusic:Victory;
public var backToMenu2:BasicButton;
private var music:Music;
private var enemies:Array;
public var myWebLink:TextField;
public var startButton:BasicButton;
public var backToMenu:BasicButton;
private var gotkey:Boolean;// = false
private var getDamage:GetDamage;
public var creditsButton:BasicButton;
private var soundBounce:blip;
private var lastTime:Number;// = 0
public var levelDisplay:TextField;
private var playerLives:int;
private var gameMode:String;// = "start"
private var gameLevel:int;
public var myFormat:TextFormat;
public var gamelevel:MovieClip;
private var playerObjects:Array;
public var progressText:TextField;
private var coinSound:Coin;
private var fixedObjects:Array;
public var myStyleSheet:StyleSheet;
private var musicChannel:SoundChannel;
private var musicLoops:Number;// = 999
private var doorCreak:DoorCreak;
private var mainMenuLoop:MainMenuLoop;
private var musicChannelMenu:SoundChannel;
public var invenKey:Key;
public var livesDisplay:TextField;
private var gameScore:int;
public var scoreDisplay:TextField;
private var otherObjects:Array;
private var musicChannelEnding:SoundChannel;
public var HelpButton:BasicButton;
private var hero:Object;
static const edgeDistance:Number = 200;
static const gravity:Number = 0.002;
public function PlatformGame_vanmij(){
gameMode = "start";
lastTime = 0;
gotkey = false;
soundBounce = new blip();
coinSound = new Coin();
doorCreak = new DoorCreak();
getDamage = new GetDamage();
portalSound = new PortalSound();
music = new Music();
musicLoops = 999;
endMusic = new Victory();
mainMenuLoop = new MainMenuLoop();
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10, 10, frame11, 11, frame12, 12, frame13, 13, frame14, 14, frame15, 15, frame16, 16, frame17, 17, frame18, 18, frame19, 19, frame20, 20, frame21, 21, frame22, 22, frame23, 23, frame24, 30, frame31);
}
public function showLives(){
livesDisplay.text = String(playerLives);
}
public function heroDie(){
var _local1:Dialog;
getDamage.play();
_local1 = new Dialog();
_local1.x = 175;
_local1.y = 100;
addChild(_local1);
if (playerLives == 0){
gameMode = "gameover";
_local1.message.text = "Game Over!";
} else {
gameMode = "dead";
_local1.message.text = "You got killed Lives - 1";
playerLives--;
};
hero.mc.gotoAndPlay("die");
}
public function getObject(_arg1:int){
var _local2:PointBurst;
if ((otherObjects[_arg1] is pins)){
heroDie();
};
if ((otherObjects[_arg1] is portal)){
hero.mc.x = hero.startx;
hero.mc.y = (hero.starty - 280);
portalSound.play();
};
if ((otherObjects[_arg1] is Treasure)){
_local2 = new PointBurst(gamelevel, "$$$", otherObjects[_arg1].x, otherObjects[_arg1].y);
gamelevel.removeChild(otherObjects[_arg1]);
otherObjects.splice(_arg1, 1);
addScore(100);
coinSound.play();
} else {
if ((otherObjects[_arg1] is Key)){
_local2 = new PointBurst(gamelevel, "Key!", otherObjects[_arg1].x, otherObjects[_arg1].y);
gamelevel.removeChild(otherObjects[_arg1]);
otherObjects.splice(_arg1, 1);
gotkey = true;
coinSound.play();
invenKey.visible = true;
} else {
if ((otherObjects[_arg1] is Door)){
if (gotkey){
otherObjects[_arg1].gotoAndStop(2);
doorCreak.play();
levelDisplay.text = String(gameLevel);
gotkey = false;
invenKey.visible = false;
levelComplete();
};
} else {
if ((otherObjects[_arg1] is Chest)){
otherObjects[_arg1].gotoAndStop("open");
gameComplete();
};
};
};
};
}
public function addEnemies(){
var _local1:int;
var _local2:*;
enemies = new Array();
_local1 = 1;
while (true) {
if (gamelevel[("enemy" + _local1)] == null){
break;
};
_local2 = new Object();
_local2.mc = gamelevel[("enemy" + _local1)];
_local2.dx = 0;
_local2.dy = 0;
_local2.inAir = false;
_local2.direction = 1;
_local2.animstate = "stand";
_local2.walkAnimation = new Array(2, 3, 4, 5, 6, 7, 8);
_local2.animstep = 0;
_local2.jump = false;
_local2.bounce = false;
_local2.moveRight = true;
_local2.moveLeft = false;
_local2.jumpSpeed = 1;
_local2.walkSpeed = 0.08;
_local2.width = 30;
_local2.height = 30;
enemies.push(_local2);
_local1++;
};
}
function frame14(){
gotoAndStop(3);
musicChannel.stop();
}
function frame16(){
gotoAndStop(3);
musicChannel.stop();
}
public function moveCharacter(_arg1:Object, _arg2:Number){
var _local3:Number;
var _local4:*;
var _local5:String;
var _local6:int;
var _local7:Number;
var _local8:int;
var _local9:Number;
if (_arg2 < 1){
return;
};
_local3 = ((_arg1.dy * _arg2) + (_arg2 * gravity));
if (_local3 > 15){
_local3 = 15;
};
_arg1.dy = (_arg1.dy + (_arg2 * gravity));
_local4 = 0;
_local5 = "stand";
_local6 = _arg1.direction;
if (_arg1.moveLeft){
_local4 = (-(_arg1.walkSpeed) * _arg2);
_local5 = "walk";
_local6 = -1;
} else {
if (_arg1.moveRight){
_local4 = (_arg1.walkSpeed * _arg2);
_local5 = "walk";
_local6 = 1;
};
};
if (_arg1.jump){
_arg1.jump = false;
_arg1.dy = -(_arg1.jumpSpeed);
_local3 = -(_arg1.jumpSpeed);
_local5 = "jump";
};
if (_arg1.bounce){
_arg1.bounce = false;
_arg1.dy = -((0.6 * _arg1.jumpSpeed));
_local3 = -((0.6 * _arg1.jumpSpeed));
_local5 = "jump";
};
_arg1.hitWallRight = false;
_arg1.hitWallLeft = false;
_arg1.inAir = true;
_local7 = (_arg1.mc.y + _local3);
_local8 = 0;
while (_local8 < fixedObjects.length) {
if (((((_arg1.mc.x + (_arg1.width / 2)) > fixedObjects[_local8].leftside)) && (((_arg1.mc.x - (_arg1.width / 2)) < fixedObjects[_local8].rightside)))){
if ((((_arg1.mc.y <= fixedObjects[_local8].topside)) && ((_local7 > fixedObjects[_local8].topside)))){
_local7 = fixedObjects[_local8].topside;
_arg1.dy = 0;
_arg1.inAir = false;
break;
};
};
_local8++;
};
_local9 = (_arg1.mc.x + _local4);
_local8 = 0;
while (_local8 < fixedObjects.length) {
if ((((_local7 > fixedObjects[_local8].topside)) && (((_local7 - _arg1.height) < fixedObjects[_local8].bottomside)))){
if (((((_arg1.mc.x - (_arg1.width / 2)) >= fixedObjects[_local8].rightside)) && (((_local9 - (_arg1.width / 2)) <= fixedObjects[_local8].rightside)))){
_local9 = (fixedObjects[_local8].rightside + (_arg1.width / 2));
_arg1.hitWallLeft = true;
break;
};
if (((((_arg1.mc.x + (_arg1.width / 2)) <= fixedObjects[_local8].leftside)) && (((_local9 + (_arg1.width / 2)) >= fixedObjects[_local8].leftside)))){
_local9 = (fixedObjects[_local8].leftside - (_arg1.width / 2));
_arg1.hitWallRight = true;
break;
};
};
_local8++;
};
_arg1.mc.x = _local9;
_arg1.mc.y = _local7;
if (_arg1.inAir){
_local5 = "jump";
};
_arg1.animstate = _local5;
if (_arg1.animstate == "walk"){
_arg1.animstep = (_arg1.animstep + (_arg2 / 60));
if (_arg1.animstep > _arg1.walkAnimation.length){
_arg1.animstep = 0;
};
_arg1.mc.gotoAndStop(_arg1.walkAnimation[Math.floor(_arg1.animstep)]);
} else {
_arg1.mc.gotoAndStop(_arg1.animstate);
};
if (_local6 != _arg1.direction){
_arg1.direction = _local6;
_arg1.mc.scaleX = _arg1.direction;
};
}
function frame12(){
gotoAndStop(3);
musicChannel.stop();
}
function frame15(){
stop();
startGameLevel();
}
public function MainMenu2(_arg1:MouseEvent){
gotoAndStop("mainmenu");
removeChild(myWebLink);
}
function frame18(){
gotoAndStop(3);
musicChannel.stop();
}
function frame3(){
gotoAndStop("mainmenu");
musicChannelMenu = mainMenuLoop.play(0, musicLoops);
}
function frame4(){
stop();
startButton.addEventListener(MouseEvent.CLICK, clickStart);
stop();
HelpButton.addEventListener(MouseEvent.CLICK, gotoHelp);
creditsButton.addEventListener(MouseEvent.CLICK, gotocredits);
}
function frame6(){
gotoAndStop(3);
musicChannel.stop();
}
function frame7(){
stop();
startGameLevel();
}
function frame1(){
stop();
addEventListener(Event.ENTER_FRAME, loadProgress);
}
function frame19(){
stop();
startGameLevel();
}
function frame10(){
gotoAndStop(3);
musicChannel.stop();
}
public function clickDialogButton(_arg1:MouseEvent){
removeChild(MovieClip(_arg1.currentTarget.parent));
if (gameMode == "dead"){
showLives();
hero.mc.x = hero.startx;
hero.mc.y = hero.starty;
gameMode = "play";
} else {
if (gameMode == "gameover"){
musicChannel.stop();
cleanUp();
gotoAndStop(2);
} else {
if (gameMode == "Completed"){
musicChannelEnding.stop();
cleanUp();
gotoAndStop(2);
} else {
if (gameMode == "done"){
gotoAndStop((currentFrame + 2));
cleanUp();
};
};
};
};
stage.focus = stage;
}
public function startGameLevel(){
if (gameLevel > 9){
musicChannel.stop();
musicChannelEnding = endMusic.play();
};
gameLevel = (gameLevel + 1);
createHero();
addEnemies();
examineLevel();
this.addEventListener(Event.ENTER_FRAME, gameLoop);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownFunction);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpFunction);
gameMode = "play";
addScore(0);
showLives();
}
public function addScore(_arg1:int){
gameScore = (gameScore + _arg1);
scoreDisplay.text = String(gameScore);
}
function frame2(){
gotoAndStop(3);
}
function frame17(){
stop();
startGameLevel();
}
function frame24(){
stop();
backToMenu.addEventListener(MouseEvent.CLICK, MainMenu);
}
function frame9(){
stop();
startGameLevel();
}
function frame13(){
stop();
startGameLevel();
}
function frame5(){
stop();
startPlatformGame();
startGameLevel();
}
function frame21(){
stop();
startGameLevel();
}
function frame11(){
stop();
startGameLevel();
}
public function startPlatformGame(){
musicChannel = music.play(0, musicLoops);
musicChannelMenu.stop();
playerObjects = new Array();
gameLevel = 1;
gameScore = 0;
gameMode = "play";
playerLives = 5;
levelDisplay.text = String(gameLevel);
trace("!");
}
function frame22(){
gotoAndStop(3);
musicChannel.stop();
}
function frame23(){
stop();
startGameLevel();
}
function frame8(){
gotoAndStop(3);
musicChannel.stop();
}
public function keyDownFunction(_arg1:KeyboardEvent){
if ((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 65)))){
hero.moveLeft = true;
} else {
if ((((_arg1.keyCode == 39)) || ((_arg1.keyCode == 68)))){
hero.moveRight = true;
} else {
if ((((_arg1.keyCode == 38)) || ((_arg1.keyCode == 87)))){
if (!hero.inAir){
hero.jump = true;
};
};
};
};
}
function frame31(){
stop();
backToMenu2.addEventListener(MouseEvent.CLICK, MainMenu2);
myFormat = new TextFormat();
myFormat.font = "Arial";
myFormat.size = 21;
myFormat.bold = false;
myFormat.italic = true;
myStyleSheet = new StyleSheet();
myStyleSheet.setStyle("A", {textDecoration:"underline", color:"#000000"});
myWebLink = new TextField();
myWebLink.defaultTextFormat = myFormat;
myWebLink.styleSheet = myStyleSheet;
myWebLink.selectable = false;
myWebLink.htmlText = "<A HREF='http://www.daa-studios.com'>DAA-Studios.com</A>";
myWebLink.x = 122;
myWebLink.y = 129;
myWebLink.width = 400;
myWebLink.height = 30;
addChild(myWebLink);
}
public function examineLevel(){
var _local1:int;
var _local2:*;
var _local3:Object;
fixedObjects = new Array();
otherObjects = new Array();
_local1 = 0;
while (_local1 < this.gamelevel.numChildren) {
_local2 = this.gamelevel.getChildAt(_local1);
if ((((((((((((_local2 is Floor)) || ((_local2 is Wall)))) || ((_local2 is WallSingle)))) || ((_local2 is Floorsingle)))) || ((_local2 is FloorEdgeR)))) || ((_local2 is FloorEdgeL)))){
_local3 = new Object();
_local3.mc = _local2;
_local3.leftside = _local2.x;
_local3.rightside = (_local2.x + _local2.width);
_local3.topside = _local2.y;
_local3.bottomside = (_local2.y + _local2.height);
fixedObjects.push(_local3);
} else {
if ((((((((((((((_local2 is Treasure)) || ((_local2 is InvWall)))) || ((_local2 is Key)))) || ((_local2 is pins)))) || ((_local2 is portal)))) || ((_local2 is Door)))) || ((_local2 is Chest)))){
otherObjects.push(_local2);
};
};
_local1++;
};
}
function frame20(){
gotoAndStop(3);
musicChannel.stop();
}
public function checkCollisions(){
var _local1:int;
_local1 = (enemies.length - 1);
while (_local1 >= 0) {
if (hero.mc.hitTestObject(enemies[_local1].mc)){
if (((hero.inAir) && ((hero.dy > 0)))){
soundBounce.play();
enemyDie(_local1);
hero.bounce = true;
} else {
heroDie();
};
};
_local1--;
};
_local1 = (otherObjects.length - 1);
while (_local1 >= 0) {
if (hero.mc.hitTestObject(otherObjects[_local1])){
getObject(_local1);
};
_local1--;
};
}
public function cleanUp(){
removeChild(gamelevel);
this.removeEventListener(Event.ENTER_FRAME, gameLoop);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownFunction);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpFunction);
}
public function levelComplete(){
var _local1:Dialog;
gameMode = "done";
_local1 = new Dialog();
_local1.x = 175;
_local1.y = 100;
addChild(_local1);
_local1.message.text = "Level Complete!";
}
public function MainMenu(_arg1:MouseEvent){
gotoAndStop("mainmenu");
}
public function moveEnemies(_arg1:int){
var _local2:int;
_local2 = 0;
while (_local2 < enemies.length) {
moveCharacter(enemies[_local2], _arg1);
if (enemies[_local2].hitWallRight){
enemies[_local2].moveLeft = true;
enemies[_local2].moveRight = false;
} else {
if (enemies[_local2].hitWallLeft){
enemies[_local2].moveLeft = false;
enemies[_local2].moveRight = true;
};
};
_local2++;
};
}
public function createHero(){
hero = new Object();
hero.mc = gamelevel.hero;
hero.dx = 0;
hero.dy = 0;
hero.inAir = false;
hero.direction = 1;
hero.animstate = "stand";
hero.walkAnimation = new Array(2, 3, 4, 5, 6, 7, 8);
hero.animstep = 0;
hero.jump = false;
hero.bounce = false;
hero.moveLeft = false;
hero.moveRight = false;
hero.jumpSpeed = 0.62;
hero.walkSpeed = 0.15;
hero.width = 20;
hero.height = 40;
hero.startx = hero.mc.x;
hero.starty = hero.mc.y;
invenKey.visible = false;
}
public function loadProgress(_arg1:Event){
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:int;
_local2 = this.root.loaderInfo.bytesLoaded;
_local3 = this.root.loaderInfo.bytesTotal;
_local4 = (_local2 / 0x0400);
_local5 = (_local3 / 0x0400);
progressText.text = (((("Loading: " + _local4) + "K/") + _local5) + "K");
if (_local2 >= _local3){
removeEventListener(Event.ENTER_FRAME, loadProgress);
gotoAndStop(2);
};
}
public function gotoHelp(_arg1:MouseEvent){
gotoAndStop("Help");
}
public function keyUpFunction(_arg1:KeyboardEvent){
if ((((_arg1.keyCode == 37)) || ((_arg1.keyCode == 65)))){
hero.moveLeft = false;
} else {
if ((((_arg1.keyCode == 39)) || ((_arg1.keyCode == 68)))){
hero.moveRight = false;
};
};
}
public function gameComplete(){
var _local1:Dialog;
gameMode = "Completed";
_local1 = new Dialog();
_local1.x = 175;
_local1.y = 100;
addChild(_local1);
_local1.message.text = ("Quest Complete! You Scored " + String(gameScore));
}
public function gameLoop(_arg1:Event){
var _local2:int;
if (lastTime == 0){
lastTime = getTimer();
};
_local2 = (getTimer() - lastTime);
lastTime = (lastTime + _local2);
if (gameMode == "play"){
moveCharacter(hero, _local2);
moveEnemies(_local2);
checkCollisions();
scrollWithHero();
};
}
public function clickStart(_arg1:MouseEvent){
gotoAndStop("play");
}
public function scrollWithHero(){
var _local1:Number;
var _local2:Number;
var _local3:Number;
_local1 = (gamelevel.x + hero.mc.x);
_local2 = (stage.stageWidth - edgeDistance);
_local3 = edgeDistance;
if (_local1 > _local2){
gamelevel.x = (gamelevel.x - (_local1 - _local2));
if (gamelevel.x < -((gamelevel.width - stage.stageWidth))){
gamelevel.x = -((gamelevel.width - stage.stageWidth));
};
};
if (_local1 < _local3){
gamelevel.x = (gamelevel.x + (_local3 - _local1));
if (gamelevel.x > 0){
gamelevel.x = 0;
};
};
}
public function gotocredits(_arg1:MouseEvent){
gotoAndStop("credits");
}
public function enemyDie(_arg1:int){
var _local2:PointBurst;
_local2 = new PointBurst(gamelevel, "Blip!", enemies[_arg1].mc.x, (enemies[_arg1].mc.y - 20));
gamelevel.removeChild(enemies[_arg1].mc);
enemies.splice(_arg1, 1);
}
}
}//package
Section 32
//PointBurst (PointBurst)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
import flash.utils.*;
public class PointBurst extends Sprite {
private var burstSprite:Sprite;
private var animTimer:Timer;
private var parentMC:MovieClip;
private var tField:TextField;
static const animStepTime:int = 50;
static const fontSize:int = 20;
static const fontFace:String = "Arial";
static const fontBold:Boolean = true;
static const animSteps:int = 10;
static const startScale:Number = 0;
static const fontColor:Number = 0xFFFFFF;
static const endScale:Number = 2;
public function PointBurst(_arg1:MovieClip, _arg2:Object, _arg3, _arg4:Number){
var _local5:TextFormat;
super();
_local5 = new TextFormat();
_local5.font = fontFace;
_local5.size = fontSize;
_local5.bold = fontBold;
_local5.color = fontColor;
_local5.align = "center";
tField = new TextField();
tField.embedFonts = true;
tField.selectable = false;
tField.defaultTextFormat = _local5;
tField.autoSize = TextFieldAutoSize.CENTER;
tField.text = String(_arg2);
tField.x = -((tField.width / 2));
tField.y = -((tField.height / 2));
burstSprite = new Sprite();
burstSprite.x = _arg3;
burstSprite.y = _arg4;
burstSprite.scaleX = startScale;
burstSprite.scaleY = startScale;
burstSprite.alpha = 0;
burstSprite.addChild(tField);
parentMC = _arg1;
parentMC.addChild(burstSprite);
animTimer = new Timer(animStepTime, animSteps);
animTimer.addEventListener(TimerEvent.TIMER, rescaleBurst);
animTimer.addEventListener(TimerEvent.TIMER_COMPLETE, removeBurst);
animTimer.start();
}
public function removeBurst(_arg1:TimerEvent){
burstSprite.removeChild(tField);
parentMC.removeChild(burstSprite);
tField = null;
burstSprite = null;
delete ??getglobalscope
[this];
}
public function rescaleBurst(_arg1:TimerEvent){
var _local2:Number;
_local2 = (_arg1.target.currentCount / animSteps);
burstSprite.scaleX = (((1 - _local2) * startScale) + (_local2 * endScale));
burstSprite.scaleY = (((1 - _local2) * startScale) + (_local2 * endScale));
burstSprite.alpha = (1 - _local2);
}
}
}//package
Section 33
//portal (portal)
package {
import flash.display.*;
public dynamic class portal extends MovieClip {
}
}//package
Section 34
//PortalSound (PortalSound)
package {
import flash.media.*;
public dynamic class PortalSound extends Sound {
}
}//package
Section 35
//StartButton (StartButton)
package {
import flash.display.*;
public dynamic class StartButton extends SimpleButton {
}
}//package
Section 36
//Treasure (Treasure)
package {
import flash.display.*;
public dynamic class Treasure extends MovieClip {
}
}//package
Section 37
//Wall (Wall)
package {
import flash.display.*;
public dynamic class Wall extends MovieClip {
}
}//package
Section 38
//WallSingle (WallSingle)
package {
import flash.display.*;
public dynamic class WallSingle extends MovieClip {
}
}//package
Section 39
//Victory (Victory)
package {
import flash.media.*;
public dynamic class Victory extends Sound {
}
}//package