Section 1
//SFCAbstract (com.fingertime.core.loader.SFCAbstract)
package com.fingertime.core.loader {
public class SFCAbstract {
private var achievements:Array;
public var currentScore:int;// = 0
public function updateScore(_arg1:int):void{
trace(("updateScore called with value : " + _arg1));
}
public function achievement(_arg1:int):void{
if (achievements == null){
achievements = new Array();
};
var _local2:Boolean;
var _local3:int;
while (_local3 < achievements.length) {
if (achievements[_local3] == _arg1){
_local2 = true;
};
_local3++;
};
if (!_local2){
trace(("achievement called with id : " + _arg1));
achievements.push(_arg1);
};
}
}
}//package com.fingertime.core.loader
Section 2
//SFCLoader (com.fingertime.core.loader.SFCLoader)
package com.fingertime.core.loader {
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.system.*;
public class SFCLoader extends MovieClip {
public var checkLoginOn:Boolean;// = true
public var gatewayUrl:String;// = "http://beta.fingertime.com/amfphp/gateway.php"
public var gameID:Number;
public var lowerIsBest:Boolean;// = false
public var achievementDelay:Number;// = 5
public var majorVersion:Number;// = 9
public var highScoresOn:Boolean;// = true
public var minorVersion:Number;// = 0
public var checkSecurity:Boolean;// = true
public var maxMessageBoxSize:Number;// = 265
public var achievementsOn:Boolean;// = true
public var margin:Number;// = 24
public var vAlign:String;// = "bottom"
public var checkVersion:Boolean;// = true
public var hAlign:String;// = "center"
public static var stage_width:Number;
public static var stage_height:Number;
public static var core;
public function SFCLoader(){
addEventListener(Event.ADDED_TO_STAGE, init);
}
public function init(_arg1:Event):void{
trace("core loader initialised");
removeEventListener(Event.ADDED_TO_STAGE, init);
if (checkLoginOn){
if (checkSecurity){
if (stage.loaderInfo.url.indexOf("fingertime.com") == -1){
navigateToURL(new URLRequest("http://www.fingertime.com"));
};
};
x = (y = 0);
Security.allowDomain("*");
stage_width = stage.stageWidth;
stage_height = stage.stageHeight;
trace(("core = " + core));
if (Security.sandboxType == Security.REMOTE){
initCore();
} else {
core = new SFCAbstract();
};
};
}
public function initCore():void{
core.achievementsOn = achievementsOn;
core.achievementDelay = achievementDelay;
core.checkSecurity = checkSecurity;
core.gameID = gameID;
core.gatewayUrl = gatewayUrl;
core.hAlign = hAlign;
core.vAlign = vAlign;
core.margin = margin;
core.highScoresOn = highScoresOn;
core.lowestIsBest = lowerIsBest;
core.maxMessageBoxSize = maxMessageBoxSize;
core.majorVersion = majorVersion;
core.minorVersion = minorVersion;
core.checkLoginOn = checkLoginOn;
core.init();
}
public static function go(){
return (core);
}
}
}//package com.fingertime.core.loader
Section 3
//Strong (fl.transitions.easing.Strong)
package fl.transitions.easing {
public class Strong {
public static function easeOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = ((_arg1 / _arg4) - 1);
return (((_arg3 * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 1)) + _arg2));
}
public static function easeIn(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / _arg4);
return (((((((_arg3 * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
}
public static function easeInOut(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
_arg1 = (_arg1 / (_arg4 / 2));
if (_arg1 < 1){
return ((((((((_arg3 / 2) * _arg1) * _arg1) * _arg1) * _arg1) * _arg1) + _arg2));
};
_arg1 = (_arg1 - 2);
return ((((_arg3 / 2) * (((((_arg1 * _arg1) * _arg1) * _arg1) * _arg1) + 2)) + _arg2));
}
}
}//package fl.transitions.easing
Section 4
//Tween (fl.transitions.Tween)
package fl.transitions {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
public class Tween extends EventDispatcher {
private var _position:Number;// = NAN
public var prevTime:Number;// = NAN
public var prevPos:Number;// = NAN
public var isPlaying:Boolean;// = false
private var _fps:Number;// = NAN
private var _time:Number;// = NAN
public var begin:Number;// = NAN
private var _finish:Number;// = NAN
public var change:Number;// = NAN
public var looping:Boolean;// = false
private var _intervalID:uint;// = 0
public var func:Function;
private var _timer:Timer;// = null
private var _startTime:Number;// = NAN
public var prop:String;// = ""
private var _duration:Number;// = NAN
public var obj:Object;// = null
public var useSeconds:Boolean;// = false
protected static var _mc:MovieClip = new MovieClip();
public function Tween(_arg1:Object, _arg2:String, _arg3:Function, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Boolean=false){
this.func = function (_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
return ((((_arg3 * _arg1) / _arg4) + _arg2));
};
super();
if (!arguments.length){
return;
};
this.obj = _arg1;
this.prop = _arg2;
this.begin = _arg4;
this.position = _arg4;
this.duration = _arg6;
this.useSeconds = _arg7;
if ((_arg3 is Function)){
this.func = _arg3;
};
this.finish = _arg5;
this._timer = new Timer(100);
this.start();
}
public function continueTo(_arg1:Number, _arg2:Number):void{
this.begin = this.position;
this.finish = _arg1;
if (!isNaN(_arg2)){
this.duration = _arg2;
};
this.start();
}
protected function startEnterFrame():void{
var _local1:Number;
if (isNaN(this._fps)){
_mc.addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
} else {
_local1 = (1000 / this._fps);
this._timer.delay = _local1;
this._timer.addEventListener(TimerEvent.TIMER, this.timerHandler, false, 0, true);
this._timer.start();
};
this.isPlaying = true;
}
public function stop():void{
this.stopEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_STOP, this._time, this._position));
}
private function fixTime():void{
if (this.useSeconds){
this._startTime = (getTimer() - (this._time * 1000));
};
}
public function set FPS(_arg1:Number):void{
var _local2:Boolean = this.isPlaying;
this.stopEnterFrame();
this._fps = _arg1;
if (_local2){
this.startEnterFrame();
};
}
public function get finish():Number{
return ((this.begin + this.change));
}
public function get duration():Number{
return (this._duration);
}
protected function stopEnterFrame():void{
if (isNaN(this._fps)){
_mc.removeEventListener(Event.ENTER_FRAME, this.onEnterFrame);
} else {
this._timer.stop();
};
this.isPlaying = false;
}
public function set time(_arg1:Number):void{
this.prevTime = this._time;
if (_arg1 > this.duration){
if (this.looping){
this.rewind((_arg1 - this._duration));
this.update();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_LOOP, this._time, this._position));
} else {
if (this.useSeconds){
this._time = this._duration;
this.update();
};
this.stop();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_FINISH, this._time, this._position));
};
} else {
if (_arg1 < 0){
this.rewind();
this.update();
} else {
this._time = _arg1;
this.update();
};
};
}
public function getPosition(_arg1:Number=NaN):Number{
if (isNaN(_arg1)){
_arg1 = this._time;
};
return (this.func(_arg1, this.begin, this.change, this._duration));
}
public function set finish(_arg1:Number):void{
this.change = (_arg1 - this.begin);
}
public function set duration(_arg1:Number):void{
this._duration = ((_arg1)<=0) ? Infinity : _arg1;
}
public function get position():Number{
return (this.getPosition(this._time));
}
public function setPosition(_arg1:Number):void{
this.prevPos = this._position;
if (this.prop.length){
this.obj[this.prop] = (this._position = _arg1);
};
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_CHANGE, this._time, this._position));
}
public function resume():void{
this.fixTime();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_RESUME, this._time, this._position));
}
public function fforward():void{
this.time = this._duration;
this.fixTime();
}
protected function onEnterFrame(_arg1:Event):void{
this.nextFrame();
}
public function yoyo():void{
this.continueTo(this.begin, this.time);
}
public function nextFrame():void{
if (this.useSeconds){
this.time = ((getTimer() - this._startTime) / 1000);
} else {
this.time = (this._time + 1);
};
}
protected function timerHandler(_arg1:TimerEvent):void{
this.nextFrame();
_arg1.updateAfterEvent();
}
public function get FPS():Number{
return (this._fps);
}
public function rewind(_arg1:Number=0):void{
this._time = _arg1;
this.fixTime();
this.update();
}
public function set position(_arg1:Number):void{
this.setPosition(_arg1);
}
public function get time():Number{
return (this._time);
}
private function update():void{
this.setPosition(this.getPosition(this._time));
}
public function start():void{
this.rewind();
this.startEnterFrame();
this.dispatchEvent(new TweenEvent(TweenEvent.MOTION_START, this._time, this._position));
}
public function prevFrame():void{
if (!this.useSeconds){
this.time = (this._time - 1);
};
}
}
}//package fl.transitions
Section 5
//TweenEvent (fl.transitions.TweenEvent)
package fl.transitions {
import flash.events.*;
public class TweenEvent extends Event {
public var position:Number;// = NAN
public var time:Number;// = NAN
public static const MOTION_START:String = "motionStart";
public static const MOTION_STOP:String = "motionStop";
public static const MOTION_LOOP:String = "motionLoop";
public static const MOTION_CHANGE:String = "motionChange";
public static const MOTION_FINISH:String = "motionFinish";
public static const MOTION_RESUME:String = "motionResume";
public function TweenEvent(_arg1:String, _arg2:Number, _arg3:Number, _arg4:Boolean=false, _arg5:Boolean=false){
super(_arg1, _arg4, _arg5);
this.time = _arg2;
this.position = _arg3;
}
override public function clone():Event{
return (new TweenEvent(this.type, this.time, this.position, this.bubbles, this.cancelable));
}
}
}//package fl.transitions
Section 6
//Achievments (Achievments)
package {
import com.fingertime.core.loader.*;
public class Achievments {
private var home:Main;
public function Achievments(_arg1:Main){
home = _arg1;
}
public function check():void{
if ((((home.score_manager.total_score > 50000)) && (!(home.sandbox)))){
SFCLoader.go().achievement(235);
};
if ((((home.score_manager.total_score > 60000)) && (!(home.sandbox)))){
SFCLoader.go().achievement(236);
};
if ((((home.score_manager.total_score > 70000)) && (!(home.sandbox)))){
SFCLoader.go().achievement(237);
};
if ((((home.score_manager.total_score > 80000)) && (!(home.sandbox)))){
SFCLoader.go().achievement(238);
};
if (int(((((home.launcher.dead_fireworks / 120) * 100)) && (!(home.sandbox)))) > 90){
SFCLoader.go().achievement(239);
};
if (home.fps_counter.particle_array.length > 40000){
SFCLoader.go().achievement(240);
};
}
}
}//package
Section 7
//Af1 (Af1)
package {
import flash.media.*;
public dynamic class Af1 extends Sound {
}
}//package
Section 8
//Af2 (Af2)
package {
import flash.media.*;
public dynamic class Af2 extends Sound {
}
}//package
Section 9
//Af3 (Af3)
package {
import flash.media.*;
public dynamic class Af3 extends Sound {
}
}//package
Section 10
//Af4 (Af4)
package {
import flash.media.*;
public dynamic class Af4 extends Sound {
}
}//package
Section 11
//Af5 (Af5)
package {
import flash.media.*;
public dynamic class Af5 extends Sound {
}
}//package
Section 12
//BG (BG)
package {
import flash.display.*;
public dynamic class BG extends BitmapData {
public function BG(_arg1:Number, _arg2:Number){
super(_arg1, _arg2);
}
}
}//package
Section 13
//BlueFirework (BlueFirework)
package {
public class BlueFirework extends Firework {
public function BlueFirework(_arg1:Main, _arg2:Object, _arg3:Screen, _arg4:ParticleManager, _arg5:ScoreManager, _arg6:Array){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
particle_colour = 2790911;
points_worth = 250;
}
}
}//package
Section 14
//BriefPopup (BriefPopup)
package {
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.text.*;
public class BriefPopup extends Sprite {
private var wave:Number;
public var fireworks_tf:TextField;
private var home:Main;
private var tween_two:Tween;
private var tween_one:Tween;
public var wave_tf:TextField;
public function BriefPopup(_arg1:Main, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number){
home = _arg1;
wave_tf.text = ((_arg2 == 2)) ? "Final Display" : (("Display " + (_arg2 + 1)) + "");
fireworks_tf.text = ((_arg5 == 1)) ? (((_arg5 + " Wave of ") + _arg3) + " Fireworks") : (((_arg5 + " Waves of ") + _arg3) + " Fireworks");
alpha = 0;
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, false);
wave = _arg2;
}
private function fadeOut(_arg1:TweenEvent):void{
tween_two = new Tween(this, "alpha", Strong.easeOut, 1, 0, 2, true);
tween_two.addEventListener(TweenEvent.MOTION_FINISH, remove, false, 0, true);
}
private function addedToStage(_arg1:Event):void{
if (wave == 3){
remove(null);
} else {
tween_one = new Tween(this, "alpha", Strong.easeOut, 0, 1, 3, true);
tween_one.addEventListener(TweenEvent.MOTION_FINISH, fadeOut, false, 0, true);
};
}
private function remove(_arg1:TweenEvent):void{
parent.removeChild(this);
}
}
}//package
Section 15
//C1 (C1)
package {
import flash.media.*;
public dynamic class C1 extends Sound {
}
}//package
Section 16
//C2 (C2)
package {
import flash.media.*;
public dynamic class C2 extends Sound {
}
}//package
Section 17
//C3 (C3)
package {
import flash.media.*;
public dynamic class C3 extends Sound {
}
}//package
Section 18
//C4 (C4)
package {
import flash.media.*;
public dynamic class C4 extends Sound {
}
}//package
Section 19
//C5 (C5)
package {
import flash.media.*;
public dynamic class C5 extends Sound {
}
}//package
Section 20
//CollisionManager (CollisionManager)
package {
public class CollisionManager {
private var home:Main;
private var entity_array:Array;
private var explosion_array:Array;
public function CollisionManager(_arg1:Main, _arg2:Array, _arg3:Array){
home = _arg1;
entity_array = _arg2;
explosion_array = _arg3;
}
public function checkCollisions():void{
var _local3:*;
var _local4:*;
var _local5:Number;
var _local6:Number;
var _local7:Number;
var _local1:Number = entity_array.length;
var _local2:Number = explosion_array.length;
_local3 = 0;
while (_local3 < _local1) {
_local4 = 0;
while (_local4 < _local2) {
_local5 = (entity_array[_local3].x - explosion_array[_local4].x);
_local6 = (entity_array[_local3].y - explosion_array[_local4].y);
_local7 = Math.sqrt(((_local5 * _local5) + (_local6 * _local6)));
if (((((((!(entity_array[_local3].is_player)) && (entity_array[_local3].active))) && (entity_array[_local3].alive))) && ((_local7 < explosion_array[_local4].hit_radius)))){
entity_array[_local3].explode();
};
_local4++;
};
_local3++;
};
}
}
}//package
Section 21
//ComboList (ComboList)
package {
import flash.display.*;
public class ComboList extends Sprite {
private var time_popup:TimePopup;
private var combo_popup:ComboPopup;
public var combo_count:Number;
private var home:Main;
public function ComboList(_arg1:Main){
home = _arg1;
combo_count = 0;
}
public function newTimePopup(_arg1:Number):void{
combo_count = (combo_count + 1);
time_popup = new TimePopup(this, _arg1);
time_popup.y = (combo_count * combo_popup.height);
}
public function newComboPopup(_arg1:Number):void{
combo_count = (combo_count + 1);
combo_popup = new ComboPopup(this, _arg1);
combo_popup.y = (combo_count * combo_popup.height);
}
}
}//package
Section 22
//ComboPopup (ComboPopup)
package {
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.text.*;
public class ComboPopup extends Sprite {
private var tween_one:Tween;
public var info_tf:TextField;
private var tween_two:Tween;
private var combo_list:ComboList;
public function ComboPopup(_arg1:ComboList, _arg2:Number){
combo_list = _arg1;
info_tf.text = ("Combo x" + _arg2);
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, false);
}
private function addedToStage(_arg1:Event):void{
tween_one = new Tween(this, "alpha", Strong.easeOut, 100, 0, 2, true);
tween_one.addEventListener(TweenEvent.MOTION_FINISH, remove, false, 0, true);
tween_two = new Tween(this, "y", Strong.easeOut, this.y, (this.y - 10), 2, true);
}
private function remove(_arg1:TweenEvent):void{
combo_list.combo_count = (combo_list.combo_count - 1);
combo_list.removeChild(this);
}
}
}//package
Section 23
//Ex1 (Ex1)
package {
import flash.media.*;
public dynamic class Ex1 extends Sound {
}
}//package
Section 24
//Ex10 (Ex10)
package {
import flash.media.*;
public dynamic class Ex10 extends Sound {
}
}//package
Section 25
//Ex11 (Ex11)
package {
import flash.media.*;
public dynamic class Ex11 extends Sound {
}
}//package
Section 26
//Ex12 (Ex12)
package {
import flash.media.*;
public dynamic class Ex12 extends Sound {
}
}//package
Section 27
//Ex13 (Ex13)
package {
import flash.media.*;
public dynamic class Ex13 extends Sound {
}
}//package
Section 28
//Ex14 (Ex14)
package {
import flash.media.*;
public dynamic class Ex14 extends Sound {
}
}//package
Section 29
//Ex15 (Ex15)
package {
import flash.media.*;
public dynamic class Ex15 extends Sound {
}
}//package
Section 30
//Ex16 (Ex16)
package {
import flash.media.*;
public dynamic class Ex16 extends Sound {
}
}//package
Section 31
//Ex17 (Ex17)
package {
import flash.media.*;
public dynamic class Ex17 extends Sound {
}
}//package
Section 32
//Ex18 (Ex18)
package {
import flash.media.*;
public dynamic class Ex18 extends Sound {
}
}//package
Section 33
//Ex2 (Ex2)
package {
import flash.media.*;
public dynamic class Ex2 extends Sound {
}
}//package
Section 34
//Ex3 (Ex3)
package {
import flash.media.*;
public dynamic class Ex3 extends Sound {
}
}//package
Section 35
//Ex4 (Ex4)
package {
import flash.media.*;
public dynamic class Ex4 extends Sound {
}
}//package
Section 36
//Ex5 (Ex5)
package {
import flash.media.*;
public dynamic class Ex5 extends Sound {
}
}//package
Section 37
//Ex6 (Ex6)
package {
import flash.media.*;
public dynamic class Ex6 extends Sound {
}
}//package
Section 38
//Ex7 (Ex7)
package {
import flash.media.*;
public dynamic class Ex7 extends Sound {
}
}//package
Section 39
//Ex8 (Ex8)
package {
import flash.media.*;
public dynamic class Ex8 extends Sound {
}
}//package
Section 40
//Ex9 (Ex9)
package {
import flash.media.*;
public dynamic class Ex9 extends Sound {
}
}//package
Section 41
//Explosion (Explosion)
package {
import flash.display.*;
public class Explosion extends Sprite {
private var life:Number;
public var alive:Boolean;
public var hit_radius:Number;
private var home:Main;
public function Explosion(_arg1:Main){
home = _arg1;
hit_radius = 50;
life = 1;
alive = true;
}
public function update():void{
if (life > 0){
life = (life - (1 / 30));
} else {
alive = false;
};
}
}
}//package
Section 42
//Firework (Firework)
package {
import flash.display.*;
import flash.geom.*;
public class Firework extends Sprite {
protected var score_manager:ScoreManager;
private var source_rectangle:Rectangle;
public var alive:Boolean;
protected var gravity:Number;
public var active:Boolean;
protected var acceleration:Number;
private var game_screen:Screen;
protected var velocity:Point;
protected var home:Main;
private var texture_object:Object;
protected var explosion:Explosion;
protected var particle_colour:Number;
public var is_player:Boolean;
private var explosion_array:Array;
private var dest_point:Point;
private var particle_manager:ParticleManager;
protected var collision_timer:Number;
protected var points_worth:Number;
protected var friction:Number;
public function Firework(_arg1:Main, _arg2:Object, _arg3:Screen, _arg4:ParticleManager, _arg5:ScoreManager, _arg6:Array){
home = _arg1;
texture_object = _arg2;
game_screen = _arg3;
particle_manager = _arg4;
score_manager = _arg5;
explosion_array = _arg6;
source_rectangle = new Rectangle(0, 0, texture_object.tile_width, texture_object.tile_height);
dest_point = new Point();
velocity = new Point(((Math.random() * (6 - -6)) + -6), ((Math.random() * (-9 - -15)) + -15));
gravity = 0.2;
acceleration = 1;
friction = 0.99;
alive = true;
active = false;
is_player = false;
playsound();
}
public function render():void{
dest_point.x = (this.x - (texture_object.tile_width / 2));
dest_point.y = (this.y - (texture_object.tile_height / 2));
game_screen.screen_data.copyPixels(texture_object.data, source_rectangle, dest_point);
}
public function update():void{
velocity.x = (velocity.x * friction);
velocity.y = (velocity.y + gravity);
this.x = (this.x + velocity.x);
this.y = (this.y + velocity.y);
if ((((this.x < Main.boundaries.left)) || ((this.x > Main.boundaries.right)))){
alive = false;
};
if (this.y > Main.boundaries.bottom){
alive = false;
};
if (((!(active)) && ((this.y < (home.stage_height - 180))))){
active = true;
};
}
protected function playsound():void{
home.sound_manager.playLaunch();
}
public function explode():void{
particle_manager.createExplosion(this, 200, particle_colour, 2);
game_screen.screenFlash();
updateScoreField();
newPointPopup();
explosion = new Explosion(home);
explosion.x = this.x;
explosion.y = this.y;
explosion_array.push(explosion);
home.sound_manager.playExplosion();
home.sound_manager.playAfter();
alive = false;
}
protected function updateScoreField():void{
score_manager.updateScoreField(points_worth);
}
protected function newPointPopup():void{
var _local1:PointsPopup = new PointsPopup(home, points_worth);
_local1.x = this.x;
_local1.y = this.y;
home.addChild(_local1);
home.launcher.dead_fireworks = (home.launcher.dead_fireworks + 1);
}
}
}//package
Section 43
//FireworkBlue (FireworkBlue)
package {
import flash.display.*;
public dynamic class FireworkBlue extends Sprite {
}
}//package
Section 44
//FireworkGreen (FireworkGreen)
package {
import flash.display.*;
public dynamic class FireworkGreen extends Sprite {
}
}//package
Section 45
//FireworkPurple (FireworkPurple)
package {
import flash.display.*;
public dynamic class FireworkPurple extends Sprite {
}
}//package
Section 46
//FireworkRed (FireworkRed)
package {
import flash.display.*;
public dynamic class FireworkRed extends Sprite {
}
}//package
Section 47
//FireworkWhite (FireworkWhite)
package {
import flash.display.*;
public dynamic class FireworkWhite extends Sprite {
}
}//package
Section 48
//FireworkYellow (FireworkYellow)
package {
import flash.display.*;
public dynamic class FireworkYellow extends Sprite {
}
}//package
Section 49
//FpsCounter (FpsCounter)
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import flash.text.*;
public class FpsCounter extends Sprite {
public var particle_array:Array;
public var particles_tf:TextField;
public var fireworks_tf:TextField;
private var current_frame:int;
public var fps_tf:TextField;
private var fps_timer:Timer;
private var entity_array:Array;
public function FpsCounter(_arg1:Array, _arg2:Array){
entity_array = _arg1;
particle_array = _arg2;
fps_tf.text = "??";
current_frame = new Number();
fps_timer = new Timer(1000);
fps_timer.addEventListener(TimerEvent.TIMER, updateField, false, 0, true);
fps_timer.start();
this.addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
}
private function loop(_arg1:Event):void{
particles_tf.text = ("Total particles - " + String(particle_array.length));
fireworks_tf.text = ("Total fireworks - " + String(entity_array.length));
current_frame++;
}
private function updateField(_arg1:TimerEvent):void{
fps_tf.text = String(current_frame);
current_frame = 0;
}
}
}//package
Section 50
//GameTimer (GameTimer)
package {
import flash.display.*;
import flash.text.*;
public class GameTimer extends Sprite {
private var tick_delay:Number;
public var time_tf:TextField;
public var total_time:Number;
private var tick_counter:Number;
private var home:Main;
public function GameTimer(_arg1:Main){
home = _arg1;
total_time = 60;
time_tf.text = ("" + total_time);
tick_delay = 1;
tick_counter = 0;
}
public function tickTock():void{
if (tick_counter > tick_delay){
if (total_time > 0){
total_time = (total_time - 1);
};
time_tf.text = ("" + total_time);
tick_counter = 0;
} else {
tick_counter = (tick_counter + (1 / 30));
};
}
public function timeBonus(_arg1:Number):void{
time_tf.text = ("" + (total_time = (total_time + _arg1)));
if (total_time > 60){
total_time = 60;
time_tf.text = ("" + total_time);
};
}
}
}//package
Section 51
//GreenFirework (GreenFirework)
package {
public class GreenFirework extends Firework {
public function GreenFirework(_arg1:Main, _arg2:Object, _arg3:Screen, _arg4:ParticleManager, _arg5:ScoreManager, _arg6:Array){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
particle_colour = 0x99FF00;
points_worth = 75;
}
}
}//package
Section 52
//Kaboom (Kaboom)
package {
import flash.display.*;
public dynamic class Kaboom extends MovieClip {
public function Kaboom(){
addFrameScript(10, frame11);
}
function frame11(){
if (this != null){
this.parent.removeChild(this);
};
stop();
}
}
}//package
Section 53
//L1 (L1)
package {
import flash.media.*;
public dynamic class L1 extends Sound {
}
}//package
Section 54
//L2 (L2)
package {
import flash.media.*;
public dynamic class L2 extends Sound {
}
}//package
Section 55
//L3 (L3)
package {
import flash.media.*;
public dynamic class L3 extends Sound {
}
}//package
Section 56
//L4 (L4)
package {
import flash.media.*;
public dynamic class L4 extends Sound {
}
}//package
Section 57
//L5 (L5)
package {
import flash.media.*;
public dynamic class L5 extends Sound {
}
}//package
Section 58
//L6 (L6)
package {
import flash.media.*;
public dynamic class L6 extends Sound {
}
}//package
Section 59
//L7 (L7)
package {
import flash.media.*;
public dynamic class L7 extends Sound {
}
}//package
Section 60
//L8 (L8)
package {
import flash.media.*;
public dynamic class L8 extends Sound {
}
}//package
Section 61
//L9 (L9)
package {
import flash.media.*;
public dynamic class L9 extends Sound {
}
}//package
Section 62
//Launcher (Launcher)
package {
import flash.display.*;
import flash.events.*;
import flash.geom.*;
public class Launcher {
private var score_manager:ScoreManager;
private var firework_counter:Number;
private var texture_manager:TextureManager;
private var entity_array:Array;
private var game_over:Boolean;
private var justone:Boolean;
private var can_shoot:Boolean;
private var explosion_array:Array;
private var shot_counter:ShotCounter;
private var wave_delay:Number;
private var sub_delay:Number;
private var firework:Sprite;
private var wave_pattern:Array;
private var player_position:Point;
private var total_fireworks:Number;
private var total_textures:Number;
public var sandbox:Boolean;// = true
private var game_screen:Screen;
public var main_btn:MainButton;
private var home:Main;
private var firework_array:Array;
private var shooting:Boolean;
public var total_stats:Array;
private var launch_counter:Number;
public var dead_fireworks:Number;
private var current_subwave:Number;
private var launch_delay:Number;
private var player:Player;
private var particle_manager:ParticleManager;
private var total_subwaves:Number;
private var subwave_delay:Number;
private var current_wave:Number;
public function Launcher(_arg1:Main, _arg2:Array, _arg3:Array, _arg4:Array, _arg5:TextureManager, _arg6:Screen, _arg7:ParticleManager, _arg8:ScoreManager, _arg9:ShotCounter){
var _local10:BriefPopup;
super();
home = _arg1;
entity_array = _arg2;
firework_array = _arg4;
explosion_array = _arg3;
texture_manager = _arg5;
game_screen = _arg6;
particle_manager = _arg7;
score_manager = _arg8;
shot_counter = _arg9;
launch_delay = 0;
launch_counter = 0;
current_wave = 0;
current_subwave = 0;
firework_counter = 0;
sub_delay = 0.5;
subwave_delay = sub_delay;
wave_delay = 4;
justone = false;
wave_pattern = [[3, 40, 1], [3, 40, 1], [3, 40, 1], [0, 0, 0]];
total_fireworks = wave_pattern[current_wave][1];
can_shoot = false;
dead_fireworks = 0;
game_over = false;
sandbox = home.sandbox;
total_textures = (texture_manager.texture_array.length - 1);
player_position = new Point((home.stage_width / 2), (home.stage_height + 10));
if (!sandbox){
shot_counter.reload();
_local10 = new BriefPopup(home, current_wave, total_fireworks, shot_counter.total_shots, wave_pattern[current_wave][0]);
_local10.x = (home.stage_width / 2);
_local10.y = ((home.stage_height / 2) - 140);
home.addChild(_local10);
} else {
main_btn = new MainButton();
main_btn.x = 100;
main_btn.y = 450;
main_btn.addEventListener(MouseEvent.MOUSE_DOWN, quit, false, 0, true);
home.addChild(main_btn);
home.score_manager.visible = false;
};
home.stage.addEventListener(MouseEvent.MOUSE_DOWN, createPlayer, false, 0, false);
}
private function createPlayer(_arg1:MouseEvent):void{
if (!sandbox){
if ((((shot_counter.current_shots > 0)) && (can_shoot))){
player = new Player(home, texture_manager.texture_array[total_textures], game_screen, particle_manager, player_position, explosion_array);
player.x = player_position.x;
player.y = player_position.y;
entity_array.push(player);
shot_counter.shoot();
};
} else {
player = new Player(home, texture_manager.texture_array[total_textures], game_screen, particle_manager, player_position, explosion_array);
player.x = player_position.x;
player.y = player_position.y;
entity_array.push(player);
};
}
public function launchWave():void{
var _local1:*;
var _local2:StatsPopup;
if (!sandbox){
if ((((wave_delay < 0)) && (!(game_over)))){
if ((((subwave_delay < 0)) && ((current_subwave < wave_pattern[current_wave][0])))){
trace(("subwave" + current_subwave));
_local1 = 0;
while (_local1 < wave_pattern[current_wave][1]) {
createFirework();
_local1++;
};
current_subwave = (current_subwave + 1);
subwave_delay = sub_delay;
} else {
subwave_delay = (subwave_delay - (1 / 30));
};
if ((((current_subwave == wave_pattern[current_wave][0])) && ((firework_array.length == 0)))){
trace(("wave" + current_wave));
trace(("shots" + wave_pattern[current_wave][2]));
score_manager.checkCombos();
if (current_wave != 2){
_local2 = new StatsPopup(home, dead_fireworks, score_manager.best_combo, wave_pattern[current_wave], score_manager.old_score, (current_wave + 1), wave_pattern[(current_wave + 1)][1], wave_pattern[(current_wave + 1)][2], wave_pattern[(current_wave + 1)][0]);
_local2.x = (home.stage_width / 2);
_local2.y = ((home.stage_height / 2) - 140);
home.addChild(_local2);
};
home.sound_manager.playCrowd();
trace(score_manager.best_combo);
score_manager.fillWaveStats((current_wave + 1), int(((dead_fireworks / 120) * 100)), score_manager.best_combo, score_manager.old_score);
shot_counter.total_shots = wave_pattern[current_wave][2];
shot_counter.reload();
current_wave = (current_wave + 1);
current_subwave = 0;
dead_fireworks = 0;
score_manager.best_combo = 0;
trace(("BEST COMBO " + score_manager.best_combo));
score_manager.old_score = 0;
trace(("BEST SCORE " + score_manager.old_score));
score_manager.combo_points = 0;
wave_delay = 10;
sub_delay = (sub_delay + 0.5);
};
if (current_wave == (wave_pattern.length - 1)){
game_over = true;
home.gameOver(score_manager.total_stats);
trace("Game Over");
};
if (firework_array.length > 0){
can_shoot = true;
} else {
can_shoot = false;
};
} else {
wave_delay = (wave_delay - (1 / 30));
};
} else {
if (subwave_delay < 0){
_local1 = 0;
while (_local1 < 20) {
createFirework();
subwave_delay = (Math.random() * 3);
_local1++;
};
} else {
subwave_delay = (subwave_delay - (1 / 30));
};
};
}
private function quit(_arg1:MouseEvent):void{
home.removeChild(main_btn);
home.clearGame();
home.init(null);
}
private function createFirework():void{
var _local1:Number = Math.floor((Math.random() * total_textures));
switch (_local1){
case 0:
firework = new BlueFirework(home, texture_manager.texture_array[0], game_screen, particle_manager, score_manager, explosion_array);
firework.x = (Math.random() * home.stage_width);
firework.y = (home.stage_height + 10);
entity_array.push(firework);
firework_array.push(firework);
break;
case 1:
firework = new RedFirework(home, texture_manager.texture_array[1], game_screen, particle_manager, score_manager, explosion_array);
firework.x = (Math.random() * home.stage_width);
firework.y = (home.stage_height + 10);
entity_array.push(firework);
firework_array.push(firework);
break;
case 2:
firework = new GreenFirework(home, texture_manager.texture_array[2], game_screen, particle_manager, score_manager, explosion_array);
firework.x = (Math.random() * home.stage_width);
firework.y = (home.stage_height + 10);
entity_array.push(firework);
firework_array.push(firework);
break;
case 3:
firework = new PurpleFirework(home, texture_manager.texture_array[3], game_screen, particle_manager, score_manager, explosion_array);
firework.x = (Math.random() * home.stage_width);
firework.y = (home.stage_height + 10);
entity_array.push(firework);
firework_array.push(firework);
break;
case 4:
firework = new YellowFirework(home, texture_manager.texture_array[4], game_screen, particle_manager, score_manager, explosion_array);
firework.x = (Math.random() * home.stage_width);
firework.y = (home.stage_height + 10);
entity_array.push(firework);
firework_array.push(firework);
break;
};
}
}
}//package
Section 63
//Main (Main)
package {
import flash.display.*;
import flash.events.*;
public class Main extends Sprite {
public var sound_manager:SoundManager;
public var stage_width:Number;
public var stage_height:Number;
private var texture_manager:TextureManager;
public var sandbox:Boolean;
public var ostats:OverallStats;
public var score_manager:ScoreManager;
private var game_screen:Screen;
private var collision_manager:CollisionManager;
private var firework_array:Array;
private var achievments:Achievments;
private var main_menu:MainMenu;
public var fps_counter:FpsCounter;
public var launcher:Launcher;
private var combo_list:ComboList;
private var particle_manager:ParticleManager;
private var brief_popup:BriefPopup;
private var shot_counter:ShotCounter;
private var particle_array:Array;
private var entity_array:Array;
private var explosion_array:Array;
static var boundaries:Object;
public function Main(){
this.addEventListener(Event.ADDED_TO_STAGE, init, false, 0, false);
}
public function clearGame():void{
this.removeChild(fps_counter);
this.removeChild(combo_list);
this.removeChild(score_manager);
this.removeChild(shot_counter);
if (this.ostats != null){
this.removeChild(ostats);
this.ostats = null;
};
game_screen.clear();
entity_array = [];
firework_array = [];
particle_array = [];
explosion_array = [];
this.removeEventListener(Event.ENTER_FRAME, gameLoop);
}
public function init(_arg1:Event):void{
stage_width = this.stage.stageWidth;
stage_height = this.stage.stageHeight;
main_menu = new MainMenu(this);
main_menu.x = (stage_width / 2);
main_menu.y = -20;
this.addChild(main_menu);
texture_manager = new TextureManager(this);
texture_manager.createNewTexture(new FireworkBlue(), 15, 50, 50);
texture_manager.createNewTexture(new FireworkRed(), 12, 50, 50);
texture_manager.createNewTexture(new FireworkGreen(), 8, 50, 50);
texture_manager.createNewTexture(new FireworkPurple(), 13, 50, 50);
texture_manager.createNewTexture(new FireworkYellow(), 4, 50, 50);
texture_manager.createNewTexture(new FireworkWhite(), 15, 50, 50);
entity_array = [];
particle_array = [];
explosion_array = [];
firework_array = [];
boundaries = {left:0, right:stage_width, top:0, bottom:(stage_height + 20)};
achievments = new Achievments(this);
}
public function gameOver(_arg1:Array):void{
ostats = new OverallStats(this, _arg1, score_manager.total_score);
ostats.x = (stage_width / 2);
ostats.y = (stage_height / 2);
addChild(ostats);
}
public function newGame():void{
sound_manager = new SoundManager(this);
fps_counter = new FpsCounter(entity_array, particle_array);
fps_counter.x = 20;
fps_counter.y = 20;
this.addChild(fps_counter);
if (main_menu != null){
this.removeChild(main_menu);
main_menu = null;
};
game_screen = new Screen(this, entity_array, particle_array, explosion_array, firework_array);
particle_manager = new ParticleManager(this, particle_array, game_screen.screen_data);
collision_manager = new CollisionManager(this, entity_array, explosion_array);
combo_list = new ComboList(this);
combo_list.x = (stage_width / 2);
combo_list.y = 25;
this.addChild(combo_list);
score_manager = new ScoreManager(this, combo_list);
score_manager.x = 459;
score_manager.y = 7;
this.addChild(score_manager);
shot_counter = new ShotCounter(this);
shot_counter.x = 16;
shot_counter.y = 440;
this.addChild(shot_counter);
launcher = new Launcher(this, entity_array, explosion_array, firework_array, texture_manager, game_screen, particle_manager, score_manager, shot_counter);
this.addEventListener(Event.ENTER_FRAME, gameLoop, false, 0, false);
}
private function gameLoop(_arg1:Event):void{
game_screen.updateParticlesInMemory();
game_screen.updateEntitysInMemory();
game_screen.updateExplosionsInMemory();
game_screen.bufferScreen();
game_screen.renderParticlesInMemory();
game_screen.renderEntitysInMemory();
game_screen.removeDeadParticles();
game_screen.removeDeadEntitys();
game_screen.removeDeadExplosions();
launcher.launchWave();
collision_manager.checkCollisions();
sound_manager.delayCount();
}
}
}//package
Section 64
//MainButton (MainButton)
package {
import flash.display.*;
public dynamic class MainButton extends SimpleButton {
}
}//package
Section 65
//MainMenu (MainMenu)
package {
import flash.display.*;
import flash.events.*;
import flash.net.*;
public class MainMenu extends MovieClip {
public var fingerlink:SimpleButton;
public var moregames:SimpleButton;
public var newgame_btn:SimpleButton;
public var highscore:SimpleButton;
public var playerthree:SimpleButton;
private var home:Main;
public function MainMenu(_arg1:Main){
addFrameScript(31, frame32);
home = _arg1;
newgame_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown, false, 0, true);
fingerlink.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown, false, 0, true);
playerthree.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown, false, 0, true);
moregames.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown, false, 0, true);
highscore.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown, false, 0, true);
}
private function mouseUp(_arg1:MouseEvent):void{
var _local2:URLRequest;
switch (_arg1.target.name){
case "newgame_btn":
newgame_btn.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
home.sandbox = false;
home.newGame();
break;
case "fingerlink":
fingerlink.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
_local2 = new URLRequest("http://www.fingertime.com");
navigateToURL(_local2, "_blank");
break;
case "playerthree":
playerthree.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
_local2 = new URLRequest("http://www.playerthree.net");
navigateToURL(_local2, "_blank");
break;
case "moregames":
moregames.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
_local2 = new URLRequest("http://www.fingertime.com");
navigateToURL(_local2, "_blank");
break;
case "highscore":
highscore.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
_local2 = new URLRequest("http://www.fingertime.com/fireworknights/");
navigateToURL(_local2, "_blank");
break;
};
}
private function mouseDown(_arg1:MouseEvent):void{
switch (_arg1.target.name){
case "newgame_btn":
newgame_btn.addEventListener(MouseEvent.MOUSE_UP, mouseUp, false, 0, true);
break;
case "fingerlink":
fingerlink.addEventListener(MouseEvent.MOUSE_UP, mouseUp, false, 0, true);
break;
case "playerthree":
playerthree.addEventListener(MouseEvent.MOUSE_UP, mouseUp, false, 0, true);
break;
case "moregames":
moregames.addEventListener(MouseEvent.MOUSE_UP, mouseUp, false, 0, true);
break;
case "highscore":
highscore.addEventListener(MouseEvent.MOUSE_UP, mouseUp, false, 0, true);
break;
};
}
function frame32(){
stop();
}
}
}//package
Section 66
//OverallStats (OverallStats)
package {
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.text.*;
import flash.net.*;
public class OverallStats extends Sprite {
public var replay_btn:SimpleButton;
public var two_tf:TextField;
public var one_tf:TextField;
public var moregames:SimpleButton;
public var total_tf:TextField;
public var highscore:SimpleButton;
private var tween_one:Tween;
public var three_tf:TextField;
private var t:Array;
private var home:Main;
public function OverallStats(_arg1:Main, _arg2:Array, _arg3:Number){
home = _arg1;
t = _arg2;
one_tf.text = (((((((("Display " + t[0].display) + " - ") + t[0].score) + " Firework Points plus ") + t[0].combo) + " - ") + t[0].percent) + "% Detonated!");
two_tf.text = (((((((("Display " + t[1].display) + " - ") + t[1].score) + " Firework Points plus ") + t[1].combo) + " - ") + t[1].percent) + "% Detonated!");
three_tf.text = (((((((("Display " + t[2].display) + " - ") + t[2].score) + " Firework Points plus ") + t[2].combo) + " Combo Points - ") + t[2].percent) + "% Detonated!");
total_tf.text = ("Total Score - " + _arg3);
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, false);
replay_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown, false, 0, true);
moregames.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown, false, 0, true);
highscore.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown, false, 0, true);
}
private function addedToStage(_arg1:Event):void{
tween_one = new Tween(this, "alpha", Strong.easeOut, 0, 1, 3, true);
}
private function mouseDown(_arg1:MouseEvent):void{
switch (_arg1.target.name){
case "replay_btn":
replay_btn.addEventListener(MouseEvent.MOUSE_UP, mouseUp, false, 0, true);
break;
case "moregames":
moregames.addEventListener(MouseEvent.MOUSE_UP, mouseUp, false, 0, true);
break;
case "highscore":
highscore.addEventListener(MouseEvent.MOUSE_UP, mouseUp, false, 0, true);
break;
};
}
private function mouseUp(_arg1:MouseEvent):void{
var _local2:*;
switch (_arg1.target.name){
case "replay_btn":
replay_btn.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
home.clearGame();
home.newGame();
break;
case "moregames":
moregames.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
_local2 = new URLRequest("http://www.fingertime.com");
navigateToURL(_local2, "_blank");
break;
case "highscore":
highscore.removeEventListener(MouseEvent.MOUSE_UP, mouseUp);
_local2 = new URLRequest("http://www.fingertime.com/fireworknights/");
navigateToURL(_local2, "_blank");
break;
};
}
}
}//package
Section 67
//Particle (Particle)
package {
import flash.display.*;
import flash.geom.*;
public class Particle extends Sprite {
private var move_speed:Number;
private var size:Number;
public var alive:Boolean;
private var friction:Number;
private var colour:Number;
private var fill_rectangle:Rectangle;
private var game_screen:BitmapData;
private var angle:Number;
private var life:Number;
private var home:Main;
public function Particle(_arg1:Main, _arg2:BitmapData, _arg3:Number, _arg4:Number){
home = _arg1;
game_screen = _arg2;
colour = _arg3;
size = _arg4;
angle = (Math.random() * (Math.PI * 2));
move_speed = ((Math.random() * (10 - 2)) - 2);
friction = 0.95;
life = ((Math.random() * (2 - 0.2)) + 0.5);
alive = true;
}
public function update():void{
move_speed = (move_speed * friction);
this.x = (this.x + (Math.cos(angle) * move_speed));
this.y = (this.y + (Math.sin(angle) * move_speed));
if (life > 0){
life = (life - (1 / 30));
} else {
alive = false;
};
}
public function render():void{
fill_rectangle = new Rectangle(this.x, this.y, size, size);
game_screen.fillRect(fill_rectangle, colour);
}
}
}//package
Section 68
//ParticleManager (ParticleManager)
package {
import flash.display.*;
public class ParticleManager {
private var particle_array:Array;
private var particle:Particle;
private var game_screen:BitmapData;
private var home:Main;
public function ParticleManager(_arg1:Main, _arg2:Array, _arg3:BitmapData){
home = _arg1;
particle_array = _arg2;
game_screen = _arg3;
}
public function createExplosion(_arg1:Sprite, _arg2:int, _arg3:Number, _arg4:Number):void{
var _local5:*;
_local5 = 0;
while (_local5 < _arg2) {
particle = new Particle(home, game_screen, _arg3, _arg4);
particle.x = _arg1.x;
particle.y = _arg1.y;
particle_array.push(particle);
_local5++;
};
}
}
}//package
Section 69
//Pl (Pl)
package {
import flash.media.*;
public dynamic class Pl extends Sound {
}
}//package
Section 70
//Player (Player)
package {
import flash.geom.*;
import fl.transitions.easing.*;
public class Player extends Firework {
private var start_position:Point;
private var easing_duration:Number;
private var end_position:Point;
private var time_step:int;
public function Player(_arg1:Main, _arg2:Object, _arg3:Screen, _arg4:ParticleManager, _arg5:Point, _arg6:Array){
super(_arg1, _arg2, _arg3, _arg4, null, _arg6);
start_position = _arg5;
end_position = new Point(home.mouseX, home.mouseY);
easing_duration = 50;
time_step = new Number();
particle_colour = 0xFFFFFF;
active = true;
points_worth = 0;
is_player = true;
}
override protected function newPointPopup():void{
}
override public function update():void{
var _local1:Number = (end_position.x - start_position.x);
var _local2:Number = (end_position.y - start_position.y);
this.x = Strong.easeOut(time_step, start_position.x, _local1, easing_duration);
this.y = Strong.easeOut(time_step, start_position.y, _local2, easing_duration);
if (time_step < (easing_duration - 25)){
time_step++;
} else {
explode();
};
}
override protected function updateScoreField():void{
}
override protected function playsound():void{
home.sound_manager.pl.play();
}
}
}//package
Section 71
//PointsPopup (PointsPopup)
package {
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.text.*;
public class PointsPopup extends Sprite {
private var tween_one:Tween;
public var points_tf:TextField;
private var tween_two:Tween;
private var home:Main;
public function PointsPopup(_arg1:Main, _arg2){
home = _arg1;
points_tf.text = _arg2;
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, false);
}
private function addedToStage(_arg1:Event):void{
tween_one = new Tween(this, "alpha", Strong.easeOut, 100, 0, 1, true);
tween_one.addEventListener(TweenEvent.MOTION_FINISH, remove, false, 0, true);
tween_two = new Tween(this, "y", Strong.easeOut, this.y, (this.y - 50), 1, true);
}
private function remove(_arg1:TweenEvent):void{
this.parent.removeChild(this);
}
}
}//package
Section 72
//PurpleFirework (PurpleFirework)
package {
public class PurpleFirework extends Firework {
public function PurpleFirework(_arg1:Main, _arg2:Object, _arg3:Screen, _arg4:ParticleManager, _arg5:ScoreManager, _arg6:Array){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
particle_colour = 0xFF00FF;
points_worth = 100;
}
}
}//package
Section 73
//RedFirework (RedFirework)
package {
public class RedFirework extends Firework {
public function RedFirework(_arg1:Main, _arg2:Object, _arg3:Screen, _arg4:ParticleManager, _arg5:ScoreManager, _arg6:Array){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
particle_colour = 0xC70000;
points_worth = 150;
}
}
}//package
Section 74
//ScoreManager (ScoreManager)
package {
import flash.display.*;
import flash.text.*;
public class ScoreManager extends Sprite {
private var combo_limit:Number;
private var reset_counter:Number;
private var reset_delay:Number;
public var total_score:Number;
private var checking:Boolean;
private var home:Main;
public var total_stats:Array;
private var combo_list:ComboList;
public var best_combo:Number;
public var combo_points:Number;
public var old_score:Number;
public var score_tf:TextField;
public function ScoreManager(_arg1:Main, _arg2:ComboList){
home = _arg1;
total_score = new Number();
combo_limit = 5;
combo_points = 0;
checking = false;
reset_delay = 1;
reset_counter = 0;
combo_list = _arg2;
best_combo = 0;
old_score = 0;
total_stats = [];
updateScoreField(0);
}
public function checkCombos():void{
total_score = (total_score + int((combo_points * 120)));
score_tf.text = String(total_score);
best_combo = Math.floor((combo_points * 120));
trace(best_combo);
}
private function addComboPoint():void{
combo_points = (combo_points + 1);
reset_counter = 0;
if (!checking){
checking = true;
};
}
public function fillWaveStats(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Object = new Object();
_local5.display = _arg1;
_local5.percent = _arg2;
_local5.combo = _arg3;
_local5.score = _arg4;
total_stats.push(_local5);
}
public function updateScoreField(_arg1:Number):void{
total_score = (total_score + _arg1);
old_score = (old_score + _arg1);
score_tf.text = String(total_score);
addComboPoint();
}
}
}//package
Section 75
//Screen (Screen)
package {
import flash.display.*;
import flash.geom.*;
public class Screen {
private var flash_data:BitmapData;
private var background_data:BitmapData;
public var screen_data:BitmapData;
private var home:Main;
private var background_bitmap:Bitmap;
private var firework_array:Array;
private var screen_bitmap:Bitmap;
private var particle_array:Array;
private var explosion_array:Array;
private var colour_transform:ColorTransform;
private var entity_array:Array;
public function Screen(_arg1:Main, _arg2:Array, _arg3:Array, _arg4:Array, _arg5:Array){
home = _arg1;
screen_data = new BitmapData(home.stage_width, home.stage_height, false, 0);
screen_bitmap = new Bitmap(screen_data, "auto", false);
home.addChildAt(screen_bitmap, 0);
flash_data = new BitmapData(screen_data.width, screen_data.height, true, 587202559);
colour_transform = new ColorTransform();
colour_transform.alphaMultiplier = 0.2;
background_data = new BG(0, 0);
background_data.colorTransform(background_data.rect, colour_transform);
entity_array = _arg2;
particle_array = _arg3;
explosion_array = _arg4;
firework_array = _arg5;
}
public function removeDeadParticles():void{
var _local2:*;
var _local1:Number = particle_array.length;
_local2 = (_local1 - 1);
while (_local2 >= 0) {
if (!particle_array[_local2].alive){
particle_array.splice(_local2, 1);
};
_local2--;
};
}
public function removeDeadEntitys():void{
var _local3:*;
var _local1:Number = entity_array.length;
_local3 = (_local1 - 1);
while (_local3 >= 0) {
if (!entity_array[_local3].alive){
entity_array.splice(_local3, 1);
};
_local3--;
};
var _local2:Number = firework_array.length;
_local3 = (_local2 - 1);
while (_local3 >= 0) {
if (!firework_array[_local3].alive){
firework_array.splice(_local3, 1);
};
_local3--;
};
}
public function updateParticlesInMemory():void{
var _local2:*;
var _local1:Number = particle_array.length;
_local2 = 0;
while (_local2 < _local1) {
particle_array[_local2].update();
_local2++;
};
}
public function bufferScreen():void{
screen_data.copyPixels(background_data, background_data.rect, new Point(0, -55));
}
public function updateEntitysInMemory():void{
var _local2:*;
var _local1:Number = entity_array.length;
_local2 = 0;
while (_local2 < _local1) {
entity_array[_local2].update();
_local2++;
};
}
public function updateExplosionsInMemory():void{
var _local2:*;
var _local1:Number = explosion_array.length;
_local2 = 0;
while (_local2 < _local1) {
explosion_array[_local2].update();
_local2++;
};
}
public function clear():void{
home.removeChild(screen_bitmap);
}
public function renderParticlesInMemory():void{
var _local2:*;
screen_data.lock();
var _local1:Number = particle_array.length;
_local2 = 0;
while (_local2 < _local1) {
particle_array[_local2].render();
_local2++;
};
screen_data.unlock();
}
public function removeDeadExplosions():void{
var _local2:*;
var _local1:Number = explosion_array.length;
_local2 = (_local1 - 1);
while (_local2 >= 0) {
if (!explosion_array[_local2].alive){
explosion_array.splice(_local2, 1);
};
_local2--;
};
}
public function screenFlash():void{
screen_data.copyPixels(flash_data, screen_data.rect, new Point());
}
public function renderEntitysInMemory():void{
var _local2:*;
screen_data.lock();
var _local1:Number = entity_array.length;
_local2 = 0;
while (_local2 < _local1) {
entity_array[_local2].render();
_local2++;
};
screen_data.unlock();
}
}
}//package
Section 76
//ShotCounter (ShotCounter)
package {
import flash.display.*;
public class ShotCounter extends MovieClip {
private var regen_delay:Number;
public var total_shots:Number;
private var home:Main;
public var current_shots:Number;
private var regen_counter:Number;
public function ShotCounter(_arg1:Main){
addFrameScript(0, frame1);
home = _arg1;
total_shots = 1;
current_shots = 0;
this.gotoAndStop((current_shots + 1));
visible = false;
}
function frame1(){
stop();
}
public function extraShot():void{
total_shots++;
current_shots = total_shots;
this.gotoAndStop((current_shots + 1));
}
public function reload():void{
if (current_shots < total_shots){
current_shots = total_shots;
gotoAndStop((current_shots + 1));
};
}
public function shoot():void{
if (current_shots > 0){
current_shots--;
};
this.gotoAndStop((current_shots + 1));
}
}
}//package
Section 77
//SoundManager (SoundManager)
package {
public class SoundManager {
public var ex_count:Number;
public var c_array:Array;
public var l_count:Number;
public var ex10:Ex10;
public var ex11:Ex11;
public var ex12:Ex12;
public var ex13:Ex13;
public var ex14:Ex14;
public var ex15:Ex15;
public var ex16:Ex16;
public var ex17:Ex17;
public var ex18:Ex18;
public var delay:Number;
public var af2:Af2;
public var af4:Af4;
public var c4:C4;
public var af1:Af1;
public var af3:Af3;
public var c2:C2;
public var af5:Af5;
public var c5:C5;
public var c_count:Number;
public var c1:C1;
public var c3:C3;
public var l1:L1;
public var l3:L3;
public var l5:L5;
public var l7:L7;
public var l2:L2;
public var af_array:Array;
public var l4:L4;
public var l6:L6;
public var l8:L8;
public var l9:L9;
public var l_array:Array;
public var ex1:Ex1;
public var ex2:Ex2;
public var ex3:Ex3;
public var ex4:Ex4;
public var ex5:Ex5;
public var ex6:Ex6;
public var ex7:Ex7;
public var ex8:Ex8;
public var ex9:Ex9;
private var home:Main;
public var af_count:Number;
public var ex_array:Array;
public var pl:Pl;
public function SoundManager(_arg1:Main){
ex1 = new Ex1();
ex2 = new Ex2();
ex3 = new Ex3();
ex4 = new Ex4();
ex5 = new Ex5();
ex6 = new Ex6();
ex7 = new Ex7();
ex8 = new Ex8();
ex9 = new Ex9();
ex10 = new Ex10();
ex11 = new Ex11();
ex12 = new Ex12();
ex13 = new Ex13();
ex14 = new Ex14();
ex15 = new Ex15();
ex16 = new Ex16();
ex17 = new Ex17();
ex18 = new Ex18();
af1 = new Af1();
af2 = new Af2();
af3 = new Af3();
af4 = new Af4();
af5 = new Af5();
l1 = new L1();
l2 = new L2();
l3 = new L3();
l4 = new L4();
l5 = new L5();
l6 = new L6();
l7 = new L7();
l8 = new L8();
l9 = new L9();
c1 = new C1();
c2 = new C2();
c3 = new C3();
c4 = new C4();
c5 = new C5();
pl = new Pl();
super();
home = _arg1;
ex_array = [ex1, ex2, ex3, ex4, ex5, ex6, ex7, ex8, ex9, ex10, ex11, ex12, ex13, ex14, ex15, ex16, ex17, ex18];
ex_count = 0;
af_count = 0;
af_array = [af1, af2, af3, af4, af5];
l_count = 0;
l_array = [l1, l2, l3, l4, l5, l6, l7, l8, l9];
c_count = 0;
c_array = [c1, c2, c3, c4, c5];
delay = 0.3;
}
public function playLaunch():void{
var _local1:Number;
if (l_count < 10){
_local1 = Math.floor((Math.random() * l_array.length));
l_array[_local1].play();
l_count = (l_count + 1);
};
}
public function playAfter():void{
var _local1:Number;
if (af_count < 5){
_local1 = Math.floor((Math.random() * af_array.length));
af_array[_local1].play();
af_count = (af_count + 1);
};
}
public function playExplosion():void{
var _local1:Number;
if (ex_count < 11){
_local1 = Math.floor((Math.random() * ex_array.length));
ex_array[_local1].play();
ex_count = (ex_count + 1);
};
}
public function playCrowd():void{
var _local1:Number;
if (c_count < 10){
_local1 = Math.floor((Math.random() * c_array.length));
c_array[_local1].play();
c_count = (c_count + 1);
};
}
public function delayCount():void{
if (delay < 0){
ex_count = (ex_count - 1);
af_count = (af_count - 1);
l_count = (l_count - 1);
c_count = (c_count - 1);
delay = 0.3;
} else {
delay = (delay - (1 / 30));
};
}
}
}//package
Section 78
//StatsPopup (StatsPopup)
package {
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.text.*;
public class StatsPopup extends Sprite {
private var wave:Number;
public var combo_tf:TextField;
private var score_earned:Number;
public var fireworks_tf:TextField;
private var fireworks:Number;
public var points_tf:TextField;
private var tween_one:Tween;
private var total_subs:Number;
private var home:Main;
private var dead_fireworks:Number;
private var best_combo:Number;
public var wave_tf:TextField;
private var shots:Number;
private var tween_two:Tween;
public function StatsPopup(_arg1:Main, _arg2:Number, _arg3:Number, _arg4:Array, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number, _arg9:Number){
home = _arg1;
dead_fireworks = _arg2;
best_combo = _arg3;
score_earned = _arg5;
wave = _arg6;
fireworks = _arg7;
shots = _arg8;
total_subs = _arg9;
fireworks_tf.text = (("" + int(((dead_fireworks / 120) * 100))) + "% of Fireworks Exploded");
combo_tf.text = (("" + best_combo) + " Combo Points");
points_tf.text = (("" + _arg5) + " Firework Points");
alpha = 0;
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, false);
}
private function remove(_arg1:TweenEvent):void{
var _local2:BriefPopup;
_local2 = new BriefPopup(home, wave, fireworks, shots, total_subs);
_local2.x = x;
_local2.y = y;
home.addChild(_local2);
parent.removeChild(this);
}
private function fadeOut(_arg1:TweenEvent):void{
tween_two = new Tween(this, "alpha", Strong.easeOut, 1, 0, 2, true);
tween_two.addEventListener(TweenEvent.MOTION_FINISH, remove, false, 0, true);
}
private function addedToStage(_arg1:Event):void{
tween_one = new Tween(this, "alpha", Strong.easeOut, 0, 1, 3, true);
tween_one.addEventListener(TweenEvent.MOTION_FINISH, fadeOut, false, 0, true);
}
}
}//package
Section 79
//TextureManager (TextureManager)
package {
import flash.display.*;
public class TextureManager {
public var texture_array:Array;
private var home:Main;
public function TextureManager(_arg1:Main){
home = _arg1;
texture_array = new Array();
}
public function createNewTexture(_arg1:Sprite, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local5:Object = new Object();
_local5.sprite = _arg1;
_local5.sprite.width = (_local5.sprite.height = _arg2);
_local5.sprite.x = (_arg3 / 2);
_local5.sprite.y = (_arg4 / 2);
_local5.tile_width = _arg3;
_local5.tile_height = _arg4;
_local5.data = new BitmapData(_arg3, _arg4, true, 0);
_local5.data.draw(_local5.sprite, _local5.sprite.transform.matrix);
texture_array.push(_local5);
}
}
}//package
Section 80
//TimePopup (TimePopup)
package {
import flash.display.*;
import flash.events.*;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.text.*;
public class TimePopup extends Sprite {
private var tween_one:Tween;
public var info_tf:TextField;
private var tween_two:Tween;
private var combo_list:ComboList;
public function TimePopup(_arg1:ComboList, _arg2:Number){
combo_list = _arg1;
info_tf.text = ("Score Bonus -" + _arg2);
addEventListener(Event.ADDED_TO_STAGE, addedToStage, false, 0, false);
}
private function addedToStage(_arg1:Event):void{
tween_one = new Tween(this, "alpha", Strong.easeOut, 100, 0, 2, true);
tween_one.addEventListener(TweenEvent.MOTION_FINISH, remove, false, 0, true);
tween_two = new Tween(this, "y", Strong.easeOut, this.y, (this.y - 10), 2, true);
}
private function remove(_arg1:TweenEvent):void{
combo_list.combo_count = (combo_list.combo_count - 1);
combo_list.removeChild(this);
}
}
}//package
Section 81
//YellowFirework (YellowFirework)
package {
public class YellowFirework extends Firework {
public function YellowFirework(_arg1:Main, _arg2:Object, _arg3:Screen, _arg4:ParticleManager, _arg5:ScoreManager, _arg6:Array){
super(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6);
particle_colour = 0xFFFF00;
points_worth = 50;
}
}
}//package