Section 1
//character_select_87 (totw_fla.character_select_87)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class character_select_87 extends MovieClip {
public var right_arrow:SimpleButton;
public var characters:MovieClip;
public var left_arrow:SimpleButton;
public function character_select_87(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package totw_fla
Section 2
//descriptions_92 (totw_fla.descriptions_92)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class descriptions_92 extends MovieClip {
public function descriptions_92(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package totw_fla
Section 3
//gun_7 (totw_fla.gun_7)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class gun_7 extends MovieClip {
public function gun_7(){
addFrameScript(0, frame1, 10, frame11);
}
function frame1(){
stop();
}
function frame11(){
gotoAndStop(1);
}
}
}//package totw_fla
Section 4
//intro_bof_77 (totw_fla.intro_bof_77)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class intro_bof_77 extends MovieClip {
public function intro_bof_77(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package totw_fla
Section 5
//intro_bthe_75 (totw_fla.intro_bthe_75)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class intro_bthe_75 extends MovieClip {
public function intro_bthe_75(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package totw_fla
Section 6
//intro_btop_76 (totw_fla.intro_btop_76)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class intro_btop_76 extends MovieClip {
public function intro_btop_76(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package totw_fla
Section 7
//intro_bweb_74 (totw_fla.intro_bweb_74)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class intro_bweb_74 extends MovieClip {
public function intro_bweb_74(){
addFrameScript(29, frame30);
}
function frame30(){
stop();
}
}
}//package totw_fla
Section 8
//lazer_42 (totw_fla.lazer_42)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class lazer_42 extends MovieClip {
public function lazer_42(){
addFrameScript(5, frame6);
}
function frame6(){
stop();
}
}
}//package totw_fla
Section 9
//menu_soundcopy_84 (totw_fla.menu_soundcopy_84)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class menu_soundcopy_84 extends MovieClip {
public var stopBtn:SimpleButton;
public var playBtn:SimpleButton;
public function menu_soundcopy_84(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
this.playBtn.addEventListener(MouseEvent.CLICK, MovieClip(root).mutePlayClicked);
}
function frame2(){
stop();
this.stopBtn.addEventListener(MouseEvent.CLICK, MovieClip(root).muteStopClicked);
}
}
}//package totw_fla
Section 10
//mult_holder_98 (totw_fla.mult_holder_98)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class mult_holder_98 extends MovieClip {
public function mult_holder_98(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package totw_fla
Section 11
//multiplier_99 (totw_fla.multiplier_99)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class multiplier_99 extends MovieClip {
public function multiplier_99(){
addFrameScript(9, frame10);
}
function frame10(){
stop();
}
}
}//package totw_fla
Section 12
//poototalslide_11 (totw_fla.poototalslide_11)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class poototalslide_11 extends MovieClip {
public function poototalslide_11(){
addFrameScript(16, frame17);
}
function frame17(){
MovieClip(root).endMove("duck");
}
}
}//package totw_fla
Section 13
//selectchatracter_90 (totw_fla.selectchatracter_90)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class selectchatracter_90 extends MovieClip {
public function selectchatracter_90(){
addFrameScript(0, frame1, 1, frame2, 29, frame30, 30, frame31, 59, frame60, 60, frame61, 89, frame90, 90, frame91, 120, frame121, 121, frame122, 150, frame151, 151, frame152, 179, frame180);
}
function frame151(){
if (!MovieClip(root).isMovingSelector()){
stop();
MovieClip(root).setCurrentCharacter("sheep");
MovieClip(root).toggleArrows(0);
} else {
MovieClip(root).toggleArrows(1);
};
}
function frame152(){
MovieClip(root).setMovingSelector(false);
}
function frame90(){
if (!MovieClip(root).isMovingSelector()){
stop();
MovieClip(root).setCurrentCharacter("toilet");
MovieClip(root).toggleArrows(0);
} else {
MovieClip(root).toggleArrows(1);
};
}
function frame91(){
MovieClip(root).setMovingSelector(false);
}
function frame180(){
gotoAndStop(90);
}
function frame1(){
if (!MovieClip(root).isMovingSelector()){
stop();
MovieClip(root).setCurrentCharacter("toilet");
MovieClip(root).toggleArrows(0);
} else {
MovieClip(root).toggleArrows(1);
};
}
function frame2(){
MovieClip(root).setMovingSelector(false);
}
function frame30(){
if (!MovieClip(root).isMovingSelector()){
stop();
MovieClip(root).setCurrentCharacter("sheep");
MovieClip(root).toggleArrows(0);
} else {
MovieClip(root).toggleArrows(1);
};
}
function frame31(){
MovieClip(root).setMovingSelector(false);
}
function frame122(){
MovieClip(root).setMovingSelector(false);
}
function frame121(){
if (!MovieClip(root).isMovingSelector()){
stop();
MovieClip(root).setCurrentCharacter("poo");
MovieClip(root).toggleArrows(0);
} else {
MovieClip(root).toggleArrows(0);
};
}
function frame61(){
MovieClip(root).setMovingSelector(false);
}
function frame60(){
if (!MovieClip(root).isMovingSelector()){
stop();
MovieClip(root).setCurrentCharacter("poo");
MovieClip(root).toggleArrows(0);
} else {
MovieClip(root).toggleArrows(1);
};
}
}
}//package totw_fla
Section 14
//sheep_duck_mc_17 (totw_fla.sheep_duck_mc_17)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class sheep_duck_mc_17 extends MovieClip {
public function sheep_duck_mc_17(){
addFrameScript(22, frame23);
}
function frame23(){
MovieClip(root).endMove("duck");
}
}
}//package totw_fla
Section 15
//slow_mo_bar_96 (totw_fla.slow_mo_bar_96)
package totw_fla {
import flash.display.*;
public dynamic class slow_mo_bar_96 extends MovieClip {
public var innerBar:MovieClip;
}
}//package totw_fla
Section 16
//small_bg_94 (totw_fla.small_bg_94)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class small_bg_94 extends MovieClip {
public function small_bg_94(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
}
}//package totw_fla
Section 17
//stuffLoader_2 (totw_fla.stuffLoader_2)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class stuffLoader_2 extends MovieClip {
public function stuffLoader_2(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package totw_fla
Section 18
//Symbol1_95 (totw_fla.Symbol1_95)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class Symbol1_95 extends MovieClip {
public function Symbol1_95(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame2(){
stop();
}
}
}//package totw_fla
Section 19
//toilet_gun_6 (totw_fla.toilet_gun_6)
package totw_fla {
import flash.display.*;
public dynamic class toilet_gun_6 extends MovieClip {
public var gun_anim:MovieClip;
public var gun_top:MovieClip;
}
}//package totw_fla
Section 20
//toilet_run_mc_19 (totw_fla.toilet_run_mc_19)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class toilet_run_mc_19 extends MovieClip {
public var leg_2:MovieClip;
public var leg_1:MovieClip;
public var body:MovieClip;
public function toilet_run_mc_19(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
this.leg_1.gotoAndPlay(8);
this.leg_2.gotoAndPlay(8);
}
}
}//package totw_fla
Section 21
//toiletslide_29 (totw_fla.toiletslide_29)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class toiletslide_29 extends MovieClip {
public function toiletslide_29(){
addFrameScript(15, frame16);
}
function frame16(){
MovieClip(root).endMove("duck");
}
}
}//package totw_fla
Section 22
//totwIntro_73 (totw_fla.totwIntro_73)
package totw_fla {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class totwIntro_73 extends MovieClip {
public function totwIntro_73(){
addFrameScript(0, frame1, 89, frame90);
}
function frame90(){
stop();
this.removeEventListener(MouseEvent.CLICK, MovieClip(root).introClicked);
MovieClip(root).play();
}
function frame1(){
}
}
}//package totw_fla
Section 23
//backtomenu (backtomenu)
package {
import flash.display.*;
public dynamic class backtomenu extends SimpleButton {
}
}//package
Section 24
//character_poo_mc (character_poo_mc)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class character_poo_mc extends MovieClip {
public var hit_zone:MovieClip;
public var gun:MovieClip;
public function character_poo_mc(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 25
//character_sheep_mc (character_sheep_mc)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class character_sheep_mc extends MovieClip {
public var gun:MovieClip;
public function character_sheep_mc(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 26
//character_toilet_mc (character_toilet_mc)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class character_toilet_mc extends MovieClip {
public var gun:MovieClip;
public var outert:MovieClip;
public var outer:MovieClip;
public function character_toilet_mc(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 27
//deathShots (deathShots)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class deathShots extends MovieClip {
public function deathShots(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 28
//duckSound (duckSound)
package {
import flash.media.*;
public dynamic class duckSound extends Sound {
}
}//package
Section 29
//explosionSound (explosionSound)
package {
import flash.media.*;
public dynamic class explosionSound extends Sound {
}
}//package
Section 30
//full_explosion (full_explosion)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class full_explosion extends MovieClip {
public function full_explosion(){
addFrameScript(10, frame11);
}
function frame11(){
stop();
MovieClip(root).removeExplosion(this);
}
}
}//package
Section 31
//gameoverPopup (gameoverPopup)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class gameoverPopup extends MovieClip {
public var signUpBtn:SimpleButton;
public var submitScoreButton:SimpleButton;
public var playAgainBtn:SimpleButton;
public var gameoverMessage:TextField;
public var visitTotwBtn:SimpleButton;
public var submitScoreBtn:SimpleButton;
public var usernameInput:TextField;
public var showText:TextField;
public var scoreDisplay:TextField;
public var passwordInput:TextField;
public function gameoverPopup(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
MovieClip(root).setupGameoverS1();
if (MovieClip(root).currentLabel == "win"){
gameoverMessage.text = "Congratulations! You made it to the top of the web!";
};
}
function frame2(){
stop();
MovieClip(root).setupGameoverS2();
}
}
}//package
Section 32
//gunSound (gunSound)
package {
import flash.media.*;
public dynamic class gunSound extends Sound {
}
}//package
Section 33
//hitSound (hitSound)
package {
import flash.media.*;
public dynamic class hitSound extends Sound {
}
}//package
Section 34
//jukebox (jukebox)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class jukebox extends MovieClip {
public var forwardC:SimpleButton;
public var backC:SimpleButton;
public var stopC:SimpleButton;
public var playC:SimpleButton;
public function jukebox(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package
Section 35
//jumpSound (jumpSound)
package {
import flash.media.*;
public dynamic class jumpSound extends Sound {
}
}//package
Section 36
//lazer_holder (lazer_holder)
package {
import flash.display.*;
public dynamic class lazer_holder extends MovieClip {
public var lazer:MovieClip;
}
}//package
Section 37
//obstacle_0 (obstacle_0)
package {
import flash.display.*;
public dynamic class obstacle_0 extends MovieClip {
public var hit_point_0:MovieClip;
public var hit_point_2:MovieClip;
public var hit_point_3:MovieClip;
public var hit_point_1:MovieClip;
}
}//package
Section 38
//obstacle_1 (obstacle_1)
package {
import flash.display.*;
public dynamic class obstacle_1 extends MovieClip {
public var hit_zone:MovieClip;
public var hit_point_0:MovieClip;
public var hit_point_2:MovieClip;
public var hit_point_3:MovieClip;
public var hit_point_1:MovieClip;
}
}//package
Section 39
//obstacle_2 (obstacle_2)
package {
import flash.display.*;
public dynamic class obstacle_2 extends MovieClip {
public var hit_point_0:MovieClip;
public var hit_point_2:MovieClip;
public var hit_point_3:MovieClip;
public var hit_point_1:MovieClip;
}
}//package
Section 40
//obstacle_3 (obstacle_3)
package {
import flash.display.*;
public dynamic class obstacle_3 extends MovieClip {
public var hit_point_0:MovieClip;
public var hit_point_2:MovieClip;
public var hit_point_3:MovieClip;
public var hit_point_1:MovieClip;
}
}//package
Section 41
//obstacle_4 (obstacle_4)
package {
import flash.display.*;
public dynamic class obstacle_4 extends MovieClip {
public var hit_point_0:MovieClip;
public var hit_point_2:MovieClip;
public var hit_point_3:MovieClip;
public var hit_point_1:MovieClip;
}
}//package
Section 42
//obstacle_5 (obstacle_5)
package {
import flash.display.*;
public dynamic class obstacle_5 extends MovieClip {
public var hit_point_0:MovieClip;
public var hit_point_2:MovieClip;
public var hit_point_3:MovieClip;
public var hit_point_1:MovieClip;
}
}//package
Section 43
//obstacle_6 (obstacle_6)
package {
import flash.display.*;
public dynamic class obstacle_6 extends MovieClip {
public var hit_point_0:MovieClip;
public var hit_point_2:MovieClip;
public var hit_point_3:MovieClip;
public var hit_point_1:MovieClip;
}
}//package
Section 44
//obstacle_7 (obstacle_7)
package {
import flash.display.*;
public dynamic class obstacle_7 extends MovieClip {
public var hit_point_0:MovieClip;
public var hit_point_2:MovieClip;
public var hit_point_3:MovieClip;
public var hit_point_1:MovieClip;
}
}//package
Section 45
//obstacle_8 (obstacle_8)
package {
import flash.display.*;
public dynamic class obstacle_8 extends MovieClip {
public var hit_point_0:MovieClip;
public var hit_point_2:MovieClip;
public var hit_point_3:MovieClip;
public var hit_point_1:MovieClip;
}
}//package
Section 46
//TOTW (TOTW)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
public class TOTW extends MovieClip {
private var obstacleTimer:Timer;
private var uptoObstacles:Number;
private var shootObstacleTimer:Timer;
public var score_display:TextField;
private var jumpAmount:Number;
private var startJumpAmount:Number;
private var flickerTimer:Timer;
private var dodgeStreak:int;
public var bg:MovieClip;
public var moreGamesBtn:SimpleButton;
public var backToMenuBtn:backtomenu;
public var currentSpeed:Number;
private var ground1StartY:Number;
private var slowMoLeft:Number;
private var movingSelector:Boolean;
private var shootObs:Array;
private var dS:MovieClip;
private var isJumping:Boolean;
public var instructionsBtn:SimpleButton;
private var groundWidth:Number;
public var descriptionsHolder:MovieClip;
private var scoreSubmitted:Boolean;
public var playBtn:SimpleButton;
private var obstaclesInfo:Array;
private var score:int;
private var nextObstacle:int;
private var duckS:Sound;
private var obstaclesRemaining:int;
public var ofgBtn:SimpleButton;
private var selectedCharacter:int;
private var characterIds:Array;
public var mult_graphic:MovieClip;
private var jumpStart:Number;
private var player:MovieClip;
public var highScoresBtn:SimpleButton;
private var currentSpeedBegin:Number;
private var obstacleSpeed:Number;
private var lives:int;
private var slowMotion:Boolean;
private var gunS:Sound;
private var allowFire:Number;
private var isRunning:Boolean;
public var totwBtn:SimpleButton;
private var hitS:Sound;
public var graphicscredit:MovieClip;
private var obstacleDestruct:Number;
private var jumpTo:Number;
public var programmercredit:MovieClip;
private var obstacleMaxSpeed:Number;
private var timeBetweenFire:int;
private var gameOverWindow:MovieClip;
private var characterInfo:Array;
public var ground_1:MovieClip;
public var ground_2:MovieClip;
public var muteBtn:MovieClip;
public var level:int;
private var nextFlicker:Number;
private var timeBetweenObstacles:Number;
public var lives_display:TextField;
public var aboutBtn:SimpleButton;
public var slowMoBar:MovieClip;
private var nextDepth:int;
private var dodgePoints:int;
private var nextShootObstacle:int;
private var ground2StartY:Number;
private var addToJump:Number;
private var currentCharacter:String;
private var bullets:Array;
private var soundMuted:Boolean;
private var timeBetweenShootObstacles:Number;
private var myJuke:MovieClip;
private var obstacles:Array;
private var whiteFlashHolder:MovieClip;
private var explosionS:Sound;
public var selector:MovieClip;
private var jumpS:Sound;
private var characterFlickers:Number;
public var loadPart:MovieClip;
private var isDucking:Boolean;
private static const PICALC:Number = 6.28318530717959;
public function TOTW():void{
var _local1:ContextMenu;
var _local2:ContextMenuItem;
var _local3:ContextMenuItem;
var _local4:ContextMenuItem;
var _local5:ContextMenuItem;
super();
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5, 5, frame6, 6, frame7, 7, frame8, 8, frame9, 9, frame10);
_local1 = new ContextMenu();
_local1.hideBuiltInItems();
_local2 = new ContextMenuItem("High quality");
_local2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, setHighHandler);
_local1.customItems.push(_local2);
_local3 = new ContextMenuItem("Medium quality");
_local3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, setMediumHandler);
_local1.customItems.push(_local3);
_local4 = new ContextMenuItem("Low quality");
_local4.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, setLowHandler);
_local1.customItems.push(_local4);
_local5 = new ContextMenuItem("Visit TOTW");
_local5.separatorBefore = true;
_local5.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, goTotwRHandler);
_local1.customItems.push(_local5);
contextMenu = _local1;
soundMuted = false;
}
public function randomNumber(_arg1:int, _arg2:int):Number{
var _local3:int;
_local3 = (Math.round((Math.random() * (_arg2 - _arg1))) + _arg1);
return (_local3);
}
public function fireWeapon():void{
var _local1:Point;
var _local2:MovieClip;
_local1 = new Point();
_local1 = player.gun.gun_top.localToGlobal(_local1);
_local2 = new lazer_holder();
bullets.push({mc:_local2});
_local2.x = _local1.x;
_local2.y = _local1.y;
_local2.rotation = ((player.gun.rotation + player.rotation) + 1);
addChild(_local2);
player.gun.gun_anim.play();
gunS.play();
}
public function toggleArrows(_arg1:Number):void{
switch (_arg1){
case 0:
selector.left_arrow.visible = true;
selector.right_arrow.visible = true;
break;
case 1:
selector.left_arrow.visible = false;
selector.right_arrow.visible = false;
break;
};
}
public function popupSite(_arg1:String):void{
var _local2:URLRequest;
_local2 = new URLRequest(_arg1);
navigateToURL(_local2, "_blank");
}
public function introClicked(_arg1:Event):void{
popupSite("http://www.totw.com");
}
public function isMovingSelector():Boolean{
return (movingSelector);
}
public function muteStopClicked(_arg1:MouseEvent):void{
var _local2:SoundTransform;
soundMuted = false;
_local2 = new SoundTransform(1);
SoundMixer.soundTransform = _local2;
muteBtn.stopBtn.removeEventListener(MouseEvent.CLICK, muteStopClicked);
muteBtn.gotoAndStop(1);
}
public function newShootObstacle(_arg1:TimerEvent):void{
var _local2:int;
var _local3:Class;
var _local4:MovieClip;
if (level != 4){
_local2 = (((uptoObstacles - 1) * 3) + 2);
} else {
_local2 = shootObs[randomNumber(0, 2)];
};
_local3 = (getDefinitionByName(obstaclesInfo[_local2].mc) as Class);
_local4 = new (_local3);
obstacles.push({mc:_local4, otype:obstaclesInfo[_local2].otype, maxSpeed:obstacleMaxSpeed, speed:0, goDirection:"left", hits:0, lastHit:null, destructTime:(getTimer() + obstacleDestruct), yChange:randomNumber(-5, 5)});
_local4.x = obstaclesInfo[_local2].startX;
_local4.y = obstaclesInfo[_local2].startY;
addChild(_local4);
if (_arg1.target.currentCount == 1){
timeBetweenShootObstacles = 25000;
resetTimer(shootObstacleTimer, timeBetweenShootObstacles, newShootObstacle);
};
}
public function setCurrentCharacter(_arg1:String):void{
currentCharacter = _arg1;
descriptionsHolder.gotoAndStop(currentCharacter);
}
public function initializeSelectScreen():void{
selectedCharacter = 0;
currentCharacter = "toilet";
movingSelector = false;
characterIds = new Array();
characterIds["toilet"] = 0;
characterIds["poo"] = 1;
characterIds["sheep"] = 2;
selector.left_arrow.addEventListener(MouseEvent.CLICK, moveSelectLeft);
selector.right_arrow.addEventListener(MouseEvent.CLICK, moveSelectRight);
stage.addEventListener(KeyboardEvent.KEY_DOWN, selectCurrentCharacter);
addChild(myJuke);
stage.focus = stage;
}
public function setLevel(_arg1:int):void{
if (_arg1 > 4){
return;
};
ground_1.gotoAndStop(_arg1);
ground_2.gotoAndStop(_arg1);
bg.gotoAndStop(_arg1);
}
public function endSlowMotion():void{
if (!slowMotion){
return;
};
slowMotion = false;
stage.frameRate = 30;
}
public function moveWorld(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:int;
var _local5:Point;
var _local6:Point;
var _local7:Point;
var _local8:Point;
var _local9:Number;
_local2 = 0;
_local3 = 0;
_local4 = getTimer();
if (isJumping){
doJump();
};
_local3 = bullets.length;
_local2 = 0;
while (_local2 < _local3) {
if (bullets[_local2].mc.lazer.currentFrame == 6){
removeLazer(_local2);
_local2--;
_local3--;
};
_local2++;
};
_local3 = obstacles.length;
_local5 = new Point();
_local6 = new Point();
_local7 = new Point();
_local8 = new Point();
_local2 = 0;
while (_local2 < _local3) {
if (obstacles[_local2].otype != "shoot"){
obstacles[_local2].mc.x = (obstacles[_local2].mc.x - currentSpeed);
obstacles[_local2].mc.y = (obstacles[_local2].mc.y + (currentSpeed / 2.8));
if (obstacles[_local2].mc.hitTestObject(MovieClip(root).player)){
_local5 = obstacles[_local2].mc.hit_point_0.localToGlobal(_local5);
_local6 = obstacles[_local2].mc.hit_point_1.localToGlobal(_local6);
_local7 = obstacles[_local2].mc.hit_point_2.localToGlobal(_local7);
_local8 = obstacles[_local2].mc.hit_point_3.localToGlobal(_local8);
if (((((((MovieClip(root).player.hitTestPoint(_local5.x, _local5.y, true)) || (MovieClip(root).player.hitTestPoint(_local6.x, _local6.y, true)))) || (MovieClip(root).player.hitTestPoint(_local7.x, _local7.y, true)))) || (MovieClip(root).player.hitTestPoint(_local8.x, _local8.y, true)))){
if (characterFlickers == -1){
obstacles[_local2].playerHit = true;
dodgeStreak = 0;
endPointMultiplier();
hitS.play();
if (loseLife()){
return;
};
};
};
};
if (obstacles[_local2].mc.x < -100){
if (!obstacles[_local2].playerHit){
dodgeStreak++;
updateScore(dodgePoints);
if (dodgeStreak == 4){
startPointMultiplier();
};
};
removeObstacle(_local2);
dodgedObstacle();
_local2--;
_local3--;
};
} else {
if (_local4 >= obstacles[_local2].destructTime){
newExplosion(obstacles[_local2].mc.x, obstacles[_local2].mc.y);
removeObstacle(_local2);
_local2--;
_local3--;
dodgeStreak = 0;
endPointMultiplier();
if (loseLife()){
return;
};
} else {
if (obstacles[_local2].goDirection == "left"){
obstacles[_local2].mc.x = (obstacles[_local2].mc.x - obstacles[_local2].speed);
if (obstacles[_local2].mc.x < 100){
obstacles[_local2].speed = (obstacles[_local2].speed - 0.9);
if (obstacles[_local2].speed <= 0){
obstacles[_local2].goDirection = "right";
};
} else {
obstacles[_local2].speed = (obstacles[_local2].speed + 0.2);
if (obstacles[_local2].speed > obstacles[_local2].maxSpeed){
obstacles[_local2].speed = obstacles[_local2].maxSpeed;
};
};
} else {
obstacles[_local2].mc.x = (obstacles[_local2].mc.x + obstacles[_local2].speed);
if (obstacles[_local2].mc.x > 550){
obstacles[_local2].speed = (obstacles[_local2].speed - 0.9);
if (obstacles[_local2].speed <= 0){
obstacles[_local2].goDirection = "left";
};
} else {
obstacles[_local2].speed = (obstacles[_local2].speed + 0.2);
if (obstacles[_local2].speed > obstacles[_local2].maxSpeed){
obstacles[_local2].speed = obstacles[_local2].maxSpeed;
};
};
};
_local9 = 0;
while (_local9 < bullets.length) {
if (((!((obstacles[_local2].lastHit == bullets[_local9].mc))) && (bullets[_local9].mc.hitTestObject(obstacles[_local2].mc)))){
_local5 = obstacles[_local2].mc.hit_point_0.localToGlobal(_local5);
_local6 = obstacles[_local2].mc.hit_point_1.localToGlobal(_local6);
_local7 = obstacles[_local2].mc.hit_point_2.localToGlobal(_local7);
_local8 = obstacles[_local2].mc.hit_point_3.localToGlobal(_local8);
if (((((((bullets[_local9].mc.hitTestPoint(_local5.x, _local5.y, true)) || (bullets[_local9].mc.hitTestPoint(_local6.x, _local6.y, true)))) || (bullets[_local9].mc.hitTestPoint(_local7.x, _local7.y, true)))) || (bullets[_local9].mc.hitTestPoint(_local8.x, _local8.y, true)))){
obstacles[_local2].hits++;
obstacles[_local2].lastHit = bullets[_local9].mc;
dodgeStreak++;
updateScore(dodgePoints);
if (dodgeStreak == 4){
startPointMultiplier();
};
if (obstacles[_local2].hits >= 3){
newExplosion(obstacles[_local2].mc.x, obstacles[_local2].mc.y);
removeObstacle(_local2);
_local2--;
_local3--;
};
};
};
_local9++;
};
};
};
_local2++;
};
moveGun();
moveBackground();
if (slowMotion){
slowMoLeft = (slowMoLeft - 2);
if (slowMoLeft <= 0){
endSlowMotion();
slowMoLeft = 0;
};
slowMoBar.innerBar.scaleX = (slowMoLeft * 0.01);
} else {
slowMoLeft = (slowMoLeft + 0.08);
if (slowMoLeft > 100){
slowMoLeft = 100;
} else {
slowMoBar.innerBar.scaleX = (slowMoLeft * 0.01);
};
};
}
public function nextLevel(_arg1:String):void{
var _local2:MovieClip;
_local2 = new whiteFlash();
_local2.x = -5;
_local2.y = 0;
level++;
if (level > 4){
endGame("w");
removeChild(myJuke);
gotoAndStop("win");
addChild(_local2);
whiteFlashHolder = _local2;
return;
};
addChild(_local2);
whiteFlashHolder = _local2;
uptoObstacles++;
obstaclesRemaining = 15;
timeBetweenShootObstacles = (timeBetweenShootObstacles - 250);
timeBetweenObstacles = (timeBetweenObstacles - 250);
resetTimer(obstacleTimer, timeBetweenObstacles, newObstacle);
currentSpeed = (currentSpeed + 1);
}
function frame3(){
stop();
generateJuke();
removeChild(myJuke);
play();
}
public function newObstacle(_arg1:TimerEvent):void{
var _local2:int;
var _local3:int;
var _local4:Number;
var _local5:Class;
var _local6:MovieClip;
var _local7:Number;
if (obstaclesRemaining <= 0){
nextLevel("flash");
return;
};
if (level != 4){
_local2 = ((uptoObstacles - 1) * 3);
_local3 = (((uptoObstacles - 1) * 3) + 1);
} else {
_local7 = randomNumber(1, 3);
_local2 = ((_local7 - 1) * 3);
_local3 = (((_local7 - 1) * 3) + 1);
};
_local4 = randomNumber(_local2, _local3);
_local5 = (getDefinitionByName(obstaclesInfo[_local4].mc) as Class);
_local6 = new (_local5);
obstacles.push({mc:_local6, otype:obstaclesInfo[_local4].otype, playerHit:false});
_local6.x = obstaclesInfo[_local4].startX;
_local6.y = obstaclesInfo[_local4].startY;
addChild(_local6);
}
function frame1(){
stop();
loadPart.scaleX = 0;
addEventListener(Event.ENTER_FRAME, loadProgress);
}
function frame4(){
stop();
}
function frame6(){
stop();
initializeSelectScreen();
recordPlay();
}
public function S2submitScoreBtnClicked(_arg1:MouseEvent):void{
var _local2:String;
var _local3:URLVariables;
var _local4:URLRequest;
var _local5:URLLoader;
if (scoreSubmitted){
gameOverWindow.showText.text = "You have already submitted this score.";
return;
};
scoreSubmitted = true;
_local2 = (("http://www.orangefoxgames.com/high_scores_pwhrdf/submit_high_score_totw.php?cachebuster=" + new Date().getTime()) + new Date().getDate());
gameOverWindow.showText.text = "Submitting score...";
_local3 = new URLVariables();
_local3.check_code = "fdhjjhkgfgyy";
_local3.username = gameOverWindow.usernameInput.text;
_local3.password = gameOverWindow.passwordInput.text;
_local3.score_score = score;
_local4 = new URLRequest(_local2);
_local5 = new URLLoader();
_local5.dataFormat = URLLoaderDataFormat.VARIABLES;
_local4.data = _local3;
_local4.method = URLRequestMethod.POST;
_local5.addEventListener(Event.COMPLETE, handleComplete);
_local5.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
_local5.load(_local4);
}
function frame2(){
play();
}
function jukeBack(_arg1:Event):void{
SoundMixer.stopAll();
if (myJuke.currentFrame > 1){
myJuke.prevFrame();
} else {
myJuke.gotoAndStop("reset");
myJuke.gotoAndPlay((myJuke.totalFrames - 1));
};
}
public function initializeBackBtn():void{
addChild(myJuke);
backToMenuBtn.addEventListener(MouseEvent.CLICK, backToMenuBtnClicked);
}
function frame5(){
stop();
initializeMenu();
}
function frame9(){
stop();
initializeAboutScreen();
initializeBackBtn();
MovieClip(root).bringJukeToFront();
}
public function playBtnClicked(_arg1:MouseEvent):void{
cleanMenu();
gotoAndStop("characterSelect");
}
function frame8(){
stop();
initializeBackBtn();
}
public function keyDownFunction(_arg1:KeyboardEvent){
switch (_arg1.keyCode){
case 87:
startMove("jump");
break;
case 83:
startMove("duck");
break;
case 16:
startSlowMotion();
break;
};
}
public function startPointMultiplier():void{
dodgePoints = 20;
mult_graphic.gotoAndStop(2);
}
public function initializeAboutScreen():void{
ofgBtn.addEventListener(MouseEvent.CLICK, aboutofgBtnClicked);
totwBtn.addEventListener(MouseEvent.CLICK, abouttotwBtnClicked);
}
public function mutePlayClicked(_arg1:MouseEvent):void{
var _local2:SoundTransform;
soundMuted = true;
_local2 = new SoundTransform(0);
SoundMixer.soundTransform = _local2;
muteBtn.playBtn.removeEventListener(MouseEvent.CLICK, mutePlayClicked);
muteBtn.gotoAndStop(2);
}
function jukePlay(_arg1:Event):void{
SoundMixer.stopAll();
myJuke.gotoAndPlay("reset");
}
function frame7(){
stop();
initializeGame();
MovieClip(root).bringJukeToFront();
}
function frame10(){
stop();
initializeWinScreen();
MovieClip(root).bringJukeToFront();
}
public function setMediumHandler(_arg1:Event):void{
stage.quality = StageQuality.MEDIUM;
}
public function setCharacter(_arg1:int):void{
var _local2:Class;
_local2 = (getDefinitionByName(characterInfo[_arg1].mc) as Class);
player = new (_local2);
player.x = characterInfo[_arg1].startX;
player.y = characterInfo[_arg1].startY;
player.rotation = characterInfo[_arg1].startRotation;
addChild(player);
}
public function setupGameoverS1():void{
gameOverWindow.scoreDisplay.text = score;
gameOverWindow.submitScoreButton.addEventListener(MouseEvent.CLICK, S1submitScoreButtonClicked);
gameOverWindow.playAgainBtn.addEventListener(MouseEvent.CLICK, S1playAgainBtn);
gameOverWindow.visitTotwBtn.addEventListener(MouseEvent.CLICK, visitTotwBtnClicked);
}
public function setupGameoverS2():void{
gameOverWindow.scoreDisplay.text = score;
gameOverWindow.submitScoreBtn.addEventListener(MouseEvent.CLICK, S2submitScoreBtnClicked);
gameOverWindow.playAgainBtn.addEventListener(MouseEvent.CLICK, S2playAgainBtnClicked);
gameOverWindow.visitTotwBtn.addEventListener(MouseEvent.CLICK, visitTotwBtnClicked);
gameOverWindow.signUpBtn.addEventListener(MouseEvent.CLICK, S2signUpBtnClicked);
}
public function removeExplosion(_arg1:MovieClip):void{
removeChild(_arg1);
}
function removeLazer(_arg1:Number):void{
removeChild(bullets[_arg1].mc);
bullets.splice(_arg1, 1);
}
public function flickerPlayer(_arg1:TimerEvent):void{
if (MovieClip(root).player.alpha == 1){
MovieClip(root).player.alpha = 0.1;
} else {
MovieClip(root).player.alpha = 1;
};
if (_arg1.target.currentCount == _arg1.target.repeatCount){
characterFlickers = -1;
flickerTimer.stop();
MovieClip(root).player.alpha = 1;
};
}
public function checkFireGun(_arg1:Event):void{
if (getTimer() >= allowFire){
fireWeapon();
allowFire = (timeBetweenFire + getTimer());
};
}
public function highScoresBtnClicked(_arg1:MouseEvent):void{
popupSite("http://www.orangefoxgames.com/view_scores_top_of_the_web.php");
}
public function dodgedObstacle():void{
obstaclesRemaining--;
}
public function endPointMultiplier():void{
dodgePoints = 10;
mult_graphic.gotoAndStop(1);
}
public function recordPlay():void{
var url:String;
var request:URLRequest;
var variables:URLVariables;
var x:String;
var t:String;
url = (("http://www.orangefoxgames.com/admin/tracker.php?cachebuster=" + new Date().getTime()) + new Date().getDate());
try {
request = new URLRequest(url);
request.method = URLRequestMethod.POST;
variables = new URLVariables();
variables.giveurl = loaderInfo.url;
variables.game_id = 14;
request.data = variables;
} catch(e:Error) {
x = "k";
};
try {
sendToURL(request);
} catch(e:Error) {
t = "k";
};
}
public function startSlowMotion():void{
if (slowMotion){
return;
};
slowMotion = true;
stage.frameRate = 15;
}
public function loadProgress(_arg1:Event){
var _local2:int;
var _local3:int;
var _local4:Number;
_local2 = this.root.loaderInfo.bytesLoaded;
_local3 = this.root.loaderInfo.bytesTotal;
_local4 = ((100 * _local2) / _local3);
loadPart.scaleX = (_local4 * 0.01);
if (_local2 >= _local3){
removeEventListener(Event.ENTER_FRAME, loadProgress);
gotoAndStop(2);
};
}
public function removeObstacle(_arg1:int):void{
removeChild(obstacles[_arg1].mc);
obstacles.splice(_arg1, 1);
}
public function resetTimer(_arg1:Timer, _arg2:int, _arg3:Function):void{
_arg1.stop();
_arg1.delay = _arg2;
_arg1.start();
}
public function S2playAgainBtnClicked(_arg1:MouseEvent):void{
cleanSetupGameoverS2();
clearWinScreen();
removeChild(gameOverWindow);
gotoAndStop("menu");
}
public function visitTotwBtnClicked(_arg1:MouseEvent):void{
popupSite("http://www.totw.com");
}
public function initializeMenu():void{
addChild(myJuke);
playBtn.addEventListener(MouseEvent.CLICK, playBtnClicked);
instructionsBtn.addEventListener(MouseEvent.CLICK, instructionsBtnClicked);
moreGamesBtn.addEventListener(MouseEvent.CLICK, moreGamesBtnClicked);
aboutBtn.addEventListener(MouseEvent.CLICK, aboutBtnClicked);
highScoresBtn.addEventListener(MouseEvent.CLICK, highScoresBtnClicked);
if (soundMuted){
muteBtn.gotoAndStop(2);
};
}
public function endMove(_arg1:String):void{
if (isRunning){
return;
};
switch (_arg1){
case "duck":
isRunning = true;
isDucking = false;
player.gotoAndStop("run");
break;
case "jump":
isRunning = true;
isJumping = false;
player.gotoAndPlay("run");
break;
};
}
function jukeForward(_arg1:Event):void{
SoundMixer.stopAll();
if (myJuke.currentFrame < (myJuke.totalFrames - 1)){
myJuke.nextFrame();
} else {
myJuke.gotoAndPlay("reset");
};
}
public function generateJuke():void{
myJuke = new jukebox();
myJuke.x = 2;
myJuke.y = 2;
addChild(myJuke);
myJuke.playC.addEventListener(MouseEvent.CLICK, jukePlay);
myJuke.stopC.addEventListener(MouseEvent.CLICK, jukeStop);
myJuke.forwardC.addEventListener(MouseEvent.CLICK, jukeForward);
myJuke.backC.addEventListener(MouseEvent.CLICK, jukeBack);
}
public function updateScore(_arg1:int):void{
score = (score + _arg1);
score_display.text = score;
}
public function keyUpFunction(_arg1:KeyboardEvent){
switch (_arg1.keyCode){
case 16:
endSlowMotion();
break;
};
}
public function setMovingSelector(_arg1:Boolean):void{
movingSelector = _arg1;
}
public function cleanMenu():void{
removeChild(myJuke);
playBtn.removeEventListener(MouseEvent.CLICK, playBtnClicked);
}
public function startMove(_arg1:String):void{
if (currentSpeed == 0){
return;
};
if (!isRunning){
return;
};
switch (_arg1){
case "duck":
isRunning = false;
isDucking = true;
player.gotoAndStop("duck");
duckS.play();
break;
case "jump":
isRunning = false;
isJumping = true;
jumpTo = (player.y - 100);
jumpStart = player.y;
jumpAmount = -(startJumpAmount);
addToJump = 1;
player.gotoAndStop("jump");
jumpS.play();
break;
};
}
public function backToMenuBtnClicked(_arg1:MouseEvent):void{
removeChild(myJuke);
backToMenuBtn.removeEventListener(MouseEvent.CLICK, backToMenuBtnClicked);
gotoAndStop("menu");
}
public function setLowHandler(_arg1:Event):void{
stage.quality = StageQuality.LOW;
}
public function newExplosion(_arg1:Number, _arg2:Number):void{
var _local3:MovieClip;
var _local4:SoundChannel;
_local3 = new full_explosion();
_local3.x = _arg1;
_local3.y = _arg2;
addChild(_local3);
_local4 = explosionS.play();
}
public function updateLivesDisplay():void{
lives_display.text = lives;
}
public function endGame(_arg1:String):void{
currentSpeed = 0;
if (isDucking){
endMove("duck");
};
if (isJumping){
endMove("jump");
};
isRunning = false;
isJumping = false;
isDucking = false;
stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyDownFunction);
stage.removeEventListener(KeyboardEvent.KEY_UP, keyUpFunction);
obstacleTimer.removeEventListener(TimerEvent.TIMER, newObstacle);
obstacleTimer.stop();
shootObstacleTimer.removeEventListener(TimerEvent.TIMER, newShootObstacle);
shootObstacleTimer.stop();
flickerTimer.removeEventListener(TimerEvent.TIMER, flickerPlayer);
flickerTimer.stop();
removeChild(player);
player = null;
while (obstacles.length > 0) {
removeObstacle(0);
};
stage.quality = StageQuality.HIGH;
stage.removeEventListener(Event.ENTER_FRAME, moveWorld);
stage.removeEventListener(MouseEvent.CLICK, checkFireGun);
}
public function S1playAgainBtn(_arg1:MouseEvent):void{
cleanSetupGameoverS1();
clearWinScreen();
removeChild(gameOverWindow);
gotoAndStop("menu");
}
public function cleanSetupGameoverS1():void{
gameOverWindow.submitScoreButton.removeEventListener(MouseEvent.CLICK, S1submitScoreButtonClicked);
gameOverWindow.playAgainBtn.removeEventListener(MouseEvent.CLICK, S1playAgainBtn);
gameOverWindow.visitTotwBtn.removeEventListener(MouseEvent.CLICK, visitTotwBtnClicked);
}
public function cleanSetupGameoverS2():void{
gameOverWindow.submitScoreBtn.removeEventListener(MouseEvent.CLICK, S2submitScoreBtnClicked);
gameOverWindow.playAgainBtn.removeEventListener(MouseEvent.CLICK, S2playAgainBtnClicked);
gameOverWindow.visitTotwBtn.removeEventListener(MouseEvent.CLICK, visitTotwBtnClicked);
gameOverWindow.signUpBtn.removeEventListener(MouseEvent.CLICK, S2signUpBtnClicked);
}
public function selectCurrentCharacter(_arg1:KeyboardEvent):void{
if (movingSelector){
return;
};
selectedCharacter = characterIds[currentCharacter];
selector.left_arrow.removeEventListener(MouseEvent.CLICK, moveSelectLeft);
selector.right_arrow.removeEventListener(MouseEvent.CLICK, moveSelectRight);
stage.removeEventListener(KeyboardEvent.KEY_DOWN, selectCurrentCharacter);
gotoAndStop("game");
}
public function handleComplete(_arg1:Event):void{
var _local2:URLLoader;
_local2 = URLLoader(_arg1.target);
if (_local2.data.resultText == "submitted"){
gameOverWindow.showText.text = "Your high score has been submitted.";
popupSite("http://www.orangefoxgames.com/view_scores_top_of_the_web.php");
} else {
scoreSubmitted = false;
gameOverWindow.showText.text = _local2.data.resultText;
};
}
function jukeStop(_arg1:Event):void{
SoundMixer.stopAll();
}
public function doJump():void{
var _local1:Number;
player.y = (player.y + jumpAmount);
_local1 = player.y;
if (jumpAmount < 0){
jumpAmount = (jumpAmount + addToJump);
if (_local1 < jumpTo){
jumpAmount = 0;
};
} else {
jumpAmount = (jumpAmount + addToJump);
if (_local1 > jumpStart){
player.y = jumpStart;
endMove("jump");
};
};
}
public function setHighHandler(_arg1:Event):void{
stage.quality = StageQuality.HIGH;
}
public function S1submitScoreButtonClicked(_arg1:MouseEvent):void{
cleanSetupGameoverS1();
gameOverWindow.gotoAndStop(2);
}
public function aboutBtnClicked(_arg1:MouseEvent):void{
cleanMenu();
gotoAndStop("about");
}
public function initializeGame():void{
stage.quality = StageQuality.MEDIUM;
bullets = new Array();
timeBetweenFire = 1000;
lastFire = 0;
allowFire = 0;
dodgeStreak = 0;
dodgePoints = 10;
isRunning = true;
isJumping = false;
isDucking = false;
startJumpAmount = 15;
jumpAmount = -1;
groundWidth = ground_1.width;
currentSpeed = 12;
currentSpeedBegin = currentSpeed;
nextDepth = 2;
obstaclesRemaining = 15;
characterFlickers = -1;
nextFlicker = -1;
timeBetweenShootObstacles = 5000;
timeBetweenObstacles = 3000;
level = 1;
lives = 5;
score = 0;
slowMotion = false;
addToJump = 0;
uptoObstacles = 1;
obstacleMaxSpeed = 12;
obstacleSpeed = 0.2;
obstacleDestruct = 6000;
slowMoLeft = 100;
jumpTo = -1;
jumpStart = -1;
scoreSubmitted = false;
obstacleTimer = new Timer(timeBetweenObstacles);
obstacleTimer.addEventListener(TimerEvent.TIMER, newObstacle);
obstacleTimer.start();
shootObstacleTimer = new Timer(timeBetweenShootObstacles);
shootObstacleTimer.addEventListener(TimerEvent.TIMER, newShootObstacle);
shootObstacleTimer.start();
flickerTimer = new Timer(50, 40);
flickerTimer.addEventListener(TimerEvent.TIMER, flickerPlayer);
obstacles = new Array();
obstaclesInfo = new Array();
obstaclesInfo.push({mc:"obstacle_0", otype:"jump", startX:740, startY:170});
obstaclesInfo.push({mc:"obstacle_1", otype:"duck", startX:740, startY:25});
obstaclesInfo.push({mc:"obstacle_2", otype:"shoot", startX:740, startY:250});
obstaclesInfo.push({mc:"obstacle_3", otype:"jump", startX:740, startY:170});
obstaclesInfo.push({mc:"obstacle_4", otype:"duck", startX:740, startY:25});
obstaclesInfo.push({mc:"obstacle_5", otype:"shoot", startX:740, startY:45});
obstaclesInfo.push({mc:"obstacle_6", otype:"jump", startX:740, startY:170});
obstaclesInfo.push({mc:"obstacle_7", otype:"duck", startX:740, startY:25});
obstaclesInfo.push({mc:"obstacle_8", otype:"shoot", startX:740, startY:45});
characterInfo = new Array();
shootObs = new Array(2, 5, 8);
characterInfo.push({mc:"character_toilet_mc", startX:190.85, startY:289.35, startRotation:-15.7637176513672});
characterInfo.push({mc:"character_poo_mc", startX:193.4, startY:284, startRotation:-15.7637176513672});
characterInfo.push({mc:"character_sheep_mc", startX:193.4, startY:270, startRotation:-15.7637176513672});
setLevel(level);
setCharacter(selectedCharacter);
updateLivesDisplay();
updateScore(0);
jumpS = new jumpSound();
duckS = new duckSound();
explosionS = new explosionSound();
gunS = new gunSound();
hitS = new hitSound();
stage.addEventListener(Event.ENTER_FRAME, moveWorld);
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownFunction);
stage.addEventListener(KeyboardEvent.KEY_UP, keyUpFunction);
stage.addEventListener(MouseEvent.CLICK, checkFireGun);
addChild(myJuke);
}
public function moveGun():void{
var _local1:Point;
var _local2:Number;
var _local3:Number;
_local1 = new Point(0, 0);
_local1 = player.gun.localToGlobal(_local1);
_local2 = (mouseX - _local1.x);
_local3 = (mouseY - _local1.y);
radAngle = Math.atan2(_local3, _local2);
radAngle = (Math.round(((radAngle * 360) / PICALC)) - player.rotation);
player.gun.rotation = radAngle;
}
public function clearWinScreen():void{
if (MovieClip(root).currentLabel != "win"){
removeChild(dS);
return;
};
stage.removeEventListener(Event.ENTER_FRAME, moveWorldWin);
stage.removeEventListener(MouseEvent.CLICK, checkFireGun);
removeChild(player);
}
public function startFlickerPlayer():void{
flickerTimer.reset();
flickerTimer.start();
}
public function aboutofgBtnClicked(_arg1:Event):void{
popupSite("http://www.orangefoxgames.com");
}
public function onIOError(_arg1:IOErrorEvent):void{
}
public function instructionsBtnClicked(_arg1:MouseEvent):void{
cleanMenu();
gotoAndStop("instructions");
}
public function removeFlash():void{
removeChild(whiteFlashHolder);
whiteFlashHolder = null;
}
public function getLevel():int{
return (level);
}
public function moreGamesBtnClicked(_arg1:MouseEvent):void{
popupSite("http://www.totw.com");
}
public function initializeWinScreen():void{
var _local1:Class;
stage.addEventListener(Event.ENTER_FRAME, moveWorldWin);
stage.addEventListener(MouseEvent.CLICK, checkFireGun);
showGameOverWindow();
gameOverWindow.x = (0 + (gameOverWindow.width / 2));
gameOverWindow.y = (0 + (gameOverWindow.height / 2));
_local1 = (getDefinitionByName(characterInfo[selectedCharacter].mc) as Class);
player = new (_local1);
player.x = 310;
player.y = 215;
addChild(player);
jumpTo = (player.y - 100);
jumpStart = player.y;
jumpAmount = -(startJumpAmount);
addToJump = 1;
isJumping = true;
player.gotoAndStop("jump");
addChild(myJuke);
}
public function S2signUpBtnClicked(_arg1:MouseEvent):void{
popupSite("http://www.orangefoxgames.com/account_create.php");
}
public function doJumpWin():void{
var _local1:Number;
player.y = (player.y + jumpAmount);
_local1 = player.y;
if (jumpAmount < 0){
jumpAmount = (jumpAmount + addToJump);
if (_local1 < jumpTo){
jumpAmount = 0;
};
} else {
jumpAmount = (jumpAmount + addToJump);
if (_local1 > jumpStart){
player.y = jumpStart;
jumpTo = (player.y - 100);
jumpStart = player.y;
jumpAmount = -(startJumpAmount);
addToJump = 1;
};
};
}
public function moveSelectLeft(_arg1:MouseEvent):void{
mc = "l";
mc = ((currentCharacter + "_") + mc);
movingSelector = true;
selector.characters.gotoAndPlay(mc);
toggleArrows(1);
}
public function abouttotwBtnClicked(_arg1:Event):void{
popupSite("http://www.totw.com");
}
public function bringJukeToFront():void{
setChildIndex(myJuke, (numChildren - 1));
}
public function moveWorldWin(_arg1:Event):void{
var _local2:int;
var _local3:int;
var _local4:int;
_local2 = 0;
_local3 = 0;
_local4 = getTimer();
if (isJumping){
doJumpWin();
};
_local3 = bullets.length;
_local2 = 0;
while (_local2 < _local3) {
if (bullets[_local2].mc.lazer.currentFrame == 6){
removeLazer(_local2);
_local2--;
_local3--;
};
_local2++;
};
moveGun();
}
public function showGameOverWindow():void{
var _local1:MovieClip;
var _local2:MovieClip;
if (currentLabel == "game"){
_local2 = new deathShots();
_local2.x = 325;
_local2.y = 200;
addChild(_local2);
_local2.gotoAndStop((selectedCharacter + 1));
dS = _local2;
};
_local1 = new gameoverPopup();
_local1.x = 325;
_local1.y = 200;
addChild(_local1);
gameOverWindow = _local1;
}
public function goTotwRHandler(_arg1:Event):void{
popupSite("http://www.totw.com");
}
public function moveBackground():void{
ground_1.x = (ground_1.x - currentSpeed);
ground_2.x = (ground_2.x - currentSpeed);
ground_1.y = (ground_1.y + (currentSpeed / 2.8));
ground_2.y = (ground_2.y + (currentSpeed / 2.8));
if ((ground_1.x + groundWidth) < -10){
ground_1.x = ((ground_2.x + groundWidth) - 84);
ground_1.y = (-138.2 + 277);
return;
};
if ((ground_2.x + groundWidth) < -10){
ground_2.x = ((ground_1.x + groundWidth) - 84);
ground_2.y = (-138.2 + 277);
return;
};
}
public function moveSelectRight(_arg1:MouseEvent):void{
mc = "r";
mc = ((currentCharacter + "_") + mc);
movingSelector = true;
selector.characters.gotoAndPlay(mc);
toggleArrows(1);
}
public function loseLife():Boolean{
lives--;
if (lives <= 0){
updateLivesDisplay();
endGame("l");
showGameOverWindow();
return (true);
};
startFlickerPlayer();
characterFlickers = 1;
updateLivesDisplay();
return (false);
}
}
}//package
Section 47
//whiteFlash (whiteFlash)
package {
import flash.events.*;
import flash.utils.*;
import flash.display.*;
import flash.media.*;
import flash.text.*;
import flash.geom.*;
import flash.net.*;
import flash.ui.*;
import flash.accessibility.*;
import flash.errors.*;
import flash.filters.*;
import flash.system.*;
public dynamic class whiteFlash extends MovieClip {
public function whiteFlash(){
addFrameScript(4, frame5, 14, frame15);
}
function frame15(){
stop();
MovieClip(root).removeFlash();
}
function frame5(){
MovieClip(root).setLevel(MovieClip(root).getLevel());
}
}
}//package