Section 1
//KeyPoll (bigroom.input.KeyPoll)
package bigroom.input {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class KeyPoll {
private var states:ByteArray;
private var dispObj:DisplayObject;
public function KeyPoll(_arg1:DisplayObject){
states = new ByteArray();
states.writeUnsignedInt(0);
states.writeUnsignedInt(0);
states.writeUnsignedInt(0);
states.writeUnsignedInt(0);
states.writeUnsignedInt(0);
states.writeUnsignedInt(0);
states.writeUnsignedInt(0);
states.writeUnsignedInt(0);
dispObj = _arg1;
dispObj.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener, false, 0, true);
dispObj.addEventListener(KeyboardEvent.KEY_UP, keyUpListener, false, 0, true);
dispObj.addEventListener(Event.ACTIVATE, activateListener, false, 0, true);
dispObj.addEventListener(Event.DEACTIVATE, deactivateListener, false, 0, true);
}
public function isUp(_arg1:uint):Boolean{
return (((states[(_arg1 >>> 3)] & (1 << (_arg1 & 7))) == 0));
}
private function activateListener(_arg1:Event):void{
var _local2:int;
_local2 = 0;
while (_local2 < 8) {
states[_local2] = 0;
_local2++;
};
}
private function deactivateListener(_arg1:Event):void{
var _local2:int;
_local2 = 0;
while (_local2 < 8) {
states[_local2] = 0;
_local2++;
};
}
public function isDown(_arg1:uint):Boolean{
return (!(((states[(_arg1 >>> 3)] & (1 << (_arg1 & 7))) == 0)));
}
private function keyDownListener(_arg1:KeyboardEvent):void{
states[(_arg1.keyCode >>> 3)] = (states[(_arg1.keyCode >>> 3)] | (1 << (_arg1.keyCode & 7)));
}
private function keyUpListener(_arg1:KeyboardEvent):void{
states[(_arg1.keyCode >>> 3)] = (states[(_arg1.keyCode >>> 3)] & ~((1 << (_arg1.keyCode & 7))));
}
}
}//package bigroom.input
Section 2
//arcadetown_splash_34 (xmas_fla.arcadetown_splash_34)
package xmas_fla {
import flash.display.*;
public dynamic class arcadetown_splash_34 extends MovieClip {
public function arcadetown_splash_34(){
addFrameScript(148, frame149);
}
function frame149(){
MovieClip(parent).gotoAndPlay(14);
stop();
}
}
}//package xmas_fla
Section 3
//exporter_clip_33 (xmas_fla.exporter_clip_33)
package xmas_fla {
import flash.display.*;
public dynamic class exporter_clip_33 extends MovieClip {
public function exporter_clip_33(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package xmas_fla
Section 4
//fake_player_22 (xmas_fla.fake_player_22)
package xmas_fla {
import flash.display.*;
public dynamic class fake_player_22 extends MovieClip {
public var Player_hit:MovieClip;
public function fake_player_22(){
addFrameScript(0, frame1);
}
function frame1(){
stop();
}
}
}//package xmas_fla
Section 5
//help_back_41 (xmas_fla.help_back_41)
package xmas_fla {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public dynamic class help_back_41 extends MovieClip {
public var my_site:SimpleButton;
public var next_button:SimpleButton;
public function help_back_41(){
addFrameScript(0, frame1, 1, frame2, 2, frame3, 3, frame4, 4, frame5);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame4(){
stop();
}
function frame5(){
my_site.addEventListener(MouseEvent.MOUSE_DOWN, mysite_clicked);
stop();
}
function frame2(){
stop();
}
public function mysite_clicked(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.cursesfoiled.co.uk");
navigateToURL(_local2, "_blank");
}
}
}//package xmas_fla
Section 6
//mute_button_46 (xmas_fla.mute_button_46)
package xmas_fla {
import flash.display.*;
public dynamic class mute_button_46 extends MovieClip {
public function mute_button_46(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package xmas_fla
Section 7
//Player_44 (xmas_fla.Player_44)
package xmas_fla {
import flash.display.*;
public dynamic class Player_44 extends MovieClip {
public var Player_hit:MovieClip;
public function Player_44(){
addFrameScript(0, frame1, 1, frame2);
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package xmas_fla
Section 8
//preloader_29 (xmas_fla.preloader_29)
package xmas_fla {
import flash.display.*;
public dynamic class preloader_29 extends MovieClip {
public var loader_mask:MovieClip;
}
}//package xmas_fla
Section 9
//quality_button_48 (xmas_fla.quality_button_48)
package xmas_fla {
import flash.display.*;
public dynamic class quality_button_48 extends MovieClip {
public function quality_button_48(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
function frame3(){
stop();
}
function frame1(){
stop();
}
function frame2(){
stop();
}
}
}//package xmas_fla
Section 10
//ATHelpers (ATHelpers)
package {
public class ATHelpers {
public static function GetBaseUrl(_arg1){
var _local2:String;
var _local3:int;
var _local4:int;
var _local5:String;
_local2 = _arg1.toLowerCase();
_local3 = _local2.length;
_local4 = _local2.indexOf("?", 0);
if (_local4 > 0){
_local3 = _local4;
};
_local5 = "download";
if (_local2.substr(0, 4) == "http"){
_local5 = _arg1.substr(7, (_local3 - 7));
};
return (_local5);
}
public static function EncrpytString(_arg1:String){
var _local2:String;
var _local3:int;
var _local4:String;
var _local5:String;
var _local6:int;
var _local7:int;
var _local8:int;
var _local9:int;
var _local10:int;
var _local11:int;
var _local12:int;
_local2 = "aHfEjcDebChGiAfIjDbEjacD";
_local3 = _local2.length;
_local4 = "0";
_local5 = "";
_local6 = _arg1.length;
_local7 = 0;
_local11 = 0;
_local12 = 0;
while (_local12 < _local6) {
_local8 = _arg1.charCodeAt(_local12);
if (_local8 >= 128){
_local8 = 88;
};
_local9 = _local2.charCodeAt(_local7);
_local7 = (_local7 + 1);
if (_local7 >= _local3){
_local7 = 0;
};
_local10 = ((_local8 % 16) + _local9);
_local5 = (_local5 + String.fromCharCode(_local10));
_local11 = (_local11 + _local10);
_local9 = _local2.charCodeAt(_local7);
_local7 = (_local7 + 1);
if (_local7 >= _local3){
_local7 = 0;
};
_local10 = (Math.floor((_local8 / 16)) + _local9);
_local5 = (_local5 + String.fromCharCode(_local10));
_local11 = (_local11 + _local10);
_local12++;
};
_local11 = (_local11 % 0x0100);
_local9 = _local2.charCodeAt(_local7);
_local7 = (_local7 + 1);
if (_local7 >= _local3){
_local7 = 0;
};
_local10 = ((_local11 % 16) + _local9);
_local5 = (_local5 + String.fromCharCode(_local10));
_local9 = _local2.charCodeAt(_local7);
_local7 = (_local7 + 1);
if (_local7 >= _local3){
_local7 = 0;
};
_local10 = (Math.floor((_local11 / 16)) + _local9);
_local5 = (_local5 + String.fromCharCode(_local10));
return (_local5);
}
public static function generateHighscoreURL(_arg1:String){
var _local2:String;
_local2 = (("http://www.arcadetown.com/" + _arg1) + "/view_high_scores.asp");
return (_local2);
}
public static function GetUrlParam(_arg1:String, _arg2:String){
var _local3:String;
var _local4:int;
var _local5:int;
var _local6:int;
var _local7:int;
_local3 = _arg1.toLowerCase();
_local4 = _local3.indexOf(_arg2);
_local5 = _arg2.length;
if (_local4 > 0){
_local7 = _local3.indexOf("&", (_local4 + _local5));
if (_local7 > 0){
_local6 = (_local7 - _local4);
} else {
_local6 = (_arg1.length - _local4);
};
return (_arg1.substr((_local4 + _local5), _local6));
};
return ("");
}
public static function generateHighscoreSubmission(_arg1:String, _arg2:String, _arg3:int){
var _local4:String;
var _local5:String;
var _local6:String;
_local4 = ((_arg2 + "|") + _arg3);
_local5 = EncrpytString(_local4);
_local6 = ((("http://www.arcadetown.com/" + _arg1) + "/hs.asp?") + _local5);
return (_local6);
}
}
}//package
Section 11
//Beam (Beam)
package {
import flash.display.*;
import flash.events.*;
public class Beam extends MovieClip {
public var life:Number;
public var dead;
public var dy;
public var dx;
public var light_gfx:MovieClip;
public function Beam(_arg1, _arg2:Number){
this.x = _arg1;
this.y = _arg2;
this.dead = 0;
this.life = 30;
addEventListener(Event.ENTER_FRAME, updateBeam);
}
public function deleteBeam(){
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, updateBeam);
}
public function updateBeam(_arg1:Event){
this.life = (this.life - 1);
if (this.life <= 0){
deleteBeam();
};
}
}
}//package
Section 12
//black_screen (black_screen)
package {
import flash.display.*;
public dynamic class black_screen extends MovieClip {
public var score_button:SimpleButton;
public var retry_button:SimpleButton;
public function black_screen(){
addFrameScript(59, frame60);
}
function frame60(){
stop();
}
}
}//package
Section 13
//Block (Block)
package {
import flash.display.*;
import flash.events.*;
public class Block extends MovieClip {
public var dead:Number;
public var dy;
public var dx;
public function Block(_arg1, _arg2:Number){
this.x = _arg1;
this.y = _arg2;
this.dead = 0;
addEventListener(Event.ENTER_FRAME, updateBlock);
}
public function updateBlock(_arg1:Event){
if (this.y > 380){
this.y = (this.y - (0.1 * MovieClip(parent).timePassed));
};
if (this.y < 380){
this.y = 380;
};
if (dead > 0){
y = 400;
};
}
public function deleteBlock(){
MovieClip(parent).removeBlock(this);
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, updateBlock);
}
}
}//package
Section 14
//block_hit_wav (block_hit_wav)
package {
import flash.media.*;
public dynamic class block_hit_wav extends Sound {
}
}//package
Section 15
//block_poof (block_poof)
package {
import flash.display.*;
import flash.events.*;
public class block_poof extends MovieClip {
private var life:Number;
private var frame1:int;
private var dy;
private var dx;
public function block_poof(_arg1, _arg2:Number){
this.x = _arg1;
this.y = _arg2;
this.life = 30;
this.rotation = (Math.random() * 360);
this.frame1 = 0;
addEventListener(Event.ENTER_FRAME, moveblock_poof);
}
public function moveblock_poof(_arg1:Event){
this.life = (this.life - 1);
if (this.life < 1){
deleteblock_poof();
};
}
public function deleteblock_poof(){
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, moveblock_poof);
}
}
}//package
Section 16
//Carrot (Carrot)
package {
import flash.display.*;
import flash.events.*;
public class Carrot extends MovieClip {
public var Carrot_hit:MovieClip;
private var dead:Number;
private var dy;
public var combo:Number;
private var dx;
public function Carrot(_arg1, _arg2:Number, _arg3:Number, _arg4:Number){
this.x = _arg1;
this.y = _arg2;
this.dead = 0;
this.combo = 1;
this.rotation = _arg3;
dx = (_arg4 * Math.cos((((2 * Math.PI) * (_arg3 - 90)) / 360)));
dy = (_arg4 * Math.sin((((2 * Math.PI) * (_arg3 - 90)) / 360)));
addEventListener(Event.ENTER_FRAME, moveCarrot);
}
public function deleteCarrot(){
MovieClip(parent).removeCarrot(this);
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, moveCarrot);
}
public function moveCarrot(_arg1:Event){
this.x = (this.x + (dx * MovieClip(parent).timePassed));
this.y = (this.y + (dy * MovieClip(parent).timePassed));
if (this.y < -20){
dead = 1;
};
if (this.x < -20){
dead = 1;
};
if (this.x > 500){
dead = 1;
};
if (dead > 0){
deleteCarrot();
};
}
}
}//package
Section 17
//carrot_wav (carrot_wav)
package {
import flash.media.*;
public dynamic class carrot_wav extends Sound {
}
}//package
Section 18
//Checker (Checker)
package {
import flash.display.*;
import flash.events.*;
public class Checker extends MovieClip {
public var life:Number;
public var dead;
public var checker_type;
public var dy;
public var dx;
public function Checker(_arg1, _arg2:Number, _arg3:Number){
this.x = _arg1;
this.y = _arg2;
this.dead = 0;
this.life = 5;
this.checker_type = _arg3;
addEventListener(Event.ENTER_FRAME, updateChecker);
}
public function deleteChecker(){
MovieClip(parent).removeChecker(this);
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, updateChecker);
}
public function updateChecker(_arg1:Event){
this.scaleX = (this.scaleX + (0.2 * MovieClip(parent).timePassed));
if (this.scaleX > 80){
dead = 1;
};
if (dead > 0){
deleteChecker();
};
}
}
}//package
Section 19
//Explosion (Explosion)
package {
import flash.display.*;
import flash.events.*;
public class Explosion extends MovieClip {
private var life:Number;
private var frame1:int;
private var dy;
private var dx;
public function Explosion(_arg1, _arg2:Number, _arg3:Number){
this.x = _arg1;
this.y = _arg2;
this.life = 15;
this.rotation = (Math.random() * 360);
this.frame1 = 0;
addEventListener(Event.ENTER_FRAME, moveExplosion);
}
public function moveExplosion(_arg1:Event){
this.life = (this.life - 1);
if (this.life < 1){
deleteExplosion();
};
}
public function RGB(_arg1:Number, _arg2:Number, _arg3:Number){
return (((_arg3 | (_arg2 << 8)) | (_arg1 << 16)));
}
public function deleteExplosion(){
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, moveExplosion);
}
}
}//package
Section 20
//MochiBot (MochiBot)
package {
import flash.display.*;
import flash.net.*;
import flash.system.*;
public dynamic class MochiBot extends Sprite {
public static function track(_arg1:Sprite, _arg2:String):MochiBot{
var _local3:MochiBot;
var _local4:String;
var _local5:URLVariables;
var _local6:String;
var _local7:URLRequest;
var _local8:Loader;
if (Security.sandboxType == "localWithFile"){
return (null);
};
_local3 = new (MochiBot);
_arg1.addChild(_local3);
Security.allowDomain("*");
Security.allowInsecureDomain("*");
_local4 = "http://core.mochibot.com/my/core.swf";
_local5 = new URLVariables();
_local5["sb"] = Security.sandboxType;
_local5["v"] = Capabilities.version;
_local5["swfid"] = _arg2;
_local5["mv"] = "8";
_local5["fv"] = "9";
_local6 = _local3.root.loaderInfo.loaderURL;
if (_local6.indexOf("http") == 0){
_local5["url"] = _local6;
} else {
_local5["url"] = "local";
};
_local7 = new URLRequest(_local4);
_local7.contentType = "application/x-www-form-urlencoded";
_local7.method = URLRequestMethod.POST;
_local7.data = _local5;
_local8 = new Loader();
_local3.addChild(_local8);
_local8.load(_local7);
return (_local3);
}
}
}//package
Section 21
//music (music)
package {
import flash.media.*;
public dynamic class music extends Sound {
}
}//package
Section 22
//Point_burst (Point_burst)
package {
import flash.display.*;
import flash.events.*;
import flash.text.*;
public class Point_burst extends MovieClip {
private var life:Number;
private var dead;
public var combo:Number;
private var score;
public var point_amount:TextField;
public function Point_burst(_arg1, _arg2:Number, _arg3:Number, _arg4:Number=0){
this.x = _arg1;
this.y = _arg2;
this.dead = 0;
this.life = 30;
this.score = _arg3;
this.point_amount.text = String(_arg3);
this.blendMode = BlendMode.ADD;
this.addChild(point_amount);
this.scaleX = ((0.8 + ((_arg3 / 50) / 16)) + _arg4);
this.scaleY = ((0.8 + ((_arg3 / 50) / 16)) + _arg4);
addEventListener(Event.ENTER_FRAME, movePoints);
}
public function movePoints(_arg1:Event){
this.y = (this.y - (0.05 * MovieClip(parent).timePassed));
this.alpha = (this.alpha - (0.002 * MovieClip(parent).timePassed));
life = (life - (0.05 * MovieClip(parent).timePassed));
if (life < 1){
dead = 1;
};
if (dead > 0){
deletePoints();
};
}
public function deletePoints(){
removeEventListener(Event.ENTER_FRAME, movePoints);
parent.removeChild(this);
}
}
}//package
Section 23
//Present (Present)
package {
import flash.display.*;
import flash.events.*;
public class Present extends MovieClip {
public var active1:Number;
public var present_type;
public var speed;
public var dead;
public var rot;
public var Present_hit:MovieClip;
public function Present(_arg1, _arg2:Number, _arg3:Number, _arg4:Number){
addFrameScript(0, frame1, 1, frame2, 5, frame6);
this.x = _arg1;
this.y = _arg2;
this.dead = 0;
this.active1 = 1;
this.speed = _arg3;
this.present_type = _arg4;
this.rot = Math.floor((Math.random() * 360));
this.gotoAndPlay(_arg4);
addEventListener(Event.ENTER_FRAME, movePresent);
}
function frame6(){
gotoAndPlay(3);
}
function frame2(){
stop();
}
public function deletePresent(){
MovieClip(parent).removePresent(this);
parent.removeChild(this);
removeEventListener(Event.ENTER_FRAME, movePresent);
}
function frame1(){
stop();
}
public function movePresent(_arg1:Event){
var _local2:Point_burst;
this.y = (this.y + (speed * MovieClip(parent).timePassed));
this.rotation = (Math.sin((this.rot + (y / 20))) * 10);
if (this.y > 500){
dead = 1;
};
if (this.y > 380){
if (active1 == 1){
if (MovieClip(parent).game_over != 1){
_local2 = new Point_burst((this.x + 10), (this.y + 10), -25, 0.5);
MovieClip(parent).addChild(_local2);
MovieClip(parent).score = (MovieClip(parent).score - 25);
active1 = 0;
};
};
};
if (dead > 0){
deletePresent();
};
}
}
}//package
Section 24
//present_hit_1 (present_hit_1)
package {
import flash.media.*;
public dynamic class present_hit_1 extends Sound {
}
}//package
Section 25
//present_hit_2 (present_hit_2)
package {
import flash.media.*;
public dynamic class present_hit_2 extends Sound {
}
}//package
Section 26
//present_hit_3 (present_hit_3)
package {
import flash.media.*;
public dynamic class present_hit_3 extends Sound {
}
}//package
Section 27
//present_hit_4 (present_hit_4)
package {
import flash.media.*;
public dynamic class present_hit_4 extends Sound {
}
}//package
Section 28
//revive_wav (revive_wav)
package {
import flash.media.*;
public dynamic class revive_wav extends Sound {
}
}//package
Section 29
//revive2_wav (revive2_wav)
package {
import flash.media.*;
public dynamic class revive2_wav extends Sound {
}
}//package
Section 30
//Sparkle (Sparkle)
package {
import flash.display.*;
public dynamic class Sparkle extends MovieClip {
}
}//package
Section 31
//xmas (xmas)
package {
import flash.display.*;
import flash.events.*;
import bigroom.input.*;
import flash.utils.*;
import flash.media.*;
import flash.text.*;
import flash.ui.*;
import flash.net.*;
public class xmas extends MovieClip {
public var mute_button:MovieClip;
private var mute:Number;// = 0
private var game_ended:Number;// = 0
public var AT_logo:MovieClip;
private var present_type:Number;// = 1
public var speed_debug:TextField;
private var key:KeyPoll;
public var name_text:TextField;
var st:SoundTransform;
private var corFactor:int;
public var preloader:MovieClip;
private var lastTime:uint;// = 1
private var carrotSpeed:Number;// = 1
public var Score:TextField;
public var BG1:MovieClip;
public var final_score:TextField;
public var score:Number;// = 0
public var BG2:MovieClip;
private var fps_counter:Number;
private var dir:Number;// = -1
public var Generator:MovieClip;
public var lamp_1_on:MovieClip;
var snd_revive2:revive2_wav;
private var present_timer:Number;// = 0
private var stage_quality:Number;// = 2
var music_ch:SoundChannel;
public var q_button:MovieClip;
public var FPS:TextField;
var music_st:SoundTransform;
private var left_check;
private var shoot_time:Number;// = 0
var snd_present3:present_hit_3;
var snd_present4:present_hit_4;
public var tree_no_lights:MovieClip;
public var Player:MovieClip;
public var view_scores:SimpleButton;
public var hedges1:MovieClip;
public var hedges2:MovieClip;
public var hedges3:MovieClip;
var snd_revive:revive_wav;
public var please_enter_name:MovieClip;
public var game_over:Number;// = 0
private var score_difference:Number;// = 0
var snd_carrot:carrot_wav;
public var help_back:MovieClip;
var snd_present2:present_hit_2;
public var myMenu:ContextMenu;
private var right_check:Number;
private var top_score:Number;// = 20000
var snd_present1:present_hit_1;
public var submit_button:SimpleButton;
public var lamp_1_off:MovieClip;
var channel:SoundChannel;
private var presents:Array;
public var house1_off:MovieClip;
private var carrots:Array;
public var tree_group1:MovieClip;
public var tree_group2:MovieClip;
public var more_games:SimpleButton;
public var thank_you:MovieClip;
private var game_over_screen:black_screen;
private var checkers:Array;
private var next_present:Number;// = 1000
public var back_button:SimpleButton;
var snd_block_hit:block_hit_wav;
private var blocks:Array;
public var timePassed:Number;
public var last_score:Number;// = 0
public var add_games:SimpleButton;
public var start_button:SimpleButton;
private var present_speed:Number;// = 1
public var house1_on:MovieClip;
var snd_music:Sound;
public var tree_lights:MovieClip;
private var playerSpeed:Number;// = 0.2
public var at_menu:SimpleButton;
public var help_button:SimpleButton;
private var FPSTimer:Timer;
public function xmas(){
score = 0;
top_score = 20000;
score_difference = 0;
blocks = new Array();
carrots = new Array();
presents = new Array();
checkers = new Array();
key = new KeyPoll(stage);
shoot_time = 0;
present_timer = 0;
next_present = 1000;
present_speed = 1;
present_type = 1;
playerSpeed = 0.2;
carrotSpeed = 1;
lastTime = 1;
game_over = 0;
game_ended = 0;
FPSTimer = new Timer(1000);
last_score = 0;
stage_quality = 2;
mute = 0;
snd_present1 = new present_hit_1();
snd_present2 = new present_hit_2();
snd_present3 = new present_hit_3();
snd_present4 = new present_hit_4();
snd_block_hit = new block_hit_wav();
snd_revive = new revive_wav();
snd_revive2 = new revive2_wav();
snd_carrot = new carrot_wav();
snd_music = new Sound();
channel = new SoundChannel();
music_ch = new SoundChannel();
dir = -1;
st = new SoundTransform(0.8, 0);
music_st = new SoundTransform(1, 0);
super();
addFrameScript(0, frame1, 12, frame13, 13, frame14, 29, frame30, 30, frame31, 39, frame40, 49, frame50, 59, frame60);
}
function mute_clicked(_arg1:Event){
switch (mute){
case 0:
st.volume = 0;
music_st.volume = 0;
music_ch.soundTransform = music_st;
mute_button.gotoAndStop(2);
mute = 1;
break;
case 1:
music_st.volume = 1;
music_ch.soundTransform = music_st;
st.volume = 0.8;
mute_button.gotoAndStop(1);
mute = 0;
break;
};
}
public function addgame_clicked(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.arcadetown.com/free_content/index.asp");
navigateToURL(_local2, "_blank");
}
public function recoverBlocks(){
var _local1:Checker;
channel = snd_revive.play();
channel.soundTransform = st;
_local1 = new Checker(Player.x, 410, 2);
addChild(_local1);
checkers.push(_local1);
destroyPresents();
}
public function restart_game(_arg1:Event){
var _local2:int;
var _local3:int;
_local2 = (presents.length - 1);
while (_local2 >= 0) {
presents[_local2].dead = 1;
_local2--;
};
_local3 = (blocks.length - 1);
while (_local3 >= 0) {
blocks[_local3].deleteBlock();
_local3--;
};
BG1.alpha = 1;
BG2.alpha = 1;
lamp_1_off.alpha = 0;
lamp_1_on.alpha = 0;
tree_no_lights.alpha = 0;
tree_lights.alpha = 0;
house1_off.alpha = 0;
house1_on.alpha = 0;
tree_group1.alpha = 0;
tree_group2.alpha = 0;
hedges1.alpha = 1;
hedges2.alpha = 1;
removeChild(game_over_screen);
score = 0;
removeEventListener(Event.ENTER_FRAME, updateGame);
FPSTimer.removeEventListener(TimerEvent.TIMER, fps_update);
gotoAndPlay(14);
}
function frame14(){
add_games.addEventListener(MouseEvent.MOUSE_DOWN, addgame_clicked);
at_menu.addEventListener(MouseEvent.MOUSE_DOWN, at_menu_clicked);
startMenu();
help_back.visible = false;
}
function q_clicked(_arg1:Event){
switch (stage_quality){
case 1:
stage.quality = "Medium";
stage_quality = 2;
q_button.gotoAndStop(1);
break;
case 2:
stage.quality = "High";
stage_quality = 3;
q_button.gotoAndStop(2);
break;
case 3:
stage.quality = "Low";
stage_quality = 1;
q_button.gotoAndStop(3);
break;
};
}
public function updateGame(_arg1:Event){
var _local2:int;
var _local3:int;
var _local4:Carrot;
var _local5:Present;
var _local6:Present;
var _local7:Present;
var _local8:int;
var _local9:Beam;
Generator.x = (Math.floor((((Math.random() * 6) - (Math.random() * 6)) + (Player.x / 20))) * 20);
if (Generator.x < 0){
Generator.x = 0;
};
if (Generator.x > 380){
Generator.x = 380;
};
if (game_over == 1){
music_st.volume = (music_st.volume - 0.01);
music_ch.soundTransform = music_st;
};
if (music_st.volume < 0){
music_st.volume = 0;
};
if (st.volume == 0.8){
mute_button.gotoAndStop(1);
};
if (st.volume == 0){
mute_button.gotoAndStop(2);
};
if (lastTime == 0){
lastTime = getTimer();
};
timePassed = (getTimer() - lastTime);
lastTime = (lastTime + timePassed);
score_difference = ((top_score - score) / top_score);
next_present = (10 + (score_difference * 30));
if (next_present < 10){
next_present = 10;
};
present_speed = ((10 - (score_difference * 8)) / 30);
playerSpeed = (0.15 + ((1 - score_difference) * 0.15));
present_timer = (present_timer + (0.05 * timePassed));
if (present_speed > 0.2){
present_speed = 0.2;
};
if (playerSpeed > 0.3){
playerSpeed = 0.3;
};
speed_debug.text = String(present_speed);
if (BG1.alpha > 0){
if (score > 5000){
BG1.alpha = (BG1.alpha - 0.01);
hedges1.alpha = (hedges1.alpha - 0.01);
};
if (BG1.alpha == 0){
};
};
if (BG2.alpha > 0){
if (score > 10000){
BG2.alpha = (BG2.alpha - 0.01);
hedges2.alpha = (hedges2.alpha - 0.01);
};
if (BG2.alpha == 0){
};
};
if (lamp_1_off.alpha < 1){
if (score > 1000){
lamp_1_off.alpha = (lamp_1_off.alpha + 0.01);
};
};
if (lamp_1_on.alpha < 1){
if (score > 6000){
lamp_1_on.alpha = (lamp_1_on.alpha + 0.01);
};
};
if (tree_no_lights.alpha < 1){
if (score > 2000){
tree_no_lights.alpha = (tree_no_lights.alpha + 0.01);
};
};
if (tree_lights.alpha < 1){
if (score > 13000){
tree_lights.alpha = (tree_lights.alpha + 0.01);
};
};
if (house1_off.alpha < 1){
if (score > 3000){
house1_off.alpha = (house1_off.alpha + 0.01);
};
};
if (house1_on.alpha < 1){
if (score > 11000){
house1_on.alpha = (house1_on.alpha + 0.01);
};
};
if (tree_group1.alpha < 1){
if (score > 8000){
tree_group1.alpha = (tree_group1.alpha + 0.01);
};
};
if (tree_group2.alpha < 1){
if (score > 9000){
tree_group2.alpha = (tree_group2.alpha + 0.01);
};
};
left_check = 0;
right_check = 0;
_local2 = (blocks.length - 1);
while (_local2 >= 0) {
if (blocks[_local2].hitTestPoint((Player.x - 5), (Player.y + 1), false)){
left_check = 1;
};
if (blocks[_local2].hitTestPoint((Player.x + 5), (Player.y + 1), false)){
right_check = 1;
};
_local2--;
};
if (game_over == 1){
Player.y = (Player.y + 1);
};
if (game_over != 1){
if (key.isDown(Keyboard.LEFT)){
if (left_check){
Player.x = (Player.x - (playerSpeed * timePassed));
};
dir = -1;
};
if (key.isDown(Keyboard.RIGHT)){
if (right_check){
Player.x = (Player.x + (playerSpeed * timePassed));
};
dir = 1;
};
if (!key.isDown(Keyboard.SPACE)){
shoot_time = 0;
};
if (key.isDown(Keyboard.SPACE)){
if (shoot_time < 1){
_local4 = new Carrot(Player.x, (Player.y - 16), (45 * dir), carrotSpeed);
addChild(_local4);
carrots.push(_local4);
shoot_time = 1;
channel = snd_carrot.play();
channel.soundTransform = st;
score = (score - 10);
};
};
if (present_timer > next_present){
present_timer = 0;
if ((((present_type > 0)) && ((present_type < 80)))){
_local5 = new Present(Generator.x, (Generator.y - 16), (present_speed + ((Math.random() * 0.05) - (Math.random() * 0.05))), 1);
addChild(_local5);
presents.push(_local5);
};
if ((((((present_type > 79)) && ((present_type < 95)))) && ((score > 2000)))){
_local6 = new Present(Generator.x, (Generator.y - 16), (present_speed + ((Math.random() * 0.05) - (Math.random() * 0.05))), 2);
addChild(_local6);
presents.push(_local6);
};
if ((((((present_type > 94)) && ((present_type < 100)))) && ((score > 5000)))){
_local7 = new Present(Generator.x, (Generator.y - 16), (present_speed + ((Math.random() * 0.05) - (Math.random() * 0.05))), 3);
addChild(_local7);
presents.push(_local7);
};
present_type = (1 + Math.floor((Math.random() * 100)));
};
if (dir == -1){
Player.gotoAndStop(1);
};
if (dir == 1){
Player.gotoAndStop(2);
};
if (Player.x < 10){
Player.x = 10;
};
if (Player.x > 388){
Player.x = 388;
};
};
_local3 = (checkers.length - 1);
while (_local3 >= 0) {
_local8 = (blocks.length - 1);
while (_local8 >= 0) {
if (blocks[_local8].hitTestObject(checkers[_local3])){
if (checkers[_local3].checker_type == 1){
checkers[_local3].dead = 1;
};
if (blocks[_local8].dead == 1){
blocks[_local8].dead = 0;
_local9 = new Beam((blocks[_local8].x + 1), 400);
addChild(_local9);
checkers[_local3].life = (checkers[_local3].life - 1);
if (checkers[_local3].life < 1){
checkers[_local3].dead = 1;
};
};
};
_local8--;
};
_local3--;
};
checkForCarrotHits();
checkForBlockHits();
checkForPlayerHits();
Score.text = ("Score: " + score);
fps_counter++;
channel.soundTransform = st;
}
function frame13(){
AT_logo.addEventListener(MouseEvent.MOUSE_DOWN, logo_clicked);
stop();
}
public function removeBlock(_arg1:Block){
var _local2:*;
for (_local2 in blocks) {
if (blocks[_local2] == _arg1){
blocks.splice(_local2, 1);
break;
};
};
}
function frame1(){
this.stop();
MochiBot.track(this, "28f91419");
MochiBot.track(this, "f4b7521e");
this.stop();
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS, PL_LOADING);
myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
this.contextMenu = myMenu;
stop();
}
public function removeChecker(_arg1:Checker){
var _local2:*;
for (_local2 in checkers) {
if (checkers[_local2] == _arg1){
checkers.splice(_local2, 1);
break;
};
};
}
function frame31(){
stop();
startGame();
}
function frame40(){
stop();
}
function frame30(){
stop();
}
public function score_screen(_arg1:Event){
var _local2:int;
var _local3:int;
_local2 = (presents.length - 1);
while (_local2 >= 0) {
presents[_local2].dead = 1;
_local2--;
};
_local3 = (blocks.length - 1);
while (_local3 >= 0) {
blocks[_local3].deleteBlock();
_local3--;
};
BG1.alpha = 1;
BG2.alpha = 1;
lamp_1_off.alpha = 0;
lamp_1_on.alpha = 0;
tree_no_lights.alpha = 0;
tree_lights.alpha = 0;
house1_off.alpha = 0;
house1_on.alpha = 0;
tree_group1.alpha = 0;
tree_group2.alpha = 0;
hedges1.alpha = 1;
hedges2.alpha = 1;
removeChild(game_over_screen);
last_score = score;
score = 0;
removeEventListener(Event.ENTER_FRAME, updateGame);
FPSTimer.removeEventListener(TimerEvent.TIMER, fps_update);
gotoAndStop(50);
}
function frame50(){
submit_button.visible = true;
thank_you.visible = false;
please_enter_name.visible = true;
name_text.visible = true;
final_score.visible = true;
submit_button.addEventListener(MouseEvent.MOUSE_DOWN, submit_score);
back_button.addEventListener(MouseEvent.MOUSE_DOWN, go_back);
view_scores.addEventListener(MouseEvent.MOUSE_DOWN, show_scores_page);
stop();
final_score.text = String(last_score);
}
public function next_clicked(_arg1:Event){
if (help_back.currentFrame == 5){
help_back.visible = false;
};
help_back.nextFrame();
}
public function startMenu(){
more_games.addEventListener(MouseEvent.MOUSE_DOWN, moregames_clicked);
start_button.addEventListener(MouseEvent.MOUSE_DOWN, start_clicked);
help_button.addEventListener(MouseEvent.MOUSE_DOWN, help_clicked);
help_back.next_button.addEventListener(MouseEvent.MOUSE_DOWN, next_clicked);
}
function fps_update(_arg1:TimerEvent):void{
FPS.text = (String(fps_counter) + " FPS");
fps_counter = 0;
}
function frame60(){
stop();
}
public function checkForCarrotHits(){
var _local1:int;
var _local2:int;
var _local3:Point_burst;
var _local4:Explosion;
_local1 = (carrots.length - 1);
while (_local1 >= 0) {
_local2 = (presents.length - 1);
while (_local2 >= 0) {
if (carrots[_local1].Carrot_hit.hitTestObject(presents[_local2])){
score = (score + (50 * carrots[_local1].combo));
_local3 = new Point_burst((presents[_local2].x + 10), (presents[_local2].y + 10), (50 * carrots[_local1].combo));
addChild(_local3);
_local4 = new Explosion((presents[_local2].x + 10), (presents[_local2].y + 10), 0);
addChild(_local4);
if (presents[_local2].present_type == 2){
recoverBlock();
};
if (presents[_local2].present_type == 3){
recoverBlocks();
};
presents[_local2].deletePresent();
if (carrots[_local1].combo == 1){
channel = snd_present1.play();
};
if (carrots[_local1].combo == 4){
channel = snd_present2.play();
};
if (carrots[_local1].combo == 16){
channel = snd_present3.play();
};
if (carrots[_local1].combo >= 64){
channel = snd_present4.play();
};
carrots[_local1].combo = (carrots[_local1].combo * 4);
channel.soundTransform = st;
break;
};
_local2--;
};
_local1--;
};
}
public function removeCarrot(_arg1:Carrot){
var _local2:*;
for (_local2 in carrots) {
if (carrots[_local2] == _arg1){
carrots.splice(_local2, 1);
break;
};
};
}
public function help_clicked(_arg1:Event){
help_back.gotoAndStop(1);
help_back.visible = true;
}
public function checkForPlayerHits(){
var _local1:int;
_local1 = (presents.length - 1);
while (_local1 >= 0) {
if (presents[_local1].Present_hit.hitTestObject(Player.Player_hit)){
if (game_over != 1){
game_over = 1;
game_over_screen = new black_screen();
addChild(game_over_screen);
game_over_screen.retry_button.addEventListener(MouseEvent.MOUSE_DOWN, restart_game);
game_over_screen.score_button.addEventListener(MouseEvent.MOUSE_DOWN, score_screen);
};
};
_local1--;
};
}
public function destroyPresents(){
var _local1:int;
var _local2:Point_burst;
var _local3:Explosion;
_local1 = (presents.length - 1);
while (_local1 >= 0) {
score = (score + 10);
_local2 = new Point_burst((presents[_local1].x + 10), (presents[_local1].y + 10), 10);
addChild(_local2);
_local3 = new Explosion((presents[_local1].x + 10), (presents[_local1].y + 10), 0);
addChild(_local3);
presents[_local1].dead = 1;
channel.soundTransform = st;
_local1--;
};
}
public function start_clicked(_arg1:Event){
var _local2:String;
start_button.removeEventListener(MouseEvent.MOUSE_DOWN, start_clicked);
_local2 = stage.loaderInfo.url.toLowerCase();
if ((((((_local2.indexOf("cursesfoiled.co.uk") <= 0)) && ((_local2.indexOf("fantasticchoice.com") <= 0)))) && ((_local2.indexOf("flashgamelicense.com") <= 0)))){
play();
} else {
play();
};
}
public function moregames_clicked(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.arcadetown.com/index.asp?gameid=mrcarrotface");
navigateToURL(_local2, "_blank");
}
public function startGame(){
snd_music = new music();
music_ch = snd_music.play(0, 0xFFFF);
music_ch.soundTransform = music_st;
FPSTimer.addEventListener(TimerEvent.TIMER, fps_update);
FPSTimer.start();
score = 0;
game_over = 0;
stage.quality = "Medium";
game_over = 0;
addEventListener(Event.ENTER_FRAME, updateGame);
mute_button.addEventListener(MouseEvent.MOUSE_DOWN, mute_clicked);
q_button.addEventListener(MouseEvent.MOUSE_DOWN, q_clicked);
switch (mute){
case 1:
st.volume = 0;
music_st.volume = 0;
music_ch.soundTransform = music_st;
break;
case 0:
music_st.volume = 1;
music_ch.soundTransform = music_st;
st.volume = 0.8;
break;
};
createBlocks();
}
public function recoverBlock(){
var _local1:Checker;
channel = snd_revive2.play();
channel.soundTransform = st;
_local1 = new Checker(Player.x, 410, 1);
addChild(_local1);
checkers.push(_local1);
}
public function removePresent(_arg1:Present){
var _local2:*;
for (_local2 in presents) {
if (presents[_local2] == _arg1){
presents.splice(_local2, 1);
break;
};
};
}
public function logo_clicked(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.arcadetown.com/index.asp?gameid=mrcarrotface");
navigateToURL(_local2, "_blank");
}
public function createBlocks(){
var _local1:*;
var _local2:Block;
_local1 = 0;
while (_local1 < 20) {
_local2 = new Block((_local1 * 20), 380);
addChild(_local2);
blocks.push(_local2);
_local1++;
};
}
public function show_scores_page(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.arcadetown.com/mrcarrotface/view_high_scores.asp");
navigateToURL(_local2, "_blank");
}
public function submit_score(_arg1:Event){
var _local2:String;
var _local3:URLRequest;
if (Number(final_score.text) > 0){
if (((((((((((!((name_text.text == ""))) && (!((name_text.text == " "))))) && (!((name_text.text == " "))))) && (!((name_text.text == " "))))) && (!((name_text.text == " "))))) && (!((name_text.text == " "))))){
submit_button.visible = false;
thank_you.visible = true;
please_enter_name.visible = false;
name_text.visible = false;
final_score.visible = false;
_local2 = ATHelpers.generateHighscoreSubmission("mrcarrotface", name_text.text, Number(final_score.text));
_local3 = new URLRequest(_local2);
navigateToURL(_local3, "_blank");
};
};
}
public function at_menu_clicked(_arg1:Event){
var _local2:URLRequest;
_local2 = new URLRequest("http://www.arcadetown.com/index.asp?gameid=mrcarrotface");
navigateToURL(_local2, "_blank");
}
public function PL_LOADING(_arg1:ProgressEvent):void{
var _local2:Number;
_local2 = ((_arg1.bytesLoaded / _arg1.bytesTotal) * 100);
preloader.loader_mask.scaleX = (_local2 / 100);
if (_local2 == 100){
this.gotoAndPlay(2);
};
}
public function checkForBlockHits(){
var _local1:int;
var _local2:int;
var _local3:block_poof;
_local1 = (presents.length - 1);
while (_local1 >= 0) {
_local2 = (blocks.length - 1);
while (_local2 >= 0) {
if (blocks[_local2].dead == 0){
if (presents[_local1].Present_hit.hitTestObject(blocks[_local2])){
presents[_local1].deletePresent();
blocks[_local2].dead = 1;
_local3 = new block_poof((blocks[_local2].x + 10), (blocks[_local2].y + 10));
addChild(_local3);
channel = snd_block_hit.play();
channel.soundTransform = st;
break;
};
};
_local2--;
};
_local1--;
};
}
public function go_back(_arg1:Event){
gotoAndPlay(14);
}
}
}//package