Skip to content

Instantly share code, notes, and snippets.

@jtojnar
Created February 15, 2013 21:05
Show Gist options
  • Save jtojnar/4963533 to your computer and use it in GitHub Desktop.
Save jtojnar/4963533 to your computer and use it in GitHub Desktop.
Generování mapy
http://media1.clubpenguin.com/play/v2/games/jetpack/JetpackAdventures.swf
http://media1.clubpenguin.com/play/v2/games/jetpack/lang/en/title.swf
http://media1.clubpenguin.com/play/v2/games/jetpack/lang/en/cave.swf
http://media1.clubpenguin.com/play/v2/games/jetpack/lang/en/giftshop.swf
http://media1.clubpenguin.com/play/v2/games/jetpack/lang/en/landsign.swf
http://media1.clubpenguin.com/play/v2/games/jetpack/lang/en/nightclub.swf
http://media1.clubpenguin.com/play/v2/games/jetpack/lang/en/petshop.swf
http://media1.clubpenguin.com/play/v2/games/jetpack/lang/en/java.swf
// Action script...
// [onClipEvent of sprite 114 in frame 4]
onClipEvent (enterFrame) {
if (_parent._parent.cloudMoveX == true) {
this._x = this._x - _parent._parent.cloudSpeed;
} // end if
if (_parent._parent.cloudMoveY == true) {
this._y = this._y - _parent._parent.yMove * 0.500000;
} // end if
if (this._x <= -130) {
this._x = 1030;
} // end if
if (this._y < -100) {
this._y = 530;
}
else if (this._y > 550) {
this._y = -50;
} // end else if
}
// [onClipEvent of sprite 170 in frame 4]
onClipEvent (enterFrame) {
if (_parent._parent.cloudMoveX == true) {
this._x = this._x - _parent._parent.cloudSpeed;
} // end if
if (_parent._parent.cloudMoveY == true) {
this._y = this._y - _parent._parent.yMove * 0.500000;
} // end if
if (this._x <= -130) {
this._x = 875;
} // end if
if (this._y < -100) {
this._y = 530;
}
else if (this._y > 550) {
this._y = -50;
} // end else if
}
// [onClipEvent of sprite 180 in frame 56]
onClipEvent (load) {
this.gotoAndStop(_parent.levelNum);
}
// [onClipEvent of sprite 181 in frame 56]
onClipEvent (load) {
if (_parent.myGame.clouds == true) {
this.gotoAndStop(1);
}
else {
this.gotoAndStop(2);
} // end else if
}
// [onClipEvent of sprite 220 in frame 108]
onClipEvent (load) {
gotoAndPlay(41);
}
// [onClipEvent of sprite 220 in frame 108]
onClipEvent (load) {
gotoAndPlay(21);
}
// [onClipEvent of sprite 220 in frame 108]
onClipEvent (load) {
gotoAndPlay(4);
}
// [onClipEvent of sprite 220 in frame 108]
onClipEvent (load) {
gotoAndPlay(27);
}
// [onClipEvent of sprite 220 in frame 108]
onClipEvent (load) {
gotoAndPlay(30);
}
// [onClipEvent of sprite 220 in frame 108]
onClipEvent (load) {
gotoAndPlay(19);
}
// [onClipEvent of sprite 220 in frame 108]
onClipEvent (load) {
gotoAndPlay(52);
}
// [onClipEvent of sprite 220 in frame 108]
onClipEvent (load) {
gotoAndPlay(38);
}
// [onClipEvent of sprite 220 in frame 108]
onClipEvent (load) {
gotoAndPlay(16);
}
// [onClipEvent of sprite 220 in frame 108]
onClipEvent (load) {
gotoAndPlay(37);
}
// [onClipEvent of sprite 220 in frame 108]
onClipEvent (load) {
gotoAndPlay(22);
}
// [onClipEvent of sprite 220 in frame 108]
onClipEvent (load) {
gotoAndPlay(10);
}
// [onClipEvent of sprite 595 in frame 119]
onClipEvent (load) {
if (_parent.gameOver == 1) {
this.gotoAndStop(1);
} // end if
if (_parent.gameOver == 2) {
this.gotoAndStop(2);
} // end if
if (_parent.gameOver == 3) {
this.gotoAndStop(3);
} // end if
if (_parent.gameOver == 4) {
this.gotoAndStop(4);
} // end if
if (_parent.gameOver == 5) {
this.gotoAndStop(5);
} // end if
if (_parent.gameOver == 6) {
this.gotoAndStop(6);
} // end if
if (_parent.gameOver == 7) {
this.gotoAndStop(7);
} // end if
if (_parent.gameOver == 8) {
this.gotoAndStop(8);
} // end if
if (_parent.gameOver == 9) {
this.gotoAndStop(9);
} // end if
}
// [Action in Frame 1]
stop ();
com.clubpenguin.security.Security.doSecurityCheck(this._url, this._parent);
var listener = new Object();
var opcodeJournal = new com.disney.games.jetpack.OpcodeJournal();
listener.onLoadComplete = function () {
com.clubpenguin.util.Loader.removeEventListener(listener);
var _loc2 = _global.getCurrentShell();
_loc2.hideLoading();
_loc2.startGameMusic();
if (_loc2.getMyPlayerId() != undefined) {
opcodeJournal.init(_loc2.getMyPlayerId());
}
else {
opcodeJournal.init(-1);
} // end else if
_global.opcodeJ = opcodeJournal;
var _loc3 = com.clubpenguin.util.LocaleText.getGameDirectory();
var _loc4 = "lang/" + com.clubpenguin.util.LocaleText.getLocale(com.clubpenguin.util.LocaleText.getLocaleID()) + "/";
var _loc7 = new MovieClipLoader();
_loc7.loadClip(_loc3 + _loc4 + "title.swf", titleScreen.localeTitle);
var _loc6 = new MovieClipLoader();
_loc6.loadClip(_loc3 + _loc4 + "java.swf", titleScreen.java1);
var _loc5 = new MovieClipLoader();
_loc5.loadClip(_loc3 + _loc4 + "java.swf", titleScreen.java2);
gotoAndStop(2);
};
com.clubpenguin.util.Loader.addEventListener(listener);
if (_root.myPlayer != undefined) {
myPath = _root.myMediaPath + "games/jetpack/";
}
else {
myPath = "";
} // end else if
coins = 0;
lives = 2;
fuelCollectedTotal = 0;
roomNum = levelNum = 1;
earnedCoinStamp = false;
this.createEmptyMovieClip("borderSwap", 10);
this.createEmptyMovieClip("interFaceSwap", 5);
border_mc.swapDepths(borderSwap);
interFace_mc.swapDepths(interFaceSwap);
level1 = "1_1";
level2 = "2_3";
level3 = "3_3";
level4 = "4_1";
level5 = "5_1";
fuelCollectedTotal = 0;
coinsCollected = 0;
livesCollected = 0;
puffleCoins = 0;
// [Action in Frame 2]
buttonStart.text = com.clubpenguin.util.LocaleText.getText("menu_start").toUpperCase();
buttonInstructions.text = com.clubpenguin.util.LocaleText.getText("menu_instructions").toUpperCase();
key_btn.onRelease = function () {
gotoAndStop("preload");
opcodeJournal.startGame();
};
instruct_btn.onRelease = function () {
instructions_mc.nextFrame();
opcodeJournal.sendStartCode(1);
opcodeJournal.sendSelectedCode(1);
};
stop ();
// [Action in Frame 4]
stopAllSounds ();
this.createEmptyMovieClip("game_mc", 1);
myGame = new Object();
myGame.mc = game_mc;
_root.myGame = myGame;
var fileNum = this["level" + levelNum];
myGame.mc.loadMovie(myPath + "level" + levelNum + "/level" + fileNum + ".swf");
loadingMC.levelText.text = "" + levelNum;
gotoAndPlay(checkload1);
// [Action in Frame 9]
loaded = myGame.mc.getBytesLoaded();
total = myGame.mc.getBytesTotal();
if (loaded > 0) {
if (loaded >= total) {
gotoAndPlay(levelLoaded);
} // end if
} // end if
loadingMC.levelText.text = "" + levelNum;
// [Action in Frame 13]
gotoAndPlay(checkload1);
// [Action in Frame 34]
loadingMC.levelText.text = "" + levelNum;
// [Action in Frame 56]
function buildMap(map) {
var _loc2 = 0;
for (var _loc4 in myGame.mc.myMap) {
for (var _loc3 in myGame.mc.myMap[_loc4]) {
var _loc1 = new Object();
_loc1.id = _loc2++;
_loc1.link = myGame.mc.myMap[_loc4][_loc3];
_loc1.isActive = false;
_loc1.mc = undefined;
myGame.mc.myMap[_loc4][_loc3] = _loc1;
} // end of for...in
} // end of for...in
myGame.mapWidth = myGame.mc.myMap[0].length;
myGame.mapHeight = myGame.mc.myMap.length;
myGame.mapx = myGame.mapWidth * myGame.tileSize;
myGame.mapy = myGame.mapHeight * myGame.tileSize;
myGame.xBountry = myGame.mapx - myGame.screenx;
myGame.yBountry = myGame.mapy - myGame.screeny;
myGame.tilelist = new Array();
myGame.mc.createEmptyMovieClip("tiles_mc", 1);
var _loc6 = myGame.playerx - myGame.halfScreenx;
var _loc5 = myGame.playery - myGame.halfScreeny;
updateMap(_loc6, _loc5);
} // End of the function
function updateMap(x, y) {
if (x > myGame.xBountry) {
x = myGame.xBountry;
cloudMoveX = false;
}
else if (x < 0) {
x = 0;
cloudMoveX = false;
}
else {
cloudMoveX = true;
} // end else if
if (y > myGame.yBountry) {
cloudMoveY = false;
y = myGame.yBountry;
}
else if (y < 0) {
y = 0;
cloudMoveY = false;
}
else {
cloudMoveY = true;
} // end else if
myGame.mc._x = -x;
myGame.mc._y = -y;
var _loc5 = int(x / myGame.tileSize);
var _loc6 = int(y / myGame.tileSize);
for (var _loc8 in myGame.tilelist) {
myGame.tilelist[_loc8].isActive = false;
} // end of for...in
for (var _loc2 = _loc6; _loc2 < _loc6 + myGame.visty + 1; ++_loc2) {
for (var _loc1 = _loc5; _loc1 < _loc5 + myGame.vistx; ++_loc1) {
myGame.mc.myMap[_loc2][_loc1].isActive = true;
if (myGame.mc.myMap[_loc2][_loc1].mc == undefined) {
var _loc4 = myGame.mc.myMap[_loc2][_loc1].id;
myGame.mc.tiles_mc.attachMovie("tile", "t_" + _loc2 + "_" + _loc1, _loc4 + 1);
var _loc3 = myGame.mc.tiles_mc["t_" + _loc2 + "_" + _loc1];
myGame.mc.myMap[_loc2][_loc1].mc = _loc3;
_loc3.gotoAndStop(myGame.mc.myMap[_loc2][_loc1].link);
_loc3._x = _loc1 * myGame.tileSize;
_loc3._y = _loc2 * myGame.tileSize;
myGame.tilelist.push(myGame.mc.myMap[_loc2][_loc1]);
} // end if
} // end of for
} // end of for
var _loc7 = new Array();
for (var _loc8 in myGame.tilelist) {
if (myGame.tilelist[_loc8].isActive) {
_loc7.push(myGame.tilelist[_loc8]);
continue;
} // end if
myGame.tilelist[_loc8].mc.removeMovieClip();
myGame.tilelist[_loc8].mc = undefined;
} // end of for...in
myGame.tilelist = _loc7;
} // End of the function
function buildMap2(map) {
var _loc2 = 0;
for (var _loc4 in myGame.mc.myMap2) {
for (var _loc3 in myGame.mc.myMap2[_loc4]) {
var _loc1 = new Object();
_loc1.idH = _loc2++;
_loc1.link = myGame.mc.myMap2[_loc4][_loc3];
_loc1.isActive = false;
_loc1.mcH = undefined;
myGame.mc.myMap2[_loc4][_loc3] = _loc1;
} // end of for...in
} // end of for...in
myGame.mapWidth2 = myGame.mc.myMap2[0].length;
myGame.mapHeight2 = myGame.mc.myMap2.length;
myGame.mapx2 = myGame.mapWidth2 * myGame.tileSize2;
myGame.mapy2 = myGame.mapHeight2 * myGame.tileSize2;
myGame.xBountry2 = myGame.mapx2 - myGame.screenx;
myGame.yBountry2 = myGame.mapy2 - myGame.screeny;
myGame.tilelist2 = new Array();
myGame.mc.createEmptyMovieClip("hazards_mc", 2);
var _loc6 = myGame.playerx - myGame.halfScreenx;
var _loc5 = myGame.playery - myGame.halfScreeny;
updateMap2(_loc6, _loc5);
} // End of the function
function updateMap2(x, y) {
if (x > myGame.xBountry2) {
x = myGame.xBountry2;
}
else if (x < 0) {
x = 0;
} // end else if
if (y > myGame.yBountry2) {
y = myGame.yBountry2;
}
else if (y < 0) {
y = 0;
} // end else if
myGame.mc._x = -x;
myGame.mc._y = -y;
var _loc4 = int(x / myGame.tileSize2);
var _loc6 = int(y / myGame.tileSize2);
if (_loc4 != currentX2 || _loc6 != currentY2) {
for (var _loc8 in myGame.tilelist2) {
myGame.tilelist2[_loc8].isActive = false;
} // end of for...in
for (var _loc2 = _loc6; _loc2 < _loc6 + myGame.visty2; ++_loc2) {
for (var _loc1 = _loc4; _loc1 < _loc4 + myGame.vistx2; ++_loc1) {
currentY2 = _loc6;
currentX2 = _loc4;
myGame.mc.myMap2[_loc2][_loc1].isActive = true;
if (myGame.mc.myMap2[_loc2][_loc1].mcH == undefined) {
var _loc5 = myGame.mc.myMap2[_loc2][_loc1].idH;
myGame.mc.hazards_mc.attachMovie("hazard", "t_" + _loc2 + "_" + _loc1, _loc5 + 1);
var _loc3 = myGame.mc.hazards_mc["t_" + _loc2 + "_" + _loc1];
myGame.mc.myMap2[_loc2][_loc1].mcH = _loc3;
_loc3.gotoAndStop(myGame.mc.myMap2[_loc2][_loc1].link);
_loc3._x = _loc1 * myGame.tileSize2;
_loc3._y = _loc2 * myGame.tileSize2;
myGame.tilelist2.push(myGame.mc.myMap2[_loc2][_loc1]);
} // end if
} // end of for
} // end of for
var _loc7 = new Array();
for (var _loc8 in myGame.tilelist2) {
if (myGame.tilelist2[_loc8].isActive) {
_loc7.push(myGame.tilelist2[_loc8]);
continue;
} // end if
myGame.tilelist2[_loc8].mcH.removeMovieClip();
myGame.tilelist2[_loc8].mcH = undefined;
} // end of for...in
myGame.tilelist2 = _loc7;
} // end if
} // End of the function
function movePlayer(changex, changey) {
var _loc2 = myGame.mc.player_mc._x - myGame.halfScreenx;
var _loc1 = myGame.mc.player_mc._y - myGame.halfScreeny;
updateMap(_loc2, _loc1);
updateMap2(_loc2, _loc1);
} // End of the function
function puffleUpdate() {
currentTime = getTimer();
dt_global = currentTime - puffle_lastUpdate;
dt_vector = dt_vector + dt_global;
dt_art = dt_art + dt_global;
puffle_lastUpdate = currentTime;
movePuffle();
puffleCollectSomething();
checkPuffleCollisions();
updatePuffleVector();
updatePuffleArt();
} // End of the function
function updatePuffleArt() {
if (!myGame.mc.puffle_mc.isAnimating()) {
if (dt_art >= updateInterval_art) {
dt_art = 0;
if (fuelTank <= 30) {
puffle_anim = "concerned";
puffle_tileSearch.x = 6;
puffle_tileSearch.y = 6;
myGame.mc.puffle_mc.setAnimate(true);
myGame.mc.puffle_mc.gotoAndPlay("concerned");
myGame.mc.puffle_mc.puffle.gotoAndPlay("moving");
}
else if (!puffleTooFarAway() && random(3) < 0.010000) {
puffle_anim = "bubbling";
myGame.mc.puffle_mc.setAnimate(true);
myGame.mc.puffle_mc.gotoAndPlay("bubbling");
}
else {
puffle_anim = "move" + Math.ceil(random(9) + 1);
myGame.mc.puffle_mc.setAnimate(true);
myGame.mc.puffle_mc.gotoAndPlay(puffle_anim);
if (puffle_anim == "move5") {
puffle_vector.dx = 0;
puffle_vector.dy = 0;
puffle_vector.scalar = 0;
puffle_acceleration.x = 1.500000;
puffle_acceleration.y = 1.500000;
current_step = 0;
} // end else if
} // end else if
}
else if (fuelTank > 30) {
puffle_tileSearch.x = 3;
puffle_tileSearch.y = 3;
myGame.mc.puffle_mc.gotoAndPlay("normal");
if (puffle_vector.dx < 0) {
myGame.mc.puffle_mc.puffle.gotoAndPlay("left");
}
else {
myGame.mc.puffle_mc.puffle.gotoAndPlay("right");
} // end if
} // end else if
} // end else if
} // End of the function
function updatePuffleVector() {
if (dt_vector < updateInterval_vector) {
return;
} // end if
dt_vector = 0;
if (puffle_anim == "move5") {
return;
}
else if (puffleTooFarAway()) {
puffle_isCollecting = false;
puffle_breadCrumb.x = myGame.mc.player_mc._x;
puffle_breadCrumb.y = myGame.mc.player_mc._y;
puffle_vector.scalar = puffle_speedBounds.catchup;
puffle_acceleration.steps = 10;
updateInterval_vector = 1000;
}
else if (puffle_isCollecting) {
puffle_breadCrumb.x = puffle_targetTile.b * myGame.tileSize + myGame.tileSize / 2;
puffle_breadCrumb.y = puffle_targetTile.a * myGame.tileSize + myGame.tileSize / 2;
puffle_vector.scalar = random(puffle_speedBounds.max - puffle_speedBounds.min + 1) + puffle_speedBounds.min;
puffle_acceleration.steps = 3;
updateInterval_vector = 200;
}
else {
puffle_breadCrumb.x = myGame.mc.player_mc._x + (random(3) - 1) * puffle_leash;
puffle_breadCrumb.y = myGame.mc.player_mc._y + (random(3) - 1) * puffle_leash;
puffle_vector.scalar = random(puffle_speedBounds.max - puffle_speedBounds.min + 1) + puffle_speedBounds.min;
puffle.acceleration.steps = 10;
updateInterval_vector = 800;
} // end else if
delta_x = puffle_breadCrumb.x - myGame.mc.puffle_mc._x;
delta_y = puffle_breadCrumb.y - myGame.mc.puffle_mc._y;
phi = Math.atan2(delta_y, delta_x);
udx = Math.cos(phi) * puffle_vector.scalar;
udy = Math.sin(phi) * puffle_vector.scalar;
puffle_acceleration.x = (udx - puffle_vector.dx) / puffle_acceleration.steps;
puffle_acceleration.y = (udy - puffle_vector.dy) / puffle_acceleration.steps;
current_step = 0;
puffle_udx = udx;
} // End of the function
function movePuffle() {
if (current_step < puffle_acceleration.steps) {
puffle_vector.dx = puffle_vector.dx + puffle_acceleration.x;
puffle_vector.dy = puffle_vector.dy + puffle_acceleration.y;
++current_step;
} // end if
myGame.mc.puffle_mc._x = myGame.mc.puffle_mc._x + puffle_vector.dx;
myGame.mc.puffle_mc._y = myGame.mc.puffle_mc._y + puffle_vector.dy;
puffle_currentTile.b = Math.floor(myGame.mc.puffle_mc._x / myGame.tileSize);
puffle_currentTile.a = Math.floor(myGame.mc.puffle_mc._y / myGame.tileSize);
} // End of the function
function puffleTooFarAway() {
return (Math.pow(myGame.mc.player_mc._x - myGame.mc.puffle_mc._x, 2) + Math.pow(myGame.mc.player_mc._y - myGame.mc.puffle_mc._y, 2) > puffle_leash * puffle_leash);
} // End of the function
function checkPuffleCollisions() {
b = puffle_currentTile.b;
a = puffle_currentTile.a;
type = myGame.mc.myMap[a][b].link;
hitTile = myGame.mc.tiles_mc["t_" + a + "_" + b];
switch (type) {
case 2: {
hitTile.gotoAndStop(1);
myGame.mc.myMap[a][b].link = 1;
fuelTank = fuelTank + fuelUp;
fuel_sfx.start();
++fuelCollected;
++fuelCollectedTotal;
if (fuelCollected == levelFuel) {
if (levelNum == 1) {
opcodeJournal.sendStampOpcodes(38);
com.clubpenguin.util.Stamp.sendStamp(38);
}
else if (levelNum == 2) {
opcodeJournal.sendStampOpcodes(41);
com.clubpenguin.util.Stamp.sendStamp(41);
}
else if (levelNum == 3) {
opcodeJournal.sendStampOpcodes(42);
com.clubpenguin.util.Stamp.sendStamp(42);
}
else if (levelNum == 4) {
opcodeJournal.sendStampOpcodes(43);
com.clubpenguin.util.Stamp.sendStamp(43);
}
else if (levelNum == 5) {
opcodeJournal.sendStampOpcodes(44);
com.clubpenguin.util.Stamp.sendStamp(44);
if (fuelCollectedTotal == totalFuel) {
opcodeJournal.sendStampOpcodes(47);
com.clubpenguin.util.Stamp.sendStamp(47);
} // end else if
} // end else if
} // end else if
if (fuelEmpty && gravity >= 5) {
opcodeJournal.sendStampOpcodes(205);
com.clubpenguin.util.Stamp.sendStamp(205);
} // end if
break;
}
case 3: {
hitTile.gotoAndStop(1);
myGame.mc.myMap[a][b].link = 1;
coins = coins + 1;
coin_sfx.start();
++coinsCollected;
++puffleCoins;
if (levelNum == 5 && coinsCollected == totalCoins) {
opcodeJournal.sendStampOpcodes(46);
com.clubpenguin.util.Stamp.sendStamp(46);
} // end if
break;
}
case 4: {
hitTile.gotoAndStop(1);
myGame.mc.myMap[a][b].link = 1;
coins = coins + 10;
coin_sfx.start();
coinsCollected = coinsCollected + 10;
puffleCoins = puffleCoins + 10;
if (levelNum == 5 && coinsCollected == totalCoins) {
opcodeJournal.sendStampOpcodes(46);
com.clubpenguin.util.Stamp.sendStamp(46);
} // end if
break;
}
case 5: {
hitTile.gotoAndStop(1);
myGame.mc.myMap[a][b].link = 1;
lives = lives + 1;
messages.gotoAndPlay("1up");
lifeUp_sfx.start();
++livesCollected;
if (livesCollected == 2) {
opcodeJournal.sendStampOpcodes(45);
com.clubpenguin.util.Stamp.sendStamp(45);
}
else if (livesCollected == totalLives) {
opcodeJournal.sendStampOpcodes(49);
com.clubpenguin.util.Stamp.sendStamp(49);
} // end else if
break;
}
case 10: {
hitTile.gotoAndStop(6);
myGame.mc.myMap[a][b].link = 6;
coins = coins + 1;
coin_sfx.start();
++coinsCollected;
++puffleCoins;
if (levelNum == 5 && coinsCollected == totalCoins) {
opcodeJournal.sendStampOpcodes(46);
com.clubpenguin.util.Stamp.sendStamp(46);
} // end if
break;
}
case 11: {
hitTile.gotoAndStop(6);
myGame.mc.myMap[a][b].link = 7;
coins = coins + 1;
coin_sfx.start();
++coinsCollected;
++puffleCoins;
if (coins == gameCoins) {
opcodeJournal.sendStampOpcodes(46);
com.clubpenguin.util.Stamp.sendStamp(46);
} // end if
break;
}
} // End of switch
if (puffleCoins >= 200) {
opcodeJournal.sendStampOpcodes(203);
com.clubpenguin.util.Stamp.sendStamp(203);
} // end if
if (puffleCoins >= 450) {
opcodeJournal.sendStampOpcodes(204);
com.clubpenguin.util.Stamp.sendStamp(204);
} // end if
} // End of the function
function puffleCollectSomething() {
b = puffle_currentTile.b;
a = puffle_currentTile.a;
if (puffle_isCollecting) {
if (b == puffle_targetTile.b && a == puffle_targetTile.a) {
puffle_isCollecting = false;
return;
} // end if
}
else {
i = -1;
j = -1;
do {
for (var _loc1 = i; _loc1 <= -i; ++_loc1) {
if (puffleAttemptTargetTile(a + j, b + _loc1)) {
return;
} // end if
if (puffleAttemptTargetTile(a - j, b + _loc1)) {
return;
} // end if
} // end of for
for (var _loc1 = j + 1; _loc1 < -j; ++_loc1) {
if (puffleAttemptTargetTile(a + _loc1, b + i)) {
return;
} // end if
if (puffleAttemptTargetTile(a + _loc1, b - i)) {
return;
} // end if
} // end of for
--i;
--j;
} while (i > -puffle_tileSearch.x && j > -puffle_tileSearch.y)
} // end else if
} // End of the function
function puffleAttemptTargetTile(a, b) {
type = myGame.mc.myMap[a][b].link;
if (type == 2 || type == 3 || type == 4 || type == 5 || type == 10 || type == 11) {
if (type != 2 && puffle_anim == "concerned") {
return;
} // end if
player_b = Math.floor(myGame.mc.player_mc._x / myGame.tileSize);
player_a = Math.floor(myGame.mc.player_mc._y / myGame.tileSize);
xdist = (b - player_b) * myGame.tileSize;
ydist = (a - player_a) * myGame.tileSize;
if (xdist * xdist + ydist * ydist < puffle_leash * puffle_leash) {
puffle_isCollecting = true;
puffle_targetTile.b = b;
puffle_targetTile.a = a;
} // end if
} // end if
return (puffle_isCollecting);
} // End of the function
function hurtPlayer() {
if (hitTop == true) {
myGame.mc.player_mc._y = myGame.mc.player_mc._y + 20;
}
else if (hitBottom == true) {
myGame.mc.player_mc._y = myGame.mc.player_mc._y + -20;
}
else if (hitRight == true) {
myGame.mc.player_mc._x = myGame.mc.player_mc._x + (totalSpeed * -3 - 10 * myGame.mc.player_mc._xscale / 100);
myGame.mc.player_mc._rotation = myGame.mc.player_mc._rotation * -0.300000;
}
else if (hitLeft == true) {
myGame.mc.player_mc._x = myGame.mc.player_mc._x + (totalSpeed * -3 + 10 * myGame.mc.player_mc._xscale / 100);
myGame.mc.player_mc._rotation = myGame.mc.player_mc._rotation * -0.300000;
}
else if (smallHit == true) {
myGame.mc.player_mc._y = myGame.mc.player_mc._y + yMove * -4;
myGame.mc.player_mc._x = myGame.mc.player_mc._x + (totalSpeed * -3 - 5 * myGame.mc.player_mc._xscale / 100);
myGame.mc.player_mc._rotation = myGame.mc.player_mc._rotation * -0.300000;
smallHit = false;
}
else if (smallHit == true) {
myGame.mc.player_mc._y = myGame.mc.player_mc._y + yMove * -3;
myGame.mc.player_mc._x = myGame.mc.player_mc._x + (totalSpeed * -4 - 5 * myGame.mc.player_mc._xscale / 100);
myGame.mc.player_mc._rotation = myGame.mc.player_mc._rotation * -0.300000;
smallHit = false;
}
else if (landingHit == true) {
myGame.mc.player_mc._y = myGame.mc.player_mc._y + (yMove * -4 - 20);
landingHit = false;
} // end else if
if (invisible == false) {
toonHit_sfx.start();
invisible = true;
myGame.mc.player_mc.peng.gotoAndPlay("crash");
rocket_sfx.setVolume(0);
fuelTank = fuelTank - 25;
invisOffint = setInterval(this, "invisOff", 2000);
} // end if
if (fuelEmpty == true) {
lives = lives - 1;
if (lives > 0) {
myGame.mc.attachMovie("explode", "explode_mc", 100);
myGame.mc.explode_mc._x = myGame.mc.player_mc._x;
myGame.mc.explode_mc._y = myGame.mc.player_mc._y;
fuelTank = 100;
fuelEmpty = false;
myGame.mc.player_mc.peng.gotoAndPlay("fuelCrash");
} // end if
} // end if
} // End of the function
function spawning() {
myGame.mc.player_mc._y = myGame.mc.player_mc._y + -12;
gravity = 0;
myGame.mc.player_mc.flame.gotoAndStop(2);
throttleOn = true;
rocket_sfx.setVolume(45);
} // End of the function
function endGame(midGame, roomID) {
var _loc2 = new Object();
if (totalCoins == undefined) {
totalCoins = 0;
} // end if
if (coins == undefined) {
coins = 0;
} // end if
if (midGame == undefined) {
midGame = 0;
} // end if
if (levelNum > 1 && midGame < 1) {
midGame = 1;
} // end if
if (midGame == 0) {
_loc2.score = totalCoins + coins;
_loc2.coins = _loc2.score;
opcodeJournal.stopLevel(levelNum);
opcodeJournal.sendGameScore(levelNum, "QUIT", _loc2.coins);
}
else if (midGame == 1) {
_loc2.score = coins;
_loc2.coins = _loc2.score;
opcodeJournal.stopLevel(levelNum);
opcodeJournal.sendGameScore(levelNum, "QUIT", _loc2.coins);
}
else {
_loc2.score = totalCoins;
_loc2.coins = _loc2.score;
opcodeJournal.sendGameScore(levelNum, "QUIT", _loc2.coins);
} // end else if
if (roomID == undefined) {
_root.showWindow("Game Over", _loc2);
}
else {
_root.showWindow("Game Over", _loc2, roomID);
} // end else if
opcodeJournal.stopGame();
} // End of the function
function closeGame(midGame) {
if (levelNum == 1 && hazardTileX <= 4) {
_root.myLastRoom = 400;
endGame(midGame, 400);
}
else if (levelNum == 1 && hazardTileX > 4 && hazardTileX < 15) {
_root.myLastRoom = 800;
endGame(midGame, 800);
}
else if (levelNum == 1 && hazardTileX >= 15) {
_root.myLastRoom = 100;
endGame(midGame, 100);
}
else if (levelNum == 2 && hazardTileX <= 4) {
_root.myLastRoom = 100;
endGame(midGame, 100);
}
else if (levelNum == 2 && hazardTileX > 4 && hazardTileX < 17) {
_root.myLastRoom = 801;
endGame(midGame, 801);
}
else if (levelNum == 2 && hazardTileX >= 17) {
_root.myLastRoom = 300;
endGame(midGame, 300);
}
else if (levelNum == 3 && hazardTileX <= 2) {
_root.myLastRoom = 300;
endGame(midGame, 300);
}
else if (levelNum == 3 && hazardTileX > 2 && hazardTileX < 4) {
_root.myLastRoom = 809;
endGame(midGame, 809);
}
else if (levelNum == 3 && hazardTileX >= 4 && hazardTileX < 9) {
_root.myLastRoom = 810;
endGame(midGame, 810);
}
else if (levelNum == 3 && hazardTileX >= 9 && hazardTileX < 18) {
_root.myLastRoom = 805;
endGame(midGame, 805);
}
else if (levelNum == 3 && hazardTileX >= 18) {
_root.myLastRoom = 230;
endGame(midGame, 230);
}
else if (levelNum >= 4) {
_root.myLastRoom = 808;
endGame(midGame, 808);
} // end else if
} // End of the function
function invisOff() {
clearInterval(invisOffInt);
invisible = false;
} // End of the function
stop ();
var SHELL = _global.getCurrentShell();
SHELL.stopMusic();
SHELL.startMusicById(110);
if (levelNum == 1) {
opcodeJournal.startLevel(1);
opcodeJournal.sendPresentedCode(3);
myGame.playerx = 165;
myGame.playery = 715;
myGame.clouds = true;
levelFuel = 5;
} // end if
if (levelNum == 2) {
opcodeJournal.startLevel(2);
opcodeJournal.sendPresentedCode(4);
myGame.playerx = 710;
myGame.playery = 2180;
myGame.clouds = true;
levelFuel = 4;
} // end if
if (levelNum == 3) {
opcodeJournal.startLevel(3);
opcodeJournal.sendPresentedCode(5);
myGame.playerx = 730;
myGame.playery = 3380;
myGame.clouds = true;
levelFuel = 5;
} // end if
if (levelNum == 4) {
opcodeJournal.startLevel(4);
opcodeJournal.sendPresentedCode(6);
myGame.playerx = 235;
myGame.playery = 1320;
myGame.clouds = false;
levelFuel = 8;
} // end if
if (levelNum == 5) {
opcodeJournal.startLevel(5);
opcodeJournal.sendPresentedCode(7);
myGame.playerx = 225;
myGame.playery = 360;
myGame.clouds = false;
levelFuel = 4;
} // end if
background_mc.gotoAndStop(levelNum);
this.attachMovie("interFace", "interFace_mc", 5);
myGame.tileSize = 80;
myGame.vistx = 11;
myGame.visty = 7;
myGame.tileSize2 = 480;
myGame.vistx2 = 3;
myGame.visty2 = 2;
myGame.screenx = 760;
myGame.screeny = 480;
this.attachMovie("messages", "messages", 8);
messages._x = 380;
messages._y = 240;
myGame.mc.attachMovie("player", "player_mc", 4);
myGame.mc.player_mc._x = myGame.playerx;
myGame.mc.player_mc._y = myGame.playery;
myGame.halfScreenx = int(myGame.screenx / 2);
myGame.halfScreeny = int(myGame.screeny / 2);
buildMap(myGame.mc.myMap);
buildMap2(myGame.mc.myMap2);
hasPuffle = false;
currentTime = 0;
dt_global = 0;
updateInterval_vector = 500;
puffle_lastUpdate = 0;
dt_vector = 0;
updateInterval_art = 4000;
puffleArt_lastUpdate = 0;
dt_art = 0;
puffle_anim = "";
puffle_leash = 200;
puffle_speedBounds = {min: 5, max: 15, catchup: 20};
puffle_breadCrumb = new flash.geom.Point(0, 0);
puffle_vector = {dx: 0, dy: 0, scalar: 0};
puffle_udx = 0;
puffle_acceleration = {x: 0, y: 0, steps: 10};
current_step = 0;
puffle_isCollecting = false;
puffle_targetTile = {a: 0, b: 0};
puffle_currentTile = {a: 0, b: 0};
puffle_tileSearch = {x: 3, y: 3};
if (_root.myPlayer.Hand == 753) {
opcodeJournal.sendSelectedCode(2);
hasPuffle = true;
myGame.mc.attachMovie("puffle", "puffle_mc", 5);
myGame.mc.puffle_mc._x = myGame.playerx;
myGame.mc.puffle_mc._y = myGame.playery;
myGame.mc.puffle_mc.onEnterFrame = puffleUpdate;
opcodeJournal.sendStampOpcodes(202);
com.clubpenguin.util.Stamp.sendStamp(202);
} // end if
playerAlive = true;
cloudSpeed = 0;
startGravity = 4;
maxGravity = 13;
gravity = 0;
rotationSpeed = 4;
throttleUp = 1;
throttleDown = 2;
throttleOn = false;
upSpeed = 0;
maxUp = 14;
maxDown = -3;
fuelTank = 100;
fuelUse = 0.060000;
fuelEmpty = false;
fuelUp = 50;
xSpeed = 0;
maxSpeed = 13;
minSpeed = 0;
block = false;
invisible = false;
smokeCounter = 1;
smokeLimit = 25;
landing = true;
landed = true;
yMove = 0;
messagePlaying = false;
hitTop = false;
hitBottom = false;
hitRight = false;
hitLeft = false;
fuelCollected = 0;
totalLives = 4;
totalFuel = 26;
gameCoins = 650;
var prevPos;
var leftPad = false;
var haveStamp67 = false;
myGame.mc.player_mc.onEnterFrame = function () {
movePlayer();
if (block == false && hitTop == false) {
yMove = gravity - upSpeed;
this._y = this._y + yMove;
} // end if
if (playerAlive == true) {
if (fuelEmpty == true) {
xSpeed = this._rotation / 10;
}
else {
xSpeed = this._rotation / 4;
} // end else if
totalSpeed = xSpeed + wind;
this._x = this._x + totalSpeed;
cloudSpeed = totalSpeed * 0.650000;
if (Key.isDown(38) && fuelEmpty == false && downKey == false && hitTop == false) {
upSpeed = upSpeed + throttleUp;
fuelUse = 0.140000;
throttleOn = true;
rocket_sfx.setVolume(45);
}
else {
upSpeed = upSpeed - throttleDown;
scrSpeed = scrSpeed - throttleDown;
fuelUse = 0.060000;
throttleOn = false;
rocket_sfx.setVolume(20);
} // end else if
if (Key.isDown(39) && landed == false && hitRight == false) {
this._rotation = this._rotation + rotationSpeed;
rocket_sfx.setVolume(45);
throttleOn = true;
if (this._rotation >= 50) {
this._rotation = 50;
} // end if
}
else if (landed == false) {
this._rotation = this._rotation * 0.900000;
playerMove = false;
} // end else if
if (Key.isDown(37) && landed == false && hitLeft == false) {
this._rotation = this._rotation - rotationSpeed;
playerMove = true;
rocket_sfx.setVolume(45);
throttleOn = true;
if (this._rotation <= -50) {
this._rotation = -50;
} // end if
} // end if
if (this._rotation > 0) {
this._xscale = 100;
}
else if (this._rotation < 0) {
this._xscale = -100;
} // end else if
if (Key.isDown(40) && landed == false && hitTop == false && hitBottom == false) {
downKey = true;
trottleOff = true;
rocket_sfx.setVolume(0);
}
else {
trottleOff = false;
downKey = false;
} // end if
} // end else if
if (invisible == true) {
startGravity = 3;
}
else {
startGravity = 4;
block = false;
} // end else if
if (gravity >= maxGravity) {
gravity = maxGravity;
} // end if
if (gravity <= startGravity) {
gravity = startGravity;
} // end if
if (upSpeed >= maxUp) {
upSpeed = maxUp;
} // end if
if (upSpeed <= 0) {
upSpeed = 0;
} // end if
if (myGame.mc.player_mc._x > myGame.mapx - 25) {
myGame.mc.player_mc._x = myGame.mapx - 25;
}
else if (myGame.mc.player_mc._x < 25) {
myGame.mc.player_mc._x = 25;
} // end else if
if (myGame.mc.player_mc._y < 90) {
myGame.mc.player_mc._y = 90;
} // end if
if (this._rotation >= 7 && landed == false || this._rotation <= -7 && landed == false) {
this.gotoAndStop("side");
}
else if (landed == false && Key.isDown(37) || landed == false && Key.isDown(39)) {
this.gotoAndStop("straightOn");
} // end else if
b = Math.floor(this._x / myGame.tileSize);
a = Math.floor(this._y / myGame.tileSize);
type1 = myGame.mc.myMap[a][b].link;
hitTile = myGame.mc.tiles_mc["t_" + a + "_" + b];
hitTileCentreY = hitTile._y + 40;
hitTileCentreX = hitTile._x + 40;
if (type1 == 6) {
wind = -8;
}
else {
wind = 0;
} // end else if
if (type1 == 7) {
wind = 8;
} // end if
if (type1 == 10) {
wind = -8;
} // end if
if (type1 == 11) {
wind = 8;
} // end if
if (type1 == 1) {
safeX = hitTileCentreX;
safeY = hitTileCentreY;
} // end if
if (type1 >= 2) {
if (this.hit.hitTest(hitTile.art)) {
if (type1 == 2) {
hitTile.gotoAndStop(1);
myGame.mc.myMap[a][b].link = 1;
fuelTank = fuelTank + fuelUp;
fuel_sfx.start();
++fuelCollected;
++fuelCollectedTotal;
if (fuelCollected == levelFuel) {
if (levelNum == 1) {
opcodeJournal.sendStampOpcodes(38);
com.clubpenguin.util.Stamp.sendStamp(38);
}
else if (levelNum == 2) {
opcodeJournal.sendStampOpcodes(41);
com.clubpenguin.util.Stamp.sendStamp(41);
}
else if (levelNum == 3) {
opcodeJournal.sendStampOpcodes(42);
com.clubpenguin.util.Stamp.sendStamp(42);
}
else if (levelNum == 4) {
opcodeJournal.sendStampOpcodes(43);
com.clubpenguin.util.Stamp.sendStamp(43);
}
else if (levelNum == 5) {
opcodeJournal.sendStampOpcodes(44);
com.clubpenguin.util.Stamp.sendStamp(44);
if (fuelCollectedTotal == totalFuel) {
opcodeJournal.sendStampOpcodes(47);
com.clubpenguin.util.Stamp.sendStamp(47);
} // end else if
} // end else if
} // end else if
if (fuelEmpty && gravity >= 5) {
opcodeJournal.sendStampOpcodes(48);
com.clubpenguin.util.Stamp.sendStamp(48);
} // end if
} // end if
if (type1 == 3) {
hitTile.gotoAndStop(1);
myGame.mc.myMap[a][b].link = 1;
coins = coins + 1;
coin_sfx.start();
++coinsCollected;
if (coins >= gameCoins && !earnedCoinStamp) {
opcodeJournal.sendStampOpcodes(46);
com.clubpenguin.util.Stamp.sendStamp(46);
} // end if
} // end if
if (type1 == 4) {
hitTile.gotoAndStop(1);
myGame.mc.myMap[a][b].link = 1;
coins = coins + 10;
coin_sfx.start();
coinsCollected = coinsCollected + 10;
if (coins == gameCoins) {
opcodeJournal.sendStampOpcodes(46);
com.clubpenguin.util.Stamp.sendStamp(46);
} // end if
} // end if
if (type1 == 5) {
hitTile.gotoAndStop(1);
myGame.mc.myMap[a][b].link = 1;
lives = lives + 1;
messages.gotoAndPlay("1up");
lifeUp_sfx.start();
++livesCollected;
if (livesCollected == 2) {
opcodeJournal.sendStampOpcodes(45);
com.clubpenguin.util.Stamp.sendStamp(45);
}
else if (livesCollected == totalLives) {
opcodeJournal.sendStampOpcodes(49);
com.clubpenguin.util.Stamp.sendStamp(49);
} // end if
} // end else if
if (type1 == 10) {
hitTile.gotoAndStop(6);
myGame.mc.myMap[a][b].link = 6;
coins = coins + 1;
coin_sfx.start();
++coinsCollected;
if (coinsCollected == gameCoins) {
opcodeJournal.sendStampOpcodes(46);
com.clubpenguin.util.Stamp.sendStamp(46);
} // end if
} // end if
if (type1 == 11) {
hitTile.gotoAndStop(6);
myGame.mc.myMap[a][b].link = 7;
coins = coins + 1;
coin_sfx.start();
++coinsCollected;
if (coins == gameCoins) {
opcodeJournal.sendStampOpcodes(46);
com.clubpenguin.util.Stamp.sendStamp(46);
} // end if
} // end if
if (type1 == 14) {
this._y = this._y - 3;
gravity = 0;
}
else {
block = false;
} // end else if
if (type1 >= 15) {
hurtPlayer();
smallHit = true;
} // end if
} // end if
} // end if
if (myGame.mc.player_mc._y > myGame.mapy + 15 && fuelEmpty == false) {
myGame.mc.player_mc._y = myGame.mapy - 60;
hurtPlayer();
}
else if (myGame.mc.player_mc._y > myGame.mapy + 250) {
lives = lives - 1;
myGame.mc.player_mc.peng.gotoAndPlay("start");
myGame.mc.player_mc._y = myGame.mapy - 240;
fuelTank = 100;
} // end else if
if (landing == false && landed == false) {
if (myGame.mc.hazards_mc.hitTest(locationX, locationY - 18, true)) {
hurtPlayer();
hitTop = true;
hit1 = 1;
}
else {
hitTop = false;
hit1 = 0;
} // end else if
if (myGame.mc.hazards_mc.hitTest(locationX - 18, locationY + 5, true)) {
hurtPlayer();
hitLeft = true;
hit2 = 1;
}
else {
hitLeft = false;
hit2 = 0;
} // end else if
if (myGame.mc.hazards_mc.hitTest(locationX + 15, locationY + 5, true)) {
hurtPlayer();
hitRight = true;
hit3 = 1;
}
else {
hitRight = false;
hit3 = 0;
} // end else if
if (myGame.mc.hazards_mc.hitTest(locationX, locationY + 25, true)) {
hurtPlayer();
hitBottom = true;
hit4 = 1;
}
else {
hitBottom = false;
hit4 = 0;
} // end if
} // end else if
totalHits = hit1 + hit2 + hit3 + hit4;
if (totalHits >= 3 && landing == false) {
this._x = safeX;
this._y = safeY;
} // end if
hazardTileX = Math.floor(myGame.mc.player_mc._x / myGame.tileSize2);
hazardTileY = Math.floor(myGame.mc.player_mc._y / myGame.tileSize2);
if (myGame.mc.hazards_mc["t_" + hazardTileY + "_" + hazardTileX].landingArea.hitTest(this.hit)) {
landing = true;
}
else {
landing = false;
leftPad = true;
} // end else if
var _loc3 = this._y;
if (landing == true && myGame.mc.hazards_mc["t_" + hazardTileY + "_" + hazardTileX].landingPad.hitTest(this.hit)) {
landed = true;
if (hazardTileX <= 1 && leftPad && !haveStamp67) {
opcodeJournal.sendStampOpcodes(37);
com.clubpenguin.util.Stamp.sendStamp(37);
haveStamp67 = true;
} // end if
}
else {
landed = false;
} // end else if
if (landed == true) {
throttleOff = true;
xSpeed = 0;
totalSpeed = 0;
cloudSpeed = 0;
gravity = 0;
this._rotation = 0;
this.gotoAndStop("landed");
this.flame.gotoAndStop(3);
rocket_sfx.setVolume(0);
}
else {
throttleOff = false;
} // end else if
if (landed == true && hazardTileX > myGame.mapWidth2 / 2 && messagePlaying == false) {
throttleOff = true;
rocket_sfx.setVolume(0);
playerAlive = false;
xSpeed = 0;
totalSpeed = 0;
cloudSpeed = 0;
gravity = 0;
this._rotation = 0;
this.gotoAndStop("landed");
this.flame.gotoAndStop(3);
messagePlaying = true;
messages.gotoAndPlay("levelComplete");
opcodeJournal.stopLevel(levelNum);
if (levelNum == 5) {
opcodeJournal.stopGame();
gotoAndPlay(gameComplete);
opcodeJournal.sendStampOpcodes(39);
com.clubpenguin.util.Stamp.sendStamp(39);
levelNum = 1;
}
else {
gotoAndPlay(levelComplete);
} // end if
} // end else if
if (throttleOn == true) {
this.flame.gotoAndStop(2);
}
else if (throttleOn == false) {
this.flame.gotoAndStop(1);
} // end else if
if (throttleOff == true) {
this.flame.gotoAndStop(3);
} // end if
prevPos = _loc3;
if (lives <= 0) {
opcodeJournal.stopLevel(levelNum);
opcodeJournal.stopGame();
if (levelNum == 1 && hazardTileX <= 4) {
_root.myLastRoom = 400;
roomNum = 400;
if (hasPuffle) {
gameOver = 4;
}
else {
gameOver = 1;
} // end else if
}
else if (levelNum == 1 && hazardTileX > 4 && hazardTileX < 15) {
_root.myLastRoom = roomNum = 800;
if (hasPuffle) {
gameOver = 4;
}
else {
gameOver = 1;
} // end else if
}
else if (levelNum == 1 && hazardTileX >= 15) {
_root.myLastRoom = roomNum = 100;
if (hasPuffle) {
gameOver = 5;
}
else {
gameOver = 1;
} // end else if
}
else if (levelNum == 2 && hazardTileX <= 4) {
_root.myLastRoom = roomNum = 100;
if (hasPuffle) {
gameOver = 5;
}
else {
gameOver = 1;
} // end else if
}
else if (levelNum == 2 && hazardTileX > 4 && hazardTileX < 17) {
_root.myLastRoom = roomNum = 801;
if (hasPuffle) {
gameOver = 5;
}
else {
gameOver = 1;
} // end else if
}
else if (levelNum == 2 && hazardTileX >= 17) {
_root.myLastRoom = roomNum = 300;
if (hasPuffle) {
gameOver = 5;
}
else {
gameOver = 1;
} // end else if
}
else if (levelNum == 3 && hazardTileX <= 2) {
_root.myLastRoom = roomNum = 300;
if (hasPuffle) {
gameOver = 6;
}
else {
gameOver = 1;
} // end else if
}
else if (levelNum == 3 && hazardTileX > 2 && hazardTileX < 4) {
_root.myLastRoom = roomNum = 809;
if (hasPuffle) {
gameOver = 6;
}
else {
gameOver = 1;
} // end else if
opcodeJournal.sendStampOpcodes(40);
com.clubpenguin.util.Stamp.sendStamp(40);
}
else if (levelNum == 3 && hazardTileX >= 4 && hazardTileX < 9) {
_root.myLastRoom = roomNum = 810;
if (hasPuffle) {
gameOver = 6;
}
else {
gameOver = 1;
} // end else if
}
else if (levelNum == 3 && hazardTileX >= 9 && hazardTileX < 18) {
_root.myLastRoom = roomNum = 805;
if (hasPuffle) {
gameOver = 7;
}
else {
gameOver = 2;
} // end else if
}
else if (levelNum == 3 && hazardTileX >= 18) {
_root.myLastRoom = roomNum = 230;
if (hasPuffle) {
gameOver = 6;
}
else {
gameOver = 1;
} // end else if
}
else if (levelNum >= 4) {
_root.myLastRoom = roomNum = 808;
if (hasPuffle) {
gameOver = 9;
}
else {
gameOver = 3;
} // end else if
} // end else if
gotoAndPlay(gameOver);
throttleOn = false;
fuelTank = 0;
} // end if
if (fuelEmpty == true || playerAlive == false && landed == false || trottleOff == true) {
throttleOn = false;
gravity = gravity + throttleUp;
fuelUse = 0;
this.flame.gotoAndStop(3);
}
else if (landed == false) {
gravity = gravity - throttleUp;
} // end else if
if (landed == true && playerAlive == false) {
gravity = 0;
} // end if
locationX = myGame.mc.player_mc._x + myGame.mc._x;
locationY = myGame.mc.player_mc._y + myGame.mc._y;
interFace_mc.scoreText.text = coins;
interFace_mc.levelText.text = levelNum;
};
interFace_mc.fuelGuage.onEnterFrame = function () {
if (landed == false) {
fuelTank = fuelTank - fuelUse;
this.mask._yscale = fuelTank;
} // end if
if (fuelTank <= 0) {
fuelEmpty = true;
rocket_sfx.setVolume(0);
fuelTank = 0;
} // end if
if (fuelTank > 25) {
fuelWarningPlayed = false;
} // end if
if (fuelTank >= 100) {
fuelTank = 100;
} // end if
if (fuelTank <= 25 && fuelTank > 0 && fuelWarningPlayed == false) {
messages.gotoAndPlay("fuelLow");
fuelWarningPlayed = true;
warning_sfx.start();
} // end if
if (fuelTank <= 0 && emptyPlayed == false && myGame.mc.player_mc._y < 550) {
invisible = false;
messages.gotoAndPlay("fuelEmpty");
warning_sfx.start();
emptyPlayed = true;
} // end if
if (fuelTank > 0) {
fuelEmpty = false;
emptyPlayed = false;
} // end if
};
interFace_mc.lives_mc.onEnterFrame = function () {
this.gotoAndStop(lives);
};
createEmptyMovieClip("coinSfx_mc", 1001);
coin_sfx = new Sound(coinSfx_mc);
coin_sfx.attachSound("dingSound");
coin_sfx.setVolume(60);
createEmptyMovieClip("explosionSfx_mc", 1002);
explosion_sfx = new Sound(explosionSfx_mc);
explosion_sfx.attachSound("explosionSound");
explosion_sfx.setVolume(70);
createEmptyMovieClip("toonHitSfx_mc", 1003);
toonHit_sfx = new Sound(toonHitSfx_mc);
toonHit_sfx.attachSound("toonHitSound");
toonHit_sfx.setVolume(100);
createEmptyMovieClip("warningSfx_mc", 1004);
warning_sfx = new Sound(warningSfx_mc);
warning_sfx.attachSound("warningSound");
warning_sfx.setVolume(50);
createEmptyMovieClip("tingSfx_mc", 1005);
ting_sfx = new Sound(tingSfx_mc);
ting_sfx.attachSound("tingSound");
ting_sfx.setVolume(100);
createEmptyMovieClip("rocketSfx_mc", 1006);
rocket_sfx = new Sound(rocketSfx_mc);
rocket_sfx.attachSound("rocketSound");
rocket_sfx.start(0, 99);
createEmptyMovieClip("fuelSfx_mc", 1007);
fuel_sfx = new Sound(fuelSfx_mc);
fuel_sfx.attachSound("fuelSound");
fuel_sfx.setVolume(100);
createEmptyMovieClip("lifeSfx_mc", 1008);
lifeUp_sfx = new Sound(lifeSfx_mc);
lifeUp_sfx.attachSound("1upSound");
lifeUp_sfx.setVolume(100);
// [Action in Frame 83]
stop ();
stopAllSounds ();
removeMovieClip (myGame.mc.hazards_mc);
removeMovieClip (myGame.mc.tiles_mc);
removeMovieClip (myGame.mc.player_mc);
removeMovieClip (myGame.mc.puffle_mc);
removeMovieClip (messages);
myGame.mc.unloadMovie;
interFace_mc._visible = false;
fuelBonus = Math.floor(fuelTank / 2);
totalCoins = fuelBonus + coins;
// [Action in Frame 87]
playerAlive = false;
// [Action in Frame 108]
stop ();
stopAllSounds ();
removeMovieClip (myGame.mc.hazards_mc);
removeMovieClip (myGame.mc.tiles_mc);
removeMovieClip (myGame.mc.player_mc);
removeMovieClip (myGame.mc.puffle_mc);
removeMovieClip (messages);
myGame.mc.unloadMovie;
interFace_mc._visible = false;
fuelBonus = Math.floor(fuelTank / 2);
totalCoins = fuelBonus + coins;
if (totalCoins == 0) {
opcodeJournal.sendGameScore(levelNum, "WIN", 1000);
gotoAndStop("superBonus");
opcodeJournal.sendStampOpcodes(50);
com.clubpenguin.util.Stamp.sendStamp(50);
opcodeJournal.sendStampOpcodes(46);
com.clubpenguin.util.Stamp.sendStamp(46);
_parent.earnedCoinStamp = true;
}
else if (totalCoins > 0) {
opcodeJournal.sendGameScore(levelNum, "WIN", totalCoins);
gotoAndStop("gameEnd");
} // end else if
// [Action in Frame 109]
stop ();
// [Action in Frame 112]
stop ();
totalCoins = 1000;
// [Action in Frame 119]
stopAllSounds ();
removeMovieClip (myGame.mc.hazards_mc);
removeMovieClip (myGame.mc.tiles_mc);
removeMovieClip (myGame.mc.player_mc);
removeMovieClip (myGame.mc.puffle_mc);
removeMovieClip (messages);
myGame.mc.unloadMovie;
interFace_mc._visible = false;
fuelBonus = Math.floor(fuelTank / 2);
totalCoins = fuelBonus + coins;
opcodeJournal.sendGameScore(levelNum, "LOSE", totalCoins);
stop ();
// [Action in Frame 120]
stop ();
// http://media1.clubpenguin.com/play/v2/games/jetpack/level1/level1_1.swf
myMap = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 18, 18, 18, 18, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 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1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 18, 18, 18, 18, 18, 18, 1, 18, 18, 18, 18, 1, 1, 1, 18, 18, 18, 18, 18, 18, 1, 1, 3, 1], [18, 18, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 18, 1, 3, 18, 1, 3, 18, 18, 18, 18, 1, 1, 1, 18, 18, 1, 4, 1, 18, 18, 18, 18, 3, 3, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 1, 1, 18, 18, 18, 18, 1, 1, 18, 1, 3, 18, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 1, 1, 3, 1], [18, 18, 1, 1, 1, 1, 1, 1, 1, 1, 27, 1, 26, 1, 1, 1, 26, 27, 29, 18, 18, 1, 18, 27, 1, 18, 18, 18, 18, 1, 1, 27, 18, 18, 1, 1, 1, 18, 18, 18, 18, 1, 1, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 1, 1, 18, 18, 18, 18, 1, 1, 18, 1, 3, 18, 1, 26, 25, 1, 26, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 26, 25, 1, 1, 1, 1, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 2, 1, 4, 1]];
myMap2 = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 1, 1, 10, 1, 1, 16, 1, 1], [21, 1, 1, 2, 7, 4, 6, 5, 9, 7, 6, 2, 1, 10, 1, 1, 23, 22, 24, 1]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment