Section 1
//MainTimeline (source_fla.MainTimeline)
package source_fla {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public dynamic class MainTimeline extends MovieClip {
public var bellTotal:int;
public var txtScore:TextField;
public var finalScreen:mcFinalStats;
public var mainSpeed:int;
public var bellHolder:MovieClip;
public var jumpSpeedLimit:int;
public var score:int;
public var totalHeight:Number;
public var btn_playgame:SimpleButton;
public var startedJumping:Boolean;
public var jumpSpeed:Number;
public var bellLastCoord:Number;
public var bar_mc:MovieClip;
public var bgHolder:MovieClip;
public var bellTop:Number;
public var scoreInc:int;
public var gameOver:Boolean;
public var mcMain:MovieClip;
public var bellTime:int;
public var fallingTime:int;
public var bellLimit:int;
public var mainJumping;
public function MainTimeline(){
addFrameScript(0, frame1, 1, frame2, 2, frame3);
}
public function mainJump():void{
if (((mainJumping) && (!(gameOver)))){
if (jumpSpeed < 0){
jumpSpeed = (jumpSpeed * (1 - (jumpSpeedLimit / 120)));
if (jumpSpeed > (-(jumpSpeedLimit) * 0.1)){
jumpSpeed = (jumpSpeed * -1);
};
};
if ((((jumpSpeed > 0)) && ((jumpSpeed <= jumpSpeedLimit)))){
jumpSpeed = (jumpSpeed * (1 + (jumpSpeedLimit / 120)));
};
mcMain.y = (mcMain.y + jumpSpeed);
if (mcMain.y >= 385){
if (startedJumping){
gameOver = true;
showFinalStats();
};
mainJumping = false;
};
totalHeight = (totalHeight - jumpSpeed);
};
if (mcMain.y > 387.5){
mcMain.y = 387.5;
};
}
public function eFrame(_arg1:Event):void{
if (mouseX > (mcMain.x + 25)){
mcMain.x = (mcMain.x + mainSpeed);
} else {
if (mouseX < (mcMain.x - 25)){
mcMain.x = (mcMain.x - mainSpeed);
} else {
mcMain.x = mouseX;
};
};
mainJump();
makeLvl();
moveScreen();
txtScore.text = ("Score: " + score);
var _local2:Shape = new Shape();
var _local3:int = (int((Math.random() * 3)) + 2);
_local2.graphics.beginFill(0xDFDFDF, 1);
_local2.graphics.drawRoundRect(_local3, _local3, _local3, _local3, (_local3 / 1.2));
_local2.x = int((Math.random() * stage.stageWidth));
_local2.y = (bellTop - bgHolder.y);
bgHolder.addChild(_local2);
bgHolder.y = (bgHolder.y + 2);
}
public function moveScreen():void{
if (mcMain.y <= 125){
mcMain.y = 125;
bellHolder.y = (bellHolder.y - jumpSpeed);
bellTop = (bellTop + jumpSpeed);
bellLimit = 6;
} else {
bellLimit = 20;
};
if ((((mcMain.y >= 999999999)) && ((totalHeight >= 999999999)))){
bellHolder.y = (bellHolder.y - jumpSpeed);
bellTop = (bellTop + jumpSpeed);
mcMain.y = 275;
fallingTime++;
if (fallingTime >= 30){
gameOver = true;
};
};
}
public function playgame(_arg1:MouseEvent):void{
nextFrame();
}
public function showFinalStats():void{
addChild(finalScreen);
finalScreen.x = 115;
finalScreen.y = 75;
finalScreen.txtFinalScore.text = String(score);
finalScreen.btnPlayAgain.addEventListener(MouseEvent.CLICK, clickPlayAgain);
}
public function startJump(_arg1:MouseEvent):void{
if (!mainJumping){
mainJumping = true;
jumpSpeed = (jumpSpeedLimit * -1);
};
}
public function loading(_arg1:Event):void{
var _local2:Number = this.stage.loaderInfo.bytesTotal;
var _local3:Number = this.stage.loaderInfo.bytesLoaded;
bar_mc.scaleX = (_local3 / _local2);
if (_local2 == _local3){
play();
this.removeEventListener(Event.ENTER_FRAME, loading);
};
}
public function makeLvl():void{
var _local1:Bell;
var _local2:Bird;
bellTime++;
if (bellTime >= bellLimit){
bellTotal++;
_local1 = new Bell();
bellHolder.addChild(_local1);
bellTime = 0;
};
if ((((((int((bellTotal / 20)) == (bellTotal / 20))) && ((bellTime == 1)))) && (!((bellTotal == 0))))){
_local2 = new Bird();
bellHolder.addChild(_local2);
};
}
public function clickPlayAgain(_arg1:MouseEvent):void{
removeChild(finalScreen);
gameOver = false;
startedJumping = false;
score = 0;
scoreInc = 0;
}
function frame2(){
stop();
btn_playgame.addEventListener(MouseEvent.CLICK, playgame);
}
function frame1(){
stop();
this.addEventListener(Event.ENTER_FRAME, loading);
}
function frame3(){
stop();
mainSpeed = 25;
mainJumping = false;
jumpSpeed = 0;
jumpSpeedLimit = 25;
bellTime = 0;
bellLimit = 20;
bellTop = -50;
bellTotal = 0;
bellLastCoord = 0;
totalHeight = 0;
startedJumping = false;
score = 0;
scoreInc = 0;
gameOver = false;
fallingTime = 0;
addEventListener(Event.ENTER_FRAME, eFrame);
bellHolder = new MovieClip();
addChild(bellHolder);
bgHolder = new MovieClip();
bellHolder.addChild(bgHolder);
stage.addEventListener(MouseEvent.CLICK, startJump);
finalScreen = new mcFinalStats();
MovieClip(root).setChildIndex(mcMain, (MovieClip(root).numChildren - 1));
}
}
}//package source_fla
Section 2
//Bell (Bell)
package {
import flash.events.*;
import flash.display.*;
public class Bell extends MovieClip {
var _root:Object;
public function Bell(){
addEventListener(Event.ADDED, beginClass);
addEventListener(Event.ENTER_FRAME, eFrame);
}
private function eFrame(_arg1:Event):void{
var _local2:ScoreAdd;
var _local3:Number;
var _local4:Droplet1;
var _local5:Droplet2;
var _local6:Droplet3;
this.y = (this.y + 3);
if (this.hitTestObject(_root.mcMain)){
_root.mainJumping = true;
_root.jumpSpeed = (_root.jumpSpeedLimit * -1);
_root.scoreInc = (_root.scoreInc + 10);
_root.score = (_root.score + _root.scoreInc);
_local2 = new ScoreAdd();
_root.bellHolder.addChild(_local2);
_local2.x = this.x;
_local2.y = this.y;
_local2.txtScore.text = _root.scoreInc;
_local3 = Math.round((Math.random() * 3));
if (_local3 == 1){
_local4 = new Droplet1();
_local4.play();
} else {
if (_local3 == 2){
_local5 = new Droplet2();
_local5.play();
} else {
_local6 = new Droplet3();
_local6.play();
};
};
this.removeEventListener(Event.ENTER_FRAME, eFrame);
_root.bellHolder.removeChild(this);
_root.startedJumping = true;
};
if (_root.gameOver){
this.removeEventListener(Event.ENTER_FRAME, eFrame);
_root.bellHolder.removeChild(this);
};
}
private function beginClass(_arg1:Event):void{
_root = MovieClip(root);
if (_root.bellTotal == 1){
this.x = (Math.random() * 525);
_root.bellLastCoord = this.x;
} else {
this.x = ((_root.bellLastCoord + (Math.random() * 500)) - 250);
if (this.x > 537.5){
this.x = (this.x - 250);
} else {
if (this.x < 12.5){
this.x = (this.x + 250);
};
};
};
this.y = _root.bellTop;
}
}
}//package
Section 3
//Bird (Bird)
package {
import flash.events.*;
import flash.display.*;
public class Bird extends MovieClip {
var _root:Object;
public function Bird(){
addEventListener(Event.ADDED, beginClass);
addEventListener(Event.ENTER_FRAME, eFrame);
}
private function eFrame(_arg1:Event):void{
var _local2:ScoreAdd;
var _local3:Number;
var _local4:Droplet1;
var _local5:Droplet2;
var _local6:Droplet3;
this.y = (this.y + 3);
if (this.hitTestObject(_root.mcMain)){
_root.mainJumping = true;
_root.jumpSpeed = (_root.jumpSpeedLimit * -1);
_local2 = new ScoreAdd();
_root.bellHolder.addChild(_local2);
_local2.x = this.x;
_local2.y = this.y;
_local2.txtScore.text = "Double Score";
_local2.txtScore.textColor = 16770131;
this.removeEventListener(Event.ENTER_FRAME, eFrame);
_root.bellHolder.removeChild(this);
_local3 = Math.round((Math.random() * 3));
if (_local3 == 1){
_local4 = new Droplet1();
_local4.play();
} else {
if (_local3 == 2){
_local5 = new Droplet2();
_local5.play();
} else {
_local6 = new Droplet3();
_local6.play();
};
};
_root.score = (_root.score * 2);
_root.startedJumping = true;
};
if (_root.gameOver){
this.removeEventListener(Event.ENTER_FRAME, eFrame);
_root.bellHolder.removeChild(this);
};
}
private function beginClass(_arg1:Event):void{
_root = MovieClip(root);
this.x = (Math.random() * 525);
this.y = _root.bellTop;
}
}
}//package
Section 4
//Droplet1 (Droplet1)
package {
import flash.media.*;
public dynamic class Droplet1 extends Sound {
}
}//package
Section 5
//Droplet2 (Droplet2)
package {
import flash.media.*;
public dynamic class Droplet2 extends Sound {
}
}//package
Section 6
//Droplet3 (Droplet3)
package {
import flash.media.*;
public dynamic class Droplet3 extends Sound {
}
}//package
Section 7
//mcFinalStats (mcFinalStats)
package {
import flash.display.*;
import flash.text.*;
public dynamic class mcFinalStats extends MovieClip {
public var txtFinalScore:TextField;
public var btnPlayAgain:SimpleButton;
}
}//package
Section 8
//ScoreAdd (ScoreAdd)
package {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public dynamic class ScoreAdd extends MovieClip {
public var txtScore:TextField;
public var timeLeft:int;
public function ScoreAdd(){
addFrameScript(0, frame1);
}
function frame1(){
timeLeft = 12;
this.addEventListener(Event.ENTER_FRAME, timeCheck);
}
public function timeCheck(_arg1:Event):void{
this.timeLeft--;
if (this.timeLeft == 0){
this.parent.removeChild(this);
};
}
}
}//package