Section 1
//ArrayUtil (com.adobe.utils.ArrayUtil)
package com.adobe.utils {
public class ArrayUtil {
public static function arraysAreEqual(_arg1:Array, _arg2:Array):Boolean{
if (_arg1.length != _arg2.length){
return (false);
};
var _local3:Number = _arg1.length;
var _local4:Number = 0;
while (_local4 < _local3) {
if (_arg1[_local4] !== _arg2[_local4]){
return (false);
};
_local4++;
};
return (true);
}
public static function arrayContainsValue(_arg1:Array, _arg2:Object):Boolean{
return (!((_arg1.indexOf(_arg2) == -1)));
}
public static function copyArray(_arg1:Array):Array{
return (_arg1.slice());
}
public static function removeValueFromArray(_arg1:Array, _arg2:Object):void{
var _local3:uint = _arg1.length;
var _local4:Number = _local3;
while (_local4 > -1) {
if (_arg1[_local4] === _arg2){
_arg1.splice(_local4, 1);
};
_local4--;
};
}
public static function createUniqueCopy(_arg1:Array):Array{
var _local4:Object;
var _local2:Array = new Array();
var _local3:Number = _arg1.length;
var _local5:uint;
while (_local5 < _local3) {
_local4 = _arg1[_local5];
if (_slot1.arrayContainsValue(_local2, _local4)){
} else {
_local2.push(_local4);
};
_local5++;
};
return (_local2);
}
}
}//package com.adobe.utils
Section 2
//HighscoresLoader (com.miniclip.highscores.HighscoresLoader)
package com.miniclip.highscores {
import flash.events.*;
import flash.display.*;
import flash.net.*;
public class HighscoresLoader extends EventDispatcher {
private static const OFFSITE_SWF:String = "highscores_offsite.swf";
private static const ALLOWED_DOMAINS:Array = ["http://miniclip.com", "http://www.miniclip.com", "http://cms.miniclip.com", "miniclips.com"];
private static const HIGHSCORESBOX_SWF:String = "highscoresbox_v3.swf";
public static var ldr:Loader;
private static var URL_PREFIX:String;
private static var localConnectionID:String;
public static var target:DisplayObjectContainer;
public static var score:Number;
private static var firstrun:Boolean = true;
private static var objLocalConnection:LocalConnection;
private static var singleInstance:HighscoresLoader;
protected static function buildQueryString():String{
var _local3:String;
var _local1 = "?";
var _local2 = "";
for (_local3 in target.stage.loaderInfo.parameters) {
_local1 = (_local1 + (((_local2 + _local3) + "=") + escape(target.stage.loaderInfo.parameters[_local3])));
_local2 = "&";
};
_local1 = (_local1 + ("&mc_lcid=" + localConnectionID));
return (_local1);
}
private static function handleTargetRemoved(_arg1:Event):void{
target = null;
}
protected static function validateDomain():Boolean{
var _local1:Boolean;
var _local2:String = target.stage.loaderInfo.url;
var _local3:Number = 0;
while (_local3 < ALLOWED_DOMAINS.length) {
if (_local2.indexOf(ALLOWED_DOMAINS[_local3]) >= 0){
_local1 = true;
};
_local3++;
};
return (_local1);
}
public static function hsbready():void{
sendScore();
}
private static function initialize():void{
var _local1:String;
objLocalConnection = new LocalConnection();
objLocalConnection.client = HighscoresLoader;
objLocalConnection.allowDomain("www.miniclip.com", "cms.miniclip.com");
objLocalConnection.connect((localConnectionID + "back"));
if (validateDomain()){
_local1 = buildQueryString();
ldr.load(new URLRequest(((URL_PREFIX + HIGHSCORESBOX_SWF) + _local1)));
} else {
ldr.load(new URLRequest((URL_PREFIX + OFFSITE_SWF)));
};
}
public static function hsbhidden():void{
singleInstance.dispatchEvent(new Event("close"));
}
private static function onLCStatus(_arg1:Event):void{
}
public static function start(_arg1:Stage, _arg2:Number=undefined):HighscoresLoader{
trace(("HighscoresLoader.start / score:" + _arg2));
URL_PREFIX = ((_arg1.loaderInfo.url.substring(0, 8))=="file:///") ? "http://www.miniclip.com/swfcontent/components/" : "/swfcontent/components/";
HighscoresLoader.score = (isNaN(_arg2)) ? undefined : Number(_arg2);
if (target == null){
target = _arg1;
target.addEventListener(Event.REMOVED_FROM_STAGE, handleTargetRemoved);
if (firstrun){
singleInstance = new (HighscoresLoader);
localConnectionID = ("LC" + String(Math.floor((Math.random() * 1000000))));
ldr = new Loader();
target.addChild(ldr);
initialize();
} else {
target.addChild(ldr);
sendScore();
};
} else {
sendScore();
};
firstrun = false;
return (singleInstance);
}
public static function sendScore():void{
var _local1:LocalConnection = new LocalConnection();
_local1.addEventListener(StatusEvent.STATUS, onLCStatus);
_local1.send(localConnectionID, "setScore", score);
}
}
}//package com.miniclip.highscores
Section 3
//DashedLine (com.senocular.drawing.DashedLine)
package com.senocular.drawing {
import flash.geom.*;
public class DashedLine {
private var overflow:Number;// = 0
public var target:Object;
private var pen:Point;
private var dashLength:Number;// = 0
private var onLength:Number;// = 0
public var _curveaccuracy:Number;// = 6
private var offLength:Number;// = 0
private var isLine:Boolean;// = true
public function DashedLine(_arg1:Object, _arg2:Number, _arg3:Number){
this.target = _arg1.graphics;
this.setDash(_arg2, _arg3);
this.isLine = true;
this.overflow = 0;
this.pen = new Point(0, 0);
}
private function targetCurveTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
if ((((((((_arg1 == _arg3)) && ((_arg2 == _arg4)))) && ((_arg3 == this.pen.x)))) && ((_arg4 == this.pen.y)))){
return;
};
this.pen.x = _arg3;
this.pen.y = _arg4;
this.target.curveTo(_arg1, _arg2, _arg3, _arg4);
}
public function curveTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):void{
var _local10:Array;
var _local15:int;
var _local5:Number = this.pen.x;
var _local6:Number = this.pen.y;
var _local7:Number = this.curveLength(_local5, _local6, _arg1, _arg2, _arg3, _arg4, 0);
var _local8:Number = 0;
var _local9:Number = 0;
if (this.overflow){
if (this.overflow > _local7){
if (this.isLine){
this.targetCurveTo(_arg1, _arg2, _arg3, _arg4);
} else {
this.targetMoveTo(_arg3, _arg4);
};
this.overflow = (this.overflow - _local7);
return;
};
_local8 = (this.overflow / _local7);
_local10 = this.curveSliceUpTo(_local5, _local6, _arg1, _arg2, _arg3, _arg4, _local8);
if (this.isLine){
this.targetCurveTo(_local10[2], _local10[3], _local10[4], _local10[5]);
} else {
this.targetMoveTo(_local10[4], _local10[5]);
};
this.overflow = 0;
this.isLine = !(this.isLine);
if (!_local7){
return;
};
};
var _local11:Number = (_local7 - (_local7 * _local8));
var _local12:Number = Math.floor((_local11 / this.dashLength));
var _local13:Number = (this.onLength / _local7);
var _local14:Number = (this.offLength / _local7);
if (_local12){
_local15 = 0;
while (_local15 < _local12) {
if (this.isLine){
_local9 = (_local8 + _local13);
_local10 = this.curveSlice(_local5, _local6, _arg1, _arg2, _arg3, _arg4, _local8, _local9);
this.targetCurveTo(_local10[2], _local10[3], _local10[4], _local10[5]);
_local8 = _local9;
_local9 = (_local8 + _local14);
_local10 = this.curveSlice(_local5, _local6, _arg1, _arg2, _arg3, _arg4, _local8, _local9);
this.targetMoveTo(_local10[4], _local10[5]);
} else {
_local9 = (_local8 + _local14);
_local10 = this.curveSlice(_local5, _local6, _arg1, _arg2, _arg3, _arg4, _local8, _local9);
this.targetMoveTo(_local10[4], _local10[5]);
_local8 = _local9;
_local9 = (_local8 + _local13);
_local10 = this.curveSlice(_local5, _local6, _arg1, _arg2, _arg3, _arg4, _local8, _local9);
this.targetCurveTo(_local10[2], _local10[3], _local10[4], _local10[5]);
};
_local8 = _local9;
_local15++;
};
};
_local11 = (_local7 - (_local7 * _local8));
if (this.isLine){
if (_local11 > this.onLength){
_local9 = (_local8 + _local13);
_local10 = this.curveSlice(_local5, _local6, _arg1, _arg2, _arg3, _arg4, _local8, _local9);
this.targetCurveTo(_local10[2], _local10[3], _local10[4], _local10[5]);
this.targetMoveTo(_arg3, _arg4);
this.overflow = (this.offLength - (_local11 - this.onLength));
this.isLine = false;
} else {
_local10 = this.curveSliceFrom(_local5, _local6, _arg1, _arg2, _arg3, _arg4, _local8);
this.targetCurveTo(_local10[2], _local10[3], _local10[4], _local10[5]);
if (_local7 == this.onLength){
this.overflow = 0;
this.isLine = !(this.isLine);
} else {
this.overflow = (this.onLength - _local11);
this.targetMoveTo(_arg3, _arg4);
};
};
} else {
if (_local11 > this.offLength){
_local9 = (_local8 + _local14);
_local10 = this.curveSlice(_local5, _local6, _arg1, _arg2, _arg3, _arg4, _local8, _local9);
this.targetMoveTo(_local10[4], _local10[5]);
_local10 = this.curveSliceFrom(_local5, _local6, _arg1, _arg2, _arg3, _arg4, _local9);
this.targetCurveTo(_local10[2], _local10[3], _local10[4], _local10[5]);
this.overflow = (this.onLength - (_local11 - this.offLength));
this.isLine = true;
} else {
this.targetMoveTo(_arg3, _arg4);
if (_local11 == this.offLength){
this.overflow = 0;
this.isLine = !(this.isLine);
} else {
this.overflow = (this.offLength - _local11);
};
};
};
}
public function clear():void{
this.target.clear();
}
public function setDash(_arg1:Number, _arg2:Number):void{
this.onLength = _arg1;
this.offLength = _arg2;
this.dashLength = (this.onLength + this.offLength);
}
public function lineStyle(_arg1:Number, _arg2:Number, _arg3:Number):void{
this.target.lineStyle(_arg1, _arg2, _arg3);
}
private function curveSlice(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number, _arg8:Number):Array{
if (_arg7 == 0){
return (this.curveSliceUpTo(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg8));
};
if (_arg8 == 1){
return (this.curveSliceFrom(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg7));
};
var _local9:Array = this.curveSliceUpTo(_arg1, _arg2, _arg3, _arg4, _arg5, _arg6, _arg8);
_local9.push((_arg7 / _arg8));
return (this.curveSliceFrom.apply(this, _local9));
}
private function targetMoveTo(_arg1:Number, _arg2:Number):void{
this.pen.x = _arg1;
this.pen.y = _arg2;
this.target.moveTo(_arg1, _arg2);
}
public function moveTo(_arg1:Number, _arg2:Number):void{
this.targetMoveTo(_arg1, _arg2);
}
private function curveSliceFrom(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Array{
var _local8:Number;
var _local9:Number;
if (isNaN(_arg7)){
_arg7 = 1;
};
if (_arg7 != 1){
_local8 = (_arg1 + ((_arg3 - _arg1) * _arg7));
_local9 = (_arg2 + ((_arg4 - _arg2) * _arg7));
_arg3 = (_arg3 + ((_arg5 - _arg3) * _arg7));
_arg4 = (_arg4 + ((_arg6 - _arg4) * _arg7));
_arg1 = (_local8 + ((_arg3 - _local8) * _arg7));
_arg2 = (_local9 + ((_arg4 - _local9) * _arg7));
};
return ([_arg1, _arg2, _arg3, _arg4, _arg5, _arg6]);
}
private function curveLength(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Number{
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local16:Number;
var _local17:Number;
var _local8:Number = 0;
var _local9:Number = _arg1;
var _local10:Number = _arg2;
var _local18:Number = (_arg7) ? _arg7 : this._curveaccuracy;
var _local19:Number = 1;
while (_local19 <= _local18) {
_local13 = (_local19 / _local18);
_local14 = (1 - _local13);
_local15 = ((1 - _local13) * _local14);
_local16 = ((2 * _local13) * _local14);
_local17 = (_local13 * _local13);
_local11 = (((_local15 * _arg1) + (_local16 * _arg3)) + (_local17 * _arg5));
_local12 = (((_local15 * _arg2) + (_local16 * _arg4)) + (_local17 * _arg6));
_local8 = (_local8 + this.lineLength(_local9, _local10, _local11, _local12));
_local9 = _local11;
_local10 = _local12;
_local19++;
};
return (_local8);
}
private function curveSliceUpTo(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:Number):Array{
var _local8:Number;
var _local9:Number;
if (isNaN(_arg7)){
_arg7 = 1;
};
if (_arg7 != 1){
_local8 = (_arg3 + ((_arg5 - _arg3) * _arg7));
_local9 = (_arg4 + ((_arg6 - _arg4) * _arg7));
_arg3 = (_arg1 + ((_arg3 - _arg1) * _arg7));
_arg4 = (_arg2 + ((_arg4 - _arg2) * _arg7));
_arg5 = (_arg3 + ((_local8 - _arg3) * _arg7));
_arg6 = (_arg4 + ((_local9 - _arg4) * _arg7));
};
return ([_arg1, _arg2, _arg3, _arg4, _arg5, _arg6]);
}
private function lineLength(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number):Number{
if (arguments.length == 2){
return (Math.sqrt(((_arg1 * _arg1) + (_arg2 * _arg2))));
};
var _local6:Number = (_arg3 - _arg1);
var _local7:Number = (_arg4 - _arg2);
return (Math.sqrt(((_local6 * _local6) + (_local7 * _local7))));
}
}
}//package com.senocular.drawing
Section 4
//BasicSprite (de.pixelate.mrbounce.base.BasicSprite)
package de.pixelate.mrbounce.base {
import flash.geom.*;
import flash.display.*;
import flash.filters.*;
public class BasicSprite extends Sprite {
protected var m_height:Number;
protected var m_halfWidth:Number;
protected var m_halfHeight:Number;
protected var m_posX:Number;
protected var m_posY:Number;
protected var m_color:uint;
protected var m_id:int;
protected var m_width:Number;
public function BasicSprite(){
this.mouseEnabled = false;
this.mouseChildren = false;
}
protected function setSize(_arg1:Number, _arg2:Number):void{
this.m_width = _arg1;
this.m_height = _arg2;
this.m_halfWidth = (_arg1 / 2);
this.m_halfHeight = (_arg2 / 2);
}
public function getLeftBorder():Number{
return ((this.m_posX - this.m_halfWidth));
}
protected function setGlow(_arg1:Number=2):void{
var _local2:Number = 0.6;
var _local3:Number = 8;
var _local4:Number = 8;
var _local5:GlowFilter = new GlowFilter(m_color, _local2, _local3, _local4, _arg1);
this.filters = [_local5];
}
public function getWidth():Number{
return (this.m_width);
}
public function getId():int{
return (this.m_id);
}
public function updatePosition():void{
this.x = this.m_posX;
this.y = this.m_posY;
}
public function getHeight():Number{
return (this.m_height);
}
public function getPosition():Point{
var _local1:Point = new Point(this.m_posX, this.m_posY);
return (_local1);
}
protected function setDynamicGlow(_arg1:Number=0):void{
var _local2:Number = (_arg1 * 1);
var _local3:Number = 0.6;
var _local4:Number = (_local2 * 8);
var _local5:Number = (_local2 * 8);
var _local6:GlowFilter = new GlowFilter(m_color, _local3, _local4, _local5, _local2);
this.filters = [_local6];
}
public function getTopBorder():Number{
return ((this.m_posY - this.m_halfHeight));
}
public function getRightBorder():Number{
return ((this.m_posX + this.m_halfWidth));
}
public function destroy():void{
parent.removeChild(this);
}
public function getBottomBorder():Number{
return ((this.m_posY + this.m_halfHeight));
}
}
}//package de.pixelate.mrbounce.base
Section 5
//CollisionSprite (de.pixelate.mrbounce.base.CollisionSprite)
package de.pixelate.mrbounce.base {
import de.pixelate.mrbounce.game.*;
import flash.geom.*;
import de.pixelate.mrbounce.enumerations.*;
import de.pixelate.mrbounce.geometry.*;
public class CollisionSprite extends EditableSprite {
public function getHorizontalCollision(_arg1:BasicSprite):Boolean{
var _local2:Number = _arg1.getLeftBorder();
var _local3:Number = _arg1.getRightBorder();
var _local4:Number = _arg1.getTopBorder();
var _local5:Number = _arg1.getBottomBorder();
var _local6:Boolean;
if (this.m_speedX < 0){
if ((((this.getLeftBorder() < _local3)) && ((this.getRightBorder() >= (_local3 + this.m_speedX))))){
if ((((this.getTopBorder() < _local5)) && ((this.getBottomBorder() > _local4)))){
this.m_posX = (_local3 + this.m_halfWidth);
_local6 = true;
};
};
} else {
if (this.m_speedX > 0){
if ((((this.getRightBorder() > _local2)) && ((this.getLeftBorder() <= (_local2 + this.m_speedX))))){
if ((((this.getTopBorder() < _local5)) && ((this.getBottomBorder() > _local4)))){
this.m_posX = (_local2 - this.m_halfWidth);
_local6 = true;
};
};
};
};
this.updatePosition();
return (_local6);
}
public function getBouncerCollisionX(_arg1:Bouncer):Boolean{
var _local2:Boolean;
if (_arg1.getLeftSide()){
_local2 = getHorizontalCollision(_arg1.getLeftSide());
if (_local2){
_arg1.destroySide(Side.LEFT);
_arg1.push(this.getSpeedX(), (this.getSpeedY() * -1));
};
};
if (((!(_local2)) && (_arg1.getRightSide()))){
_local2 = getHorizontalCollision(_arg1.getRightSide());
if (_local2){
_arg1.destroySide(Side.RIGHT);
_arg1.push(this.getSpeedX(), (this.getSpeedY() * -1));
};
};
return (_local2);
}
public function getBouncerCollisionY(_arg1:Bouncer):Boolean{
var _local2:Boolean;
if (_arg1.getUpSide()){
_local2 = getVerticalCollision(_arg1.getUpSide());
if (_local2){
_arg1.destroySide(Side.TOP);
_arg1.push(this.getSpeedX(), (this.getSpeedY() * -1));
};
};
if (((!(_local2)) && (_arg1.getDownSide()))){
_local2 = getVerticalCollision(_arg1.getDownSide());
if (_local2){
_arg1.destroySide(Side.BOTTOM);
_arg1.push(this.getSpeedX(), (this.getSpeedY() * -1));
};
};
return (_local2);
}
public function getBouncerCollision(_arg1:Bouncer):Direction{
var _local2:Number = _arg1.getLeftBorder();
var _local3:Number = _arg1.getRightBorder();
var _local4:Number = _arg1.getTopBorder();
var _local5:Number = _arg1.getBottomBorder();
var _local6:Direction;
if (this.m_speedY < 0){
if ((((this.getBottomBorder() > _local4)) && ((this.getTopBorder() <= (_local4 - this.m_speedY))))){
if ((((this.getRightBorder() > _local2)) && ((this.getLeftBorder() < _local3)))){
this.m_posY = (_local4 - this.m_halfHeight);
_local6 = Direction.DOWN;
_arg1.destroySide(Side.TOP);
_arg1.push(this.getSpeedX(), (this.getSpeedY() * -1));
};
};
} else {
if (this.m_speedY > 0){
if ((((this.getTopBorder() < _local5)) && ((this.getBottomBorder() >= (_local5 - this.m_speedY))))){
if ((((this.getRightBorder() > _local2)) && ((this.getLeftBorder() < _local3)))){
this.m_posY = (_local5 + this.m_halfHeight);
_local6 = Direction.UP;
_arg1.destroySide(Side.BOTTOM);
_arg1.push(this.getSpeedX(), (this.getSpeedY() * -1));
};
};
};
};
if (this.m_speedX < 0){
if ((((this.getLeftBorder() < _local3)) && ((this.getRightBorder() >= (_local3 + this.m_speedX))))){
if ((((this.getTopBorder() < _local5)) && ((this.getBottomBorder() > _local4)))){
this.m_posX = (_local3 + this.m_halfWidth);
_local6 = Direction.LEFT;
_arg1.destroySide(Side.RIGHT);
_arg1.push(this.getSpeedX(), (this.getSpeedY() * -1));
};
};
} else {
if (this.m_speedX > 0){
if ((((this.getRightBorder() > _local2)) && ((this.getLeftBorder() <= (_local2 + this.m_speedX))))){
if ((((this.getTopBorder() < _local5)) && ((this.getBottomBorder() > _local4)))){
this.m_posX = (_local2 - this.m_halfWidth);
_local6 = Direction.RIGHT;
_arg1.destroySide(Side.LEFT);
_arg1.push(this.getSpeedX(), (this.getSpeedY() * -1));
};
};
};
};
this.updatePosition();
return (_local6);
}
public function getVerticalCollision(_arg1:BasicSprite):Boolean{
var _local7:Vector;
var _local8:Vector;
var _local9:Point;
if (_arg1.getWidth() == 0){
return (false);
};
var _local2:Number = _arg1.getLeftBorder();
var _local3:Number = _arg1.getRightBorder();
var _local4:Number = _arg1.getTopBorder();
var _local5:Number = _arg1.getBottomBorder();
var _local6:Boolean;
if (this.m_speedY < 0){
if ((((this.getBottomBorder() > _local4)) && ((this.getTopBorder() <= (_local4 - this.m_speedY))))){
if ((((this.getRightBorder() > _local2)) && ((this.getLeftBorder() < _local3)))){
_local7 = new Vector(this.m_posX, this.m_posY, (this.m_posX + this.m_speedX), (this.m_posY - this.m_speedY));
_local8 = new Vector(_local2, _local4, _local3, _local4);
_local9 = Vector.getLineIntersection(_local7, _local8);
if (((isNaN(_local9.x)) || (isNaN(_local9.y)))){
this.m_posY = (_local4 - this.m_halfHeight);
} else {
this.m_posX = _local9.x;
this.m_posY = (_local9.y - this.m_halfHeight);
};
_local6 = true;
};
};
} else {
if (this.m_speedY > 0){
if ((((this.getTopBorder() < _local5)) && ((this.getBottomBorder() >= (_local5 - this.m_speedY))))){
if ((((this.getRightBorder() > _local2)) && ((this.getLeftBorder() < _local3)))){
this.m_posY = (_local5 + this.m_halfHeight);
_local6 = true;
};
};
};
};
this.updatePosition();
return (_local6);
}
}
}//package de.pixelate.mrbounce.base
Section 6
//EditableSprite (de.pixelate.mrbounce.base.EditableSprite)
package de.pixelate.mrbounce.base {
import flash.events.*;
import de.pixelate.mrbounce.utilities.*;
import flash.geom.*;
import de.pixelate.mrbounce.enumerations.*;
import flash.ui.*;
public class EditableSprite extends MovableSprite {
protected var m_isEditable:Boolean;
protected var m_isDragable:Boolean;
protected var m_isDragging:Boolean;
protected var m_colorType:ColorType;
protected var m_isSelected:Boolean;
public function EditableSprite(){
this.m_isEditable = false;
this.m_isSelected = false;
this.m_isDragging = false;
}
protected function onMouseUp(_arg1:MouseEvent):void{
var _local2:Point;
this.m_isDragging = false;
if (this.m_isDragable){
this.stopDrag();
_local2 = GridSize.getNearestPointInGrid(this.x, this.y);
this.m_posX = _local2.x;
this.m_posY = _local2.y;
this.updatePosition();
};
}
private function onKeyDown(_arg1:KeyboardEvent):void{
if (this.m_isSelected){
if ((((_arg1.keyCode == Keyboard.BACKSPACE)) || ((_arg1.keyCode == Keyboard.DELETE)))){
this.destroy();
};
};
}
public function setEditable(_arg1:Boolean, _arg2:Boolean):void{
this.mouseEnabled = _arg1;
this.mouseChildren = _arg1;
this.buttonMode = _arg1;
this.m_isEditable = _arg1;
this.m_isDragable = _arg2;
if (_arg1){
this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_UP, onMouseUp, false, 0, true);
if (StageHelper.getStage() != null){
StageHelper.getStage().addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown, false, 0, true);
};
} else {
if (this.hasEventListener(MouseEvent.MOUSE_OVER)){
this.removeEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
};
if (this.hasEventListener(MouseEvent.MOUSE_OUT)){
this.removeEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
};
if (this.hasEventListener(MouseEvent.MOUSE_DOWN)){
this.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
};
if (this.hasEventListener(MouseEvent.MOUSE_UP)){
this.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
};
if (StageHelper.getStage() != null){
if (StageHelper.getStage().hasEventListener(KeyboardEvent.KEY_DOWN)){
StageHelper.getStage().removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
};
};
};
}
public function getColorType():ColorType{
return (this.m_colorType);
}
private function onMouseOut(_arg1:MouseEvent):void{
this.m_isSelected = false;
if (!this.m_isDragging){
this.alpha = 1;
};
}
private function onMouseDown(_arg1:MouseEvent):void{
this.m_isDragging = true;
if (this.m_isDragable){
this.startDrag();
};
}
private function onMouseOver(_arg1:MouseEvent):void{
this.m_isSelected = true;
this.alpha = 0.5;
}
}
}//package de.pixelate.mrbounce.base
Section 7
//GameContainer (de.pixelate.mrbounce.base.GameContainer)
package de.pixelate.mrbounce.base {
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.game.*;
import flash.geom.*;
import de.pixelate.mrbounce.enumerations.*;
import flash.display.*;
public class GameContainer extends Sprite {
private var m_blockers:Array;
private var m_bonus:BonusGroup;
private var m_uniqueElementId:int;
private var m_winds:Array;
private var m_bouncers:Array;
private var m_paths:Array;
public function GameContainer(){
this.m_winds = new Array();
this.m_bouncers = new Array();
this.m_blockers = new Array();
this.m_paths = new Array();
this.m_bonus = new BonusGroup();
this.addChild(this.m_bonus);
this.m_uniqueElementId = 0;
}
public function insertBlocker(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean, _arg5:Boolean):void{
this.m_uniqueElementId++;
var _local6:Blocker = new Blocker(this.m_uniqueElementId, _arg1, _arg2, _arg3, _arg4);
this.m_blockers.push(_local6);
var _local7:int = (this.m_blockers.length - 1);
this.addChild(this.m_blockers[_local7]);
this.m_blockers[_local7].init();
this.m_blockers[_local7].setParent(this);
this.m_blockers[_local7].setEditable(_arg5, true);
}
private function deletePaths():void{
var _local1:int = this.m_paths.length;
var _local2:int;
while (_local2 < _local1) {
this.removeChild(this.m_paths[_local2]);
_local2++;
};
var _local3:int;
while (_local3 < _local1) {
this.m_paths.pop();
_local3++;
};
}
public function getBouncers():Array{
return (this.m_bouncers);
}
public function removeBouncerById(_arg1:int):void{
var _local2:int = this.m_bouncers.length;
var _local3:int;
while (_local3 < _local2) {
if (this.m_bouncers[_local3].getId() == _arg1){
this.m_bouncers.splice(_local3, 1);
break;
};
_local3++;
};
}
public function removeBlockerById(_arg1:int):void{
var _local2:int = this.m_blockers.length;
var _local3:int;
while (_local3 < _local2) {
if (this.m_blockers[_local3].getId() == _arg1){
this.m_blockers.splice(_local3, 1);
break;
};
_local3++;
};
}
public function update():void{
this.m_bonus.init();
this.removeWinds();
this.updateWinds();
this.removeBlockers();
this.updateBlockers();
this.removeBouncers();
this.updateBouncers();
this.deletePaths();
this.createPaths();
}
private function removeWinds():void{
var _local1:int = this.m_winds.length;
var _local2:int;
while (_local2 < _local1) {
this.removeChild(this.m_winds[_local2]);
_local2++;
};
_local2 = 0;
while (_local2 < _local1) {
this.m_winds.pop();
_local2++;
};
}
private function createPaths():void{
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:PathData;
var _local1:Array = LevelDataHolder.me().getCurrentLevel().getPathList();
var _local2:int = _local1.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _local1[_local3];
_local5 = _local4.length;
insertPath();
_local6 = 0;
while (_local6 < _local5) {
_local7 = _local4[_local6];
this.m_paths[_local3].insertPathElement(_local7.p1, _local7.p2, _local7.pC, _local7.hasAccessPoint, false);
_local6++;
};
_local3++;
};
}
public function getBonusGroup():BonusGroup{
return (m_bonus);
}
public function insertPathElement(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Boolean, _arg5:Boolean):void{
var _local6:int = (this.m_paths.length - 1);
this.m_paths[_local6].insertPathElement(_arg1, _arg2, _arg3, _arg4, _arg5);
}
private function insertWind(_arg1:Number, _arg2:Number, _arg3:Direction, _arg4:Number):void{
var _local5:Wind = new Wind(0, _arg1, World.BORDER_RIGHT, _arg2, _arg3, _arg4);
this.m_winds.push(_local5);
var _local6:int = (this.m_winds.length - 1);
this.addChildAt(this.m_winds[_local6], 0);
}
private function updateWinds():void{
var _local4:WindData;
var _local1:Array = LevelDataHolder.me().getCurrentLevel().getWindList();
var _local2:int = _local1.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _local1[_local3];
insertWind(_local4.posY, _local4.height, _local4.direction, _local4.speed);
_local3++;
};
}
private function removeBlockers():void{
var _local1:int = this.m_blockers.length;
var _local2:int;
while (_local2 < _local1) {
this.removeChild(this.m_blockers[_local2]);
_local2++;
};
_local2 = 0;
while (_local2 < _local1) {
this.m_blockers.pop();
_local2++;
};
}
public function setEditable(_arg1:Boolean):void{
var _local2:int;
var _local3:int = this.m_blockers.length;
_local2 = 0;
while (_local2 < _local3) {
this.m_blockers[_local2].setEditable(_arg1, _arg1);
_local2++;
};
var _local4:int = this.m_bouncers.length;
_local2 = 0;
while (_local2 < _local4) {
this.m_bouncers[_local2].setEditable(_arg1, _arg1);
_local2++;
};
var _local5:int = this.m_paths.length;
_local2 = 0;
while (_local2 < _local5) {
this.m_paths[_local2].setEditable(_arg1);
_local2++;
};
this.m_bonus.setEditable(_arg1);
}
private function updateBlockers():void{
var _local4:BlockerData;
var _local1:Array = LevelDataHolder.me().getCurrentLevel().getBlockerList();
var _local2:int = _local1.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _local1[_local3];
insertBlocker(_local4.posX, _local4.posY, _local4.width, _local4.isMovable, false);
_local3++;
};
}
public function getLastPathElement():PathElement{
var _local1:int = (this.m_paths.length - 1);
var _local2:int = (this.m_paths[_local1].getPathElements().length - 1);
return (this.m_paths[_local1].getPathElements()[_local2]);
}
private function removeBouncers():void{
var _local1:int = this.m_bouncers.length;
var _local2:int;
while (_local2 < _local1) {
this.removeChild(this.m_bouncers[_local2]);
_local2++;
};
_local2 = 0;
while (_local2 < _local1) {
this.m_bouncers.pop();
_local2++;
};
}
public function getBlockers():Array{
return (this.m_blockers);
}
public function insertBouncer(_arg1:BouncerData, _arg2:Boolean):void{
this.m_uniqueElementId++;
var _local3:Bouncer = new Bouncer(this.m_uniqueElementId, _arg1.posX, _arg1.posY, _arg1.width, _arg1.height, _arg1.isMovable, _arg1.isDestroyable, _arg1.hasLeftSide, _arg1.hasUpSide, _arg1.hasRightSide, _arg1.hasDownSide);
this.m_bouncers.push(_local3);
var _local4:int = (this.m_bouncers.length - 1);
this.addChildAt(this.m_bouncers[_local4], 0);
this.m_bouncers[_local4].setParent(this);
this.m_bouncers[_local4].setEditable(_arg2, true);
}
public function getWinds():Array{
return (this.m_winds);
}
public function getPaths():Array{
return (this.m_paths);
}
private function updateBouncers():void{
var _local4:BouncerData;
var _local1:Array = LevelDataHolder.me().getCurrentLevel().getBouncerList();
var _local2:int = _local1.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _local1[_local3];
insertBouncer(_local4, false);
_local3++;
};
}
public function destroy():void{
this.m_bonus.destroy();
this.removeWinds();
this.removeBlockers();
this.removeBlockers();
this.deletePaths();
}
public function insertPath():void{
var _local1:Path = new Path();
this.m_paths.push(_local1);
var _local2:int = (this.m_paths.length - 1);
this.addChild(this.m_paths[_local2]);
}
}
}//package de.pixelate.mrbounce.base
Section 8
//MovableSprite (de.pixelate.mrbounce.base.MovableSprite)
package de.pixelate.mrbounce.base {
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.enumerations.*;
public class MovableSprite extends BasicSprite {
protected var m_speedX:Number;
protected var m_speedY:Number;
protected var m_direction:Direction;
public function setSpeedX(_arg1:Number):void{
this.m_speedX = _arg1;
}
public function getSpeedX():Number{
return (this.m_speedX);
}
protected function moveVertical():void{
if (this.m_direction == Direction.UP){
if (this.getTopBorder() > World.BORDER_TOP){
this.m_posY = (this.m_posY - this.m_speedY);
} else {
this.m_direction = Direction.DOWN;
};
} else {
if (this.m_direction == Direction.DOWN){
if (this.getBottomBorder() < World.BORDER_BOTTOM){
this.m_posY = (this.m_posY + this.m_speedY);
} else {
this.m_direction = Direction.UP;
};
};
};
}
public function getSpeedY():Number{
return (this.m_speedY);
}
public function setSpeedY(_arg1:Number):void{
this.m_speedY = _arg1;
}
protected function moveHorizontal():void{
if (this.m_direction == Direction.LEFT){
if (this.getLeftBorder() > World.BORDER_LEFT){
this.m_posX = (this.m_posX - this.m_speedX);
} else {
this.m_direction = Direction.RIGHT;
};
} else {
if (this.m_direction == Direction.RIGHT){
if (this.getRightBorder() < World.BORDER_RIGHT){
this.m_posX = (this.m_posX + this.m_speedX);
} else {
this.m_direction = Direction.LEFT;
};
};
};
this.updatePosition();
}
}
}//package de.pixelate.mrbounce.base
Section 9
//Editor (de.pixelate.mrbounce.editor.Editor)
package de.pixelate.mrbounce.editor {
import de.pixelate.mrbounce.base.*;
import flash.events.*;
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.utilities.*;
import flash.geom.*;
import de.pixelate.mrbounce.enumerations.*;
import flash.display.*;
import de.pixelate.mrbounce.text.*;
import flash.system.*;
public class Editor extends Sprite {
private var m_textInstructions:Instructions;
private var m_currentEditorToolType:EditorToolType;
private var m_currentColorType:ColorType;
private var m_grid:Grid;
private var m_currentBonusSize:BonusSize;
private var m_gameContainer:GameContainer;
private var m_bezierTool:EditorBezierTool;
private var m_hitArea:Sprite;
public function Editor(_arg1:GameContainer){
this.m_gameContainer = _arg1;
this.m_currentBonusSize = BonusSize.first;
this.m_currentEditorToolType = EditorToolType.first;
this.m_currentColorType = ColorType.first;
}
private function onKeyDown(_arg1:KeyboardEvent):void{
switch (_arg1.keyCode){
case KeyMapping.EDITOR_COPY_CLIPBOARD.getKeyCode():
this.m_textInstructions.displayShortInfo("Copied XML to clipboard");
System.setClipboard(convertLevelToXml());
break;
case KeyMapping.EDITOR_CREATE_FROM_BEZIER.getKeyCode():
createElementsFromBezierTool();
break;
case KeyMapping.EDITOR_BEZIER.getKeyCode():
this.m_bezierTool.toggleVisibility();
break;
case KeyMapping.EDITOR_TOOL.getKeyCode():
this.m_currentEditorToolType = EditorToolType.next;
this.m_textInstructions.displayShortInfo(this.m_currentEditorToolType.getName());
break;
case KeyMapping.EDITOR_BONUS_COLOR.getKeyCode():
this.m_currentColorType = ColorType.next;
this.m_textInstructions.displayShortInfo(this.m_currentColorType.getName());
break;
case KeyMapping.EDITOR_BONUS_SIZE.getKeyCode():
this.m_currentBonusSize = BonusSize.next;
this.m_textInstructions.displayShortInfo(this.m_currentBonusSize.getName());
break;
case KeyMapping.EDITOR_GRID_SIZE.getKeyCode():
GridSize.next;
this.m_grid.draw();
break;
};
}
private function convertLevelToXml():XML{
var _local3:int;
var _local4:XML;
var _local7:XML;
var _local10:XML;
var _local15:int;
var _local16:Point;
var _local17:Point;
var _local18:Point;
var _local19:XML;
var _local20:Array;
var _local21:int;
var _local22:XML;
XML.prettyIndent = 4;
var _local1:XML = <level speed="0.2"></level>
;
var _local2:XML = <items></items>
;
_local1.appendChild(_local2);
var _local5:Array = this.m_gameContainer.getBonusGroup().getList();
var _local6:int = _local5.length;
_local3 = 0;
while (_local3 < _local6) {
_local16 = _local5[_local3].getPosition();
_local4 = <item type="bonus"></item>
;
_local4.@x = _local16.x;
_local4.@y = _local16.y;
_local4.@size = _local5[_local3].getWidth();
_local4.@color = _local5[_local3].getColorType().getName();
_local2.appendChild(_local4);
_local3++;
};
var _local8:Array = this.m_gameContainer.getBlockers();
var _local9:int = _local8.length;
_local3 = 0;
while (_local3 < _local9) {
_local17 = _local8[_local3].getPosition();
_local7 = <item type="blocker"></item>
;
_local7.@x = _local17.x;
_local7.@y = _local17.y;
_local7.@width = _local8[_local3].getWidth();
_local2.appendChild(_local7);
_local3++;
};
var _local11:Array = this.m_gameContainer.getBouncers();
var _local12:int = _local11.length;
_local3 = 0;
while (_local3 < _local12) {
_local18 = _local11[_local3].getPosition();
_local10 = <item type="bouncer"></item>
;
_local10.@x = _local18.x;
_local10.@y = _local18.y;
_local10.@height = _local11[_local3].getHeight();
_local10.@width = _local11[_local3].getWidth();
_local10.@isDestroyable = "false";
_local10.@isMovable = "false";
_local10.@hasLeftSide = "true";
_local10.@hasUpSide = "true";
_local10.@hasRightSide = "true";
_local10.@hasDownSide = "true";
_local2.appendChild(_local10);
_local3++;
};
var _local13:Array = this.m_gameContainer.getPaths();
var _local14:int = _local13.length;
_local15 = 0;
while (_local15 < _local14) {
_local19 = <item type="path"></item>
;
_local20 = _local13[_local15].getPathElements();
_local21 = _local20.length;
_local3 = 0;
while (_local3 < _local21) {
_local22 = <pathelement></pathelement>
;
_local22.@x1 = _local20[_local3].getP1().x;
_local22.@y1 = _local20[_local3].getP1().y;
_local22.@x2 = _local20[_local3].getP2().x;
_local22.@y2 = _local20[_local3].getP2().y;
_local22.@xC = _local20[_local3].getPC().x;
_local22.@yC = _local20[_local3].getPC().y;
_local22.@hasAccessPoint = _local20[_local3].hasAccessPoint();
_local19.appendChild(_local22);
_local3++;
};
_local2.appendChild(_local19);
_local15++;
};
return (_local2);
}
private function onMouseDown(_arg1:MouseEvent):void{
var _local2:BouncerData;
switch (this.m_currentEditorToolType){
case EditorToolType.BONUS:
this.m_gameContainer.getBonusGroup().addElement(_arg1.stageX, _arg1.stageY, this.m_currentBonusSize.getSize(), this.m_currentColorType, true);
break;
case EditorToolType.BLOCKER:
this.m_gameContainer.insertBlocker(_arg1.stageX, _arg1.stageY, 10, false, true);
break;
case EditorToolType.BOUNCER:
_local2 = new BouncerData(_arg1.stageX, _arg1.stageY, 50, 50, false, true, true, true, true, true);
this.m_gameContainer.insertBouncer(_local2, true);
break;
case EditorToolType.PATH:
insertPath(_arg1);
break;
};
}
public function init():void{
this.draw();
this.m_grid = new Grid();
this.addChild(this.m_grid);
this.m_bezierTool = new EditorBezierTool();
this.addChild(this.m_bezierTool);
this.m_bezierTool.init();
this.m_textInstructions = new Instructions();
this.addChild(this.m_textInstructions);
}
private function draw():void{
this.m_hitArea = new Sprite();
this.addChild(this.m_hitArea);
this.m_hitArea.graphics.beginFill(0, 0);
this.m_hitArea.graphics.drawRect(World.BORDER_LEFT, World.BORDER_TOP, World.BORDER_RIGHT, World.BORDER_BOTTOM);
}
private function createElementsFromBezierTool():void{
var _local1:Number;
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:Array;
var _local8:int;
var _local9:Number;
var _local10:Number;
if (this.m_bezierTool.visible){
_local1 = this.m_bezierTool.getAnchor1Point().x;
_local2 = this.m_bezierTool.getAnchor1Point().y;
_local3 = this.m_bezierTool.getAnchor2Point().x;
_local4 = this.m_bezierTool.getAnchor2Point().y;
_local5 = this.m_bezierTool.getControlPoint().x;
_local6 = this.m_bezierTool.getControlPoint().y;
_local7 = LevelUtil.getBezier(_local1, _local2, _local3, _local4, _local5, _local6, 8);
_local8 = 0;
while (_local8 < _local7.length) {
_local9 = _local7[_local8].x;
_local10 = _local7[_local8].y;
this.m_gameContainer.getBonusGroup().addElement(_local9, _local10, this.m_currentBonusSize.getSize(), this.m_currentColorType, true);
_local8++;
};
};
}
public function deactivate():void{
this.visible = false;
this.m_grid.visible = false;
this.m_hitArea.buttonMode = false;
if (this.hasEventListener(MouseEvent.MOUSE_UP)){
this.m_hitArea.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
};
if (StageHelper.getStage() != null){
if (StageHelper.getStage().hasEventListener(KeyboardEvent.KEY_DOWN)){
StageHelper.getStage().addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown, false, 0, true);
};
};
}
public function activate():void{
this.visible = true;
this.m_grid.visible = true;
this.m_hitArea.buttonMode = true;
this.m_hitArea.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);
if (StageHelper.getStage() != null){
StageHelper.getStage().addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown, false, 0, true);
};
}
private function insertPath(_arg1:MouseEvent):void{
var _local2:Point;
var _local3:Point;
var _local4:Point;
if (((_arg1.shiftKey) || ((this.m_gameContainer.getPaths().length == 0)))){
_local2 = new Point(_arg1.stageX, _arg1.stageY);
_local3 = new Point((_local2.x + 50), _local2.y);
_local4 = Point.interpolate(_local2, _local3, 0.5);
this.m_gameContainer.insertPath();
this.m_gameContainer.insertPathElement(_local2, _local3, _local4, true, true);
} else {
_local2 = this.m_gameContainer.getLastPathElement().getP2();
_local3 = new Point(_arg1.stageX, _arg1.stageY);
_local4 = Point.interpolate(_local2, _local3, 0.5);
this.m_gameContainer.insertPathElement(_local2, _local3, _local4, false, true);
};
}
}
}//package de.pixelate.mrbounce.editor
Section 10
//EditorBezierTool (de.pixelate.mrbounce.editor.EditorBezierTool)
package de.pixelate.mrbounce.editor {
import flash.events.*;
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.utilities.*;
import flash.geom.*;
import flash.display.*;
public class EditorBezierTool extends Sprite {
private var m_control:EditorBezierToolDrag;
private var m_anchor1:EditorBezierToolDrag;
private var m_anchor2:EditorBezierToolDrag;
private var m_isSelected:Boolean;
public function EditorBezierTool(){
this.m_isSelected = false;
}
private function onKeyDown(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 78){
if (this.m_isSelected){
this.normalize();
};
};
}
private function draw():void{
this.graphics.clear();
this.graphics.lineStyle(1, 0xFFFFFF);
this.graphics.moveTo(this.m_anchor1.x, this.m_anchor1.y);
this.graphics.curveTo(this.m_control.x, this.m_control.y, this.m_anchor2.x, this.m_anchor2.y);
}
public function toggleVisibility():void{
this.visible = !(this.visible);
}
private function onMouseOut(_arg1:MouseEvent):void{
this.m_isSelected = false;
this.alpha = 1;
}
public function getControlPoint():Point{
var _local1:Point = new Point(m_control.x, m_control.y);
return (_local1);
}
public function getAnchor1Point():Point{
var _local1:Point = new Point(m_anchor1.x, m_anchor1.y);
return (_local1);
}
private function normalize():void{
var _local1:Number = Math.abs((this.m_anchor2.x - this.m_anchor1.x));
if (this.m_anchor1.x < this.m_anchor2.x){
this.m_control.x = (this.m_anchor1.x + (_local1 / 2));
} else {
this.m_control.x = (this.m_anchor2.x + (_local1 / 2));
};
draw();
}
private function createHandles():void{
this.m_anchor1 = new EditorBezierToolDrag((World.BORDER_LEFT + 50), (World.BORDER_BOTTOM / 2));
this.m_anchor2 = new EditorBezierToolDrag((World.BORDER_RIGHT - 50), (World.BORDER_BOTTOM / 2));
this.m_control = new EditorBezierToolDrag(0, 100);
this.addChild(this.m_anchor1);
this.addChild(this.m_anchor2);
this.addChild(this.m_control);
this.m_anchor1.init();
this.m_anchor2.init();
this.m_control.init();
this.normalize();
}
public function init():void{
this.buttonMode = true;
this.visible = false;
createHandles();
draw();
this.addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut, false, 0, true);
StageHelper.getStage().addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown, false, 0, true);
}
public function getAnchor2Point():Point{
var _local1:Point = new Point(m_anchor2.x, m_anchor2.y);
return (_local1);
}
private function onMouseOver(_arg1:MouseEvent):void{
this.m_isSelected = true;
this.alpha = 0.5;
}
private function onEnterFrame(_arg1:Event):void{
this.draw();
}
}
}//package de.pixelate.mrbounce.editor
Section 11
//EditorBezierToolDrag (de.pixelate.mrbounce.editor.EditorBezierToolDrag)
package de.pixelate.mrbounce.editor {
import de.pixelate.mrbounce.base.*;
import flash.events.*;
import flash.geom.*;
import de.pixelate.mrbounce.enumerations.*;
public class EditorBezierToolDrag extends EditableSprite {
public function EditorBezierToolDrag(_arg1:Number, _arg2:Number){
this.x = _arg1;
this.y = _arg2;
setSize(8, 8);
}
public function init():void{
this.m_isDragable = true;
this.buttonMode = true;
this.draw();
this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_UP, onMouseUp, false, 0, true);
}
override protected function onMouseUp(_arg1:MouseEvent):void{
this.m_isDragging = false;
this.stopDrag();
var _local2:Point = GridSize.getNearestPointInGrid(this.x, this.y);
this.m_posX = _local2.x;
this.m_posY = _local2.y;
this.updatePosition();
}
private function draw():void{
this.graphics.clear();
this.graphics.beginFill(0xFFFFFF, 100);
this.graphics.drawRect(-(this.m_halfWidth), -(this.m_halfHeight), m_width, m_height);
}
private function onMouseDown(_arg1:MouseEvent):void{
this.m_isDragging = true;
this.startDrag();
}
private function onMouseOver(_arg1:MouseEvent):void{
this.m_isSelected = true;
this.alpha = 0.5;
}
private function onMouseOut(_arg1:MouseEvent):void{
this.m_isSelected = false;
this.alpha = 1;
}
}
}//package de.pixelate.mrbounce.editor
Section 12
//Grid (de.pixelate.mrbounce.editor.Grid)
package de.pixelate.mrbounce.editor {
import de.pixelate.mrbounce.level.*;
import flash.geom.*;
import de.pixelate.mrbounce.enumerations.*;
import flash.display.*;
public class Grid extends Sprite {
public function Grid(){
this.visible = false;
draw();
}
public function draw():void{
var _local5:int;
var _local6:Rectangle;
this.graphics.clear();
var _local1:int = GridSize.current.getSize();
var _local2:int = Math.round((World.BORDER_RIGHT / _local1));
var _local3:int = Math.round((World.BORDER_BOTTOM / _local1));
var _local4:int;
while (_local4 < _local2) {
_local5 = 0;
while (_local5 < _local3) {
_local6 = new Rectangle((_local4 * _local1), (_local5 * _local1), 1, 1);
this.graphics.beginFill(0x727272);
this.graphics.drawRect(_local6.x, _local6.y, _local6.width, _local6.height);
this.graphics.endFill();
_local5++;
};
_local4++;
};
}
}
}//package de.pixelate.mrbounce.editor
Section 13
//BonusSize (de.pixelate.mrbounce.enumerations.BonusSize)
package de.pixelate.mrbounce.enumerations {
public final class BonusSize {
private var m_size:uint;
private var m_name:String;
public static const XLARGE:BonusSize = new BonusSize("XLARGE", 32);
;
public static const SMALL:BonusSize = new BonusSize("SMALL", 8);
;
public static const MEDIUM:BonusSize = new BonusSize("MEDIUM", 16);
;
public static const LARGE:BonusSize = new BonusSize("LARGE", 24);
;
private static var m_currentInList:int = 0;
public static var list:Array = new Array();
public function BonusSize(_arg1:String, _arg2:uint){
this.m_name = _arg1;
this.m_size = _arg2;
list.push(this);
}
public function getName():String{
return (this.m_name);
}
public function getSize():uint{
return (this.m_size);
}
public static function fromName(_arg1:String):BonusSize{
var _local2:int = list.length;
var _local3:int;
while (_local3 < _local2) {
if (list[_local3].m_name == _arg1){
return (list[_local3]);
};
_local3++;
};
return (_slot1.MEDIUM);
}
public static function get first():BonusSize{
return (list[0]);
}
public static function get next():BonusSize{
m_currentInList++;
if (m_currentInList >= list.length){
m_currentInList = 0;
};
return (list[m_currentInList]);
}
}
}//package de.pixelate.mrbounce.enumerations
Section 14
//ColorType (de.pixelate.mrbounce.enumerations.ColorType)
package de.pixelate.mrbounce.enumerations {
public final class ColorType {
private var m_color:uint;
private var m_name:String;
public static const GREEN:ColorType = new ColorType("GREEN", 0xFF00);
;
public static const RED:ColorType = new ColorType("RED", 0xFF0000);
;
public static const BLUE:ColorType = new ColorType("BLUE", 0xFF);
;
private static var m_currentInList:int = 0;
public static var list:Array = new Array();
public function ColorType(_arg1:String, _arg2:uint){
this.m_name = _arg1;
this.m_color = _arg2;
list.push(this);
}
public function getName():String{
return (this.m_name);
}
public function getColor():uint{
return (this.m_color);
}
public static function get first():ColorType{
return (list[0]);
}
public static function get next():ColorType{
m_currentInList++;
if (m_currentInList >= list.length){
m_currentInList = 0;
};
return (list[m_currentInList]);
}
public static function fromName(_arg1:String):ColorType{
var _local2:int = list.length;
var _local3:int;
while (_local3 < _local2) {
if (list[_local3].m_name == _arg1){
return (list[_local3]);
};
_local3++;
};
return (_slot1.RED);
}
}
}//package de.pixelate.mrbounce.enumerations
Section 15
//Direction (de.pixelate.mrbounce.enumerations.Direction)
package de.pixelate.mrbounce.enumerations {
public final class Direction {
private var m_name:String;
public static const RIGHT:Direction = new Direction("RIGHT");
;
public static const LEFT:Direction = new Direction("LEFT");
;
public static const DOWN:Direction = new Direction("DOWN");
;
public static const UP:Direction = new Direction("UP");
;
private static var list:Array = new Array();
public function Direction(_arg1:String){
this.m_name = _arg1;
list.push(this);
}
public function getName():String{
return (this.m_name);
}
public static function fromName(_arg1:String):Direction{
var _local2:int = list.length;
var _local3:int;
while (_local3 < _local2) {
if (list[_local3].m_name == _arg1){
return (list[_local3]);
};
_local3++;
};
return (null);
}
}
}//package de.pixelate.mrbounce.enumerations
Section 16
//EditorToolType (de.pixelate.mrbounce.enumerations.EditorToolType)
package de.pixelate.mrbounce.enumerations {
public final class EditorToolType {
private var m_name:String;
public static const PATH:EditorToolType = new EditorToolType("PATH");
;
public static const BOUNCER:EditorToolType = new EditorToolType("BOUNCER");
;
public static const BLOCKER:EditorToolType = new EditorToolType("BLOCKER");
;
public static const BONUS:EditorToolType = new EditorToolType("BONUS");
;
private static var m_currentInList:int = 0;
public static var list:Array = new Array();
public function EditorToolType(_arg1:String){
this.m_name = _arg1;
list.push(this);
}
public function getName():String{
return (this.m_name);
}
public static function get first():EditorToolType{
return (list[0]);
}
public static function get next():EditorToolType{
m_currentInList++;
if (m_currentInList >= list.length){
m_currentInList = 0;
};
return (list[m_currentInList]);
}
public static function fromName(_arg1:String):EditorToolType{
var _local2:int = list.length;
var _local3:int;
while (_local3 < _local2) {
if (list[_local3].m_name == _arg1){
return (list[_local3]);
};
_local3++;
};
return (null);
}
}
}//package de.pixelate.mrbounce.enumerations
Section 17
//GameOverType (de.pixelate.mrbounce.enumerations.GameOverType)
package de.pixelate.mrbounce.enumerations {
public final class GameOverType {
private var m_name:String;
public static const TIME_UP:GameOverType = new GameOverType("TIME_UP");
;
public static const COMPLETED_STAGE:GameOverType = new GameOverType("COMPLETED_STAGE");
;
public static const NO_LIVES_LEFT:GameOverType = new GameOverType("NO_LIVES_LEFT");
;
private static var list:Array = new Array();
public function GameOverType(_arg1:String){
this.m_name = _arg1;
list.push(this);
}
public function getName():String{
return (this.m_name);
}
public static function fromName(_arg1:String):GameOverType{
var _local2:int = list.length;
var _local3:int;
while (_local3 < _local2) {
if (list[_local3].m_name == _arg1){
return (list[_local3]);
};
_local3++;
};
return (null);
}
}
}//package de.pixelate.mrbounce.enumerations
Section 18
//GridSize (de.pixelate.mrbounce.enumerations.GridSize)
package de.pixelate.mrbounce.enumerations {
import flash.geom.*;
public final class GridSize {
private var m_size:uint;
private var m_name:String;
public static const XLARGE:GridSize = new GridSize("XLARGE", 32);
;
public static const SMALL:GridSize = new GridSize("SMALL", 8);
;
public static const XSMALL:GridSize = new GridSize("XSMALL", 4);
;
public static const MEDIUM:GridSize = new GridSize("MEDIUM", 16);
;
public static const LARGE:GridSize = new GridSize("LARGE", 24);
;
private static var m_currentInList:int = 0;
public static var list:Array = new Array();
public function GridSize(_arg1:String, _arg2:uint){
this.m_name = _arg1;
this.m_size = _arg2;
list.push(this);
}
public function getName():String{
return (this.m_name);
}
public function getSize():uint{
return (this.m_size);
}
public static function fromName(_arg1:String):GridSize{
var _local2:int = list.length;
var _local3:int;
while (_local3 < _local2) {
if (list[_local3].m_name == _arg1){
return (list[_local3]);
};
_local3++;
};
return (GridSize.SMALL);
}
public static function get first():GridSize{
return (list[0]);
}
public static function getNearestPointInGrid(_arg1:Number, _arg2:Number):Point{
var _local3:Point = new Point();
var _local4:uint = GridSize.current.getSize();
_local3.x = (Math.round((_arg1 / _local4)) * _local4);
_local3.y = (Math.round((_arg2 / _local4)) * _local4);
return (_local3);
}
public static function get current():GridSize{
return (list[m_currentInList]);
}
public static function get next():GridSize{
m_currentInList++;
if (m_currentInList >= list.length){
m_currentInList = 0;
};
return (list[m_currentInList]);
}
}
}//package de.pixelate.mrbounce.enumerations
Section 19
//KeyMapping (de.pixelate.mrbounce.enumerations.KeyMapping)
package de.pixelate.mrbounce.enumerations {
import flash.ui.*;
public final class KeyMapping {
private var m_label:String;
private var m_keyCode:uint;
public static const EDITOR_CREATE_FROM_BEZIER:KeyMapping = new KeyMapping("Create from Bezier", Keyboard.ENTER);
;
public static const EDITOR_COPY_CLIPBOARD:KeyMapping = new KeyMapping("Copy xml to clipboard", Keyboard.SPACE);
;
public static const EDITOR_GRID_SIZE:KeyMapping = new KeyMapping("Grid Size", 71);
;
public static const EDITOR_TOOL:KeyMapping = new KeyMapping("Tool", 69);
;
public static const EDITOR_BONUS_COLOR:KeyMapping = new KeyMapping("Bonus Color", 67);
;
public static const EDITOR_BONUS_SIZE:KeyMapping = new KeyMapping("Bonus Size", 83);
;
public static const EDITOR_BEZIER:KeyMapping = new KeyMapping("Bezier", 66);
;
public static var list:Array = new Array();
public function KeyMapping(_arg1:String, _arg2:uint){
this.m_label = _arg1;
this.m_keyCode = _arg2;
list.push(this);
}
public function getKeyCode():uint{
return (this.m_keyCode);
}
public function getLabel():String{
return (this.m_label);
}
}
}//package de.pixelate.mrbounce.enumerations
Section 20
//Side (de.pixelate.mrbounce.enumerations.Side)
package de.pixelate.mrbounce.enumerations {
public final class Side {
private var m_name:String;
public static const RIGHT:Side = new Side("RIGHT");
;
public static const TOP:Side = new Side("TOP");
;
public static const LEFT:Side = new Side("LEFT");
;
public static const BOTTOM:Side = new Side("BOTTOM");
;
private static var list:Array = new Array();
public function Side(_arg1:String){
this.m_name = _arg1;
list.push(this);
}
public function getName():String{
return (this.m_name);
}
public static function fromName(_arg1:String):Side{
var _local2:int = list.length;
var _local3:int;
while (_local3 < _local2) {
if (list[_local3].m_name == _arg1){
return (list[_local3]);
};
_local3++;
};
return (null);
}
}
}//package de.pixelate.mrbounce.enumerations
Section 21
//TutorialState (de.pixelate.mrbounce.enumerations.TutorialState)
package de.pixelate.mrbounce.enumerations {
public final class TutorialState {
private var m_name:String;
public static const DONE:TutorialState = new TutorialState("DONE");
;
public static const USED_SLOWMO:TutorialState = new TutorialState("USED_SLOWMO");
;
public static const MOVED_VERTICAL:TutorialState = new TutorialState("MOVED_VERTICAL");
;
public static const MOVED_HORIZONTAL:TutorialState = new TutorialState("MOVED_HORIZONTAL");
;
private static var m_currentInList:int = 0;
public static var list:Array = new Array();
public function TutorialState(_arg1:String){
this.m_name = _arg1;
list.push(this);
}
public function getName():String{
return (this.m_name);
}
public static function get next():TutorialState{
m_currentInList++;
if (m_currentInList >= list.length){
m_currentInList = 0;
};
return (list[m_currentInList]);
}
public static function fromName(_arg1:String):TutorialState{
var _local2:int = list.length;
var _local3:int;
while (_local3 < _local2) {
if (list[_local3].m_name == _arg1){
return (list[_local3]);
};
_local3++;
};
return (null);
}
public static function get first():TutorialState{
return (list[0]);
}
}
}//package de.pixelate.mrbounce.enumerations
Section 22
//ExtraLifeEvent (de.pixelate.mrbounce.events.ExtraLifeEvent)
package de.pixelate.mrbounce.events {
import flash.events.*;
public class ExtraLifeEvent extends Event {
public var lives:int;
public var message:String;
public static const EXTRALIFE:String = "extralife";
public function ExtraLifeEvent(_arg1:int, _arg2:String="extralife"){
super(_arg2);
this.message = _arg2;
this.lives = _arg1;
}
}
}//package de.pixelate.mrbounce.events
Section 23
//LevelEvent (de.pixelate.mrbounce.events.LevelEvent)
package de.pixelate.mrbounce.events {
import flash.events.*;
public class LevelEvent extends Event {
public var message:String;
public static const CHANGE:String = "change";
public static const CLEARED:String = "cleared";
public function LevelEvent(_arg1:String){
super(_arg1);
this.message = _arg1;
}
}
}//package de.pixelate.mrbounce.events
Section 24
//ScoreEvent (de.pixelate.mrbounce.events.ScoreEvent)
package de.pixelate.mrbounce.events {
import flash.events.*;
public class ScoreEvent extends Event {
public var score:Number;
public var message:String;
public static const CHANGE:String = "change";
public function ScoreEvent(_arg1:Number, _arg2:String="change"){
super(_arg2);
this.message = _arg2;
this.score = _arg1;
}
}
}//package de.pixelate.mrbounce.events
Section 25
//TitleMenuSelectEvent (de.pixelate.mrbounce.events.TitleMenuSelectEvent)
package de.pixelate.mrbounce.events {
import flash.events.*;
public class TitleMenuSelectEvent extends Event {
public var message:String;
public static const START_WORLD_1:String = "startWorld1";
public static const START_WORLD_2:String = "startWorld2";
public static const START_WORLD_3:String = "startWorld3";
public static const START_WORLD_4:String = "startWorld4";
public static const START_WORLD_5:String = "startWorld5";
public static const HELP_SCREEN:String = "helpScreen";
public static const BACK_TO_MENU:String = "backToMenu";
public static const START_TUTORIAL:String = "startTutorial";
public static const GOTO_WEBSITE:String = "gotoWebsite";
public function TitleMenuSelectEvent(_arg1:String){
super(_arg1);
this.message = _arg1;
}
}
}//package de.pixelate.mrbounce.events
Section 26
//ToggleSoundEvent (de.pixelate.mrbounce.events.ToggleSoundEvent)
package de.pixelate.mrbounce.events {
import flash.events.*;
public class ToggleSoundEvent extends Event {
public var isMute:Boolean;
public var message:String;
public static const TOGGLE:String = "toggle";
public function ToggleSoundEvent(_arg1:Boolean, _arg2:String="TOGGLE"){
super(TOGGLE);
this.message = _arg2;
this.isMute = _arg1;
}
}
}//package de.pixelate.mrbounce.events
Section 27
//TutorialEvent (de.pixelate.mrbounce.events.TutorialEvent)
package de.pixelate.mrbounce.events {
import flash.events.*;
public class TutorialEvent extends Event {
public var percentage:Number;
public var message:String;
public static const UPDATE_PERCENTAGE:String = "update_percentage";
public function TutorialEvent(_arg1:Number, _arg2:String="update_percentage"){
super(_arg2);
this.message = _arg2;
this.percentage = _arg1;
}
}
}//package de.pixelate.mrbounce.events
Section 28
//WatchEvent (de.pixelate.mrbounce.events.WatchEvent)
package de.pixelate.mrbounce.events {
import flash.events.*;
public class WatchEvent extends Event {
public var message:String;
public static const TIMEUP:String = "timeup";
public static const SHRINK:String = "shrink";
public static const HURRY:String = "hurry";
public function WatchEvent(_arg1:String="timeup"){
super(_arg1);
this.message = _arg1;
}
}
}//package de.pixelate.mrbounce.events
Section 29
//Ball (de.pixelate.mrbounce.game.Ball)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.base.*;
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.utilities.*;
import flash.geom.*;
import de.pixelate.mrbounce.tutorial.*;
import flash.ui.*;
import de.pixelate.mrbounce.geometry.*;
public class Ball extends CollisionSprite {
private const FLOP_SPEED:Number = 15;
private const OFFSPRING_FACTOR:Number = 7;
private const BOUNCE_SPEED:Number = 28;
private var m_slowMotionEnergy:Number;
private var m_slowMotionFactor:Number;
private var m_currentStepInPath:int;
private var m_internalSpeedY:Number;
private var m_internalSpeedX:Number;
private var m_levelSpeed:Number;
private var m_isFollowingPath:Boolean;
private var m_path:Array;
public function Ball(){
setSize(8, 8);
this.m_color = 0xFFFFFF;
this.m_isFollowingPath = false;
this.m_currentStepInPath = 0;
this.m_slowMotionFactor = 1;
this.m_levelSpeed = 0.2;
setStartPosition();
}
public function invertY():void{
this.m_internalSpeedY = (this.m_internalSpeedY * -1);
if (this.m_internalSpeedY < 0){
this.m_internalSpeedY = 0;
};
}
public function doEveryFrame():void{
if (this.m_isFollowingPath){
moveAlongPath();
} else {
move();
checkSide();
};
}
public function getProjection(_arg1:Number, _arg2:Paddle):Array{
var _local10:*;
var _local11:Vector;
var _local12:Vector;
var _local13:Point;
var _local14:*;
var _local15:*;
var _local3:Array = new Array();
var _local4:Number = this.m_posX;
var _local5:Number = this.m_posY;
var _local6:Number = this.m_internalSpeedX;
var _local7:Number = this.m_internalSpeedY;
var _local8:Number = _arg2.x;
var _local9:Number = _arg2.getTopBorder();
if (_local8 == this.x){
_arg2.setHighlight(true);
return (_local3);
};
do {
_local10 = new Point(_local4, _local5);
_local3.push(_local10);
_local7 = (_local7 - this.m_levelSpeed);
_local4 = (_local4 + _local6);
_local5 = (_local5 - _local7);
} while (((((((_local5 + this.m_halfHeight) < _local9)) && ((_local4 < World.BORDER_RIGHT)))) && ((_local4 > World.BORDER_LEFT))));
if ((((((_local5 < World.BORDER_BOTTOM)) && ((_local4 < _arg2.getRightBorder())))) && ((_local4 > _arg2.getLeftBorder())))){
_arg2.setHighlight(true);
_local11 = new Vector(_local4, _local5, (_local4 + _local6), (_local5 - _local7));
_local12 = new Vector(_arg2.getLeftBorder(), _arg2.getTopBorder(), _arg2.getRightBorder(), _arg2.getTopBorder());
_local13 = Vector.getLineIntersection(_local11, _local12);
if (((isNaN(_local13.x)) || (isNaN(_local13.y)))){
_local5 = (_arg2.getTopBorder() - this.m_halfHeight);
} else {
_local4 = _local13.x;
_local5 = (_local13.y - this.m_halfHeight);
};
_local6 = ((_local4 - _local8) / OFFSPRING_FACTOR);
_local7 = calculateBounceSpeed(_local5, _arg1);
do {
_local14 = new Point(_local4, _local5);
_local3.push(_local14);
_local7 = (_local7 - this.m_levelSpeed);
_local4 = (_local4 + _local6);
_local5 = (_local5 - _local7);
} while ((((((_local5 < World.BORDER_BOTTOM)) && ((_local4 < World.BORDER_RIGHT)))) && ((_local4 > World.BORDER_LEFT))));
} else {
_arg2.setHighlight(false);
do {
_local15 = new Point(_local4, _local5);
_local3.push(_local15);
_local7 = (_local7 - this.m_levelSpeed);
_local4 = (_local4 + _local6);
_local5 = (_local5 - _local7);
} while ((((((_local5 < World.BORDER_BOTTOM)) && ((_local4 < World.BORDER_RIGHT)))) && ((_local4 > World.BORDER_LEFT))));
};
return (_local3);
}
private function checkSide():void{
this.m_internalSpeedX = checkBorder(this.x, this.m_internalSpeedX);
}
public function ground(_arg1:Number):void{
this.y = (_arg1 - this.m_halfHeight);
}
public function bounce():void{
this.m_internalSpeedY = BOUNCE_SPEED;
}
public function invertX():void{
this.m_internalSpeedX = (this.m_internalSpeedX * -1);
}
private function move():void{
checkSlowMotion();
this.m_internalSpeedY = (this.m_internalSpeedY - (this.m_levelSpeed * this.m_slowMotionFactor));
this.m_speedX = (this.m_internalSpeedX * this.m_slowMotionFactor);
this.m_speedY = (this.m_internalSpeedY * this.m_slowMotionFactor);
this.m_posX = (this.m_posX + this.m_speedX);
this.m_posY = (this.m_posY - this.m_speedY);
this.updatePosition();
}
public function isFollowingPath():Boolean{
return (this.m_isFollowingPath);
}
private function draw():void{
this.graphics.clear();
this.graphics.beginFill(this.m_color, 1);
this.graphics.drawRect(-(this.m_halfWidth), -(this.m_halfHeight), m_width, m_height);
this.graphics.endFill();
}
private function checkBorder(_arg1:Number, _arg2:Number):Number{
if ((_arg1 + this.m_halfWidth) > World.BORDER_RIGHT){
_arg2++;
_arg2 = (_arg2 * -1);
} else {
if ((_arg1 - this.m_halfWidth) < World.BORDER_LEFT){
_arg2--;
_arg2 = (_arg2 * -1);
};
};
return (_arg2);
}
public function applyBounceSpeed(_arg1:Number):void{
this.m_internalSpeedY = calculateBounceSpeed(this.y, _arg1);
}
private function moveAlongPath():void{
var _local1:Point = this.m_path[this.m_currentStepInPath];
this.m_posX = _local1.x;
this.m_posY = _local1.y;
this.updatePosition();
this.m_currentStepInPath++;
if (this.m_currentStepInPath >= this.m_path.length){
this.m_isFollowingPath = false;
};
}
private function calculateBounceSpeed(_arg1:Number, _arg2:Number):Number{
var _local3:Number = (_arg1 - _arg2);
var _local4:Number = this.m_levelSpeed;
return (Math.sqrt(((2 * _local3) * _local4)));
}
public function stopFollowPath():void{
this.m_isFollowingPath = false;
this.m_path = null;
}
public function setLevelSpeed(_arg1:Number):void{
this.m_levelSpeed = _arg1;
}
public function setStartPosition():void{
this.m_posX = (World.BORDER_RIGHT / 2);
this.m_posY = World.SAFE_BOTTOM;
this.m_internalSpeedX = 0;
this.m_internalSpeedY = 0;
this.m_slowMotionEnergy = 100;
draw();
}
public function comparePositionX(_arg1:Number):void{
this.m_internalSpeedX = ((this.x - _arg1) / OFFSPRING_FACTOR);
}
public function blow(_arg1:Number):void{
this.m_internalSpeedX = (this.m_internalSpeedX + (0.025 * _arg1));
}
override public function setSpeedX(_arg1:Number):void{
this.m_internalSpeedX = _arg1;
}
public function flop():void{
this.m_internalSpeedY = FLOP_SPEED;
}
public function startFollowPath(_arg1:Array):void{
this.m_isFollowingPath = true;
this.m_path = _arg1;
this.m_currentStepInPath = 0;
}
override public function setSpeedY(_arg1:Number):void{
this.m_internalSpeedY = _arg1;
}
public function getSlowMotionEnergy():Number{
return (this.m_slowMotionEnergy);
}
public function isLost():Boolean{
if (this.y > World.BORDER_BOTTOM){
return (true);
};
return (false);
}
private function checkSlowMotion():void{
if (Key.isDown(Keyboard.SPACE)){
m_slowMotionEnergy = (m_slowMotionEnergy - 0.9);
if (((Tutorial.me().isInTutorialMode) || ((m_slowMotionEnergy > 0)))){
m_slowMotionFactor = World.SLOW_MOTION_FACTOR;
Tutorial.me().increaseFramesSlowmo();
} else {
m_slowMotionEnergy = 0;
m_slowMotionFactor = LevelDataHolder.me().getSlowmo();
};
} else {
m_slowMotionEnergy = (m_slowMotionEnergy + 0.4);
if (m_slowMotionEnergy > 100){
m_slowMotionEnergy = 100;
};
m_slowMotionFactor = LevelDataHolder.me().getSlowmo();
};
}
}
}//package de.pixelate.mrbounce.game
Section 30
//Blocker (de.pixelate.mrbounce.game.Blocker)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.base.*;
import flash.events.*;
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.enumerations.*;
public class Blocker extends EditableSprite {
private var m_isMovable:Boolean;
private var m_parent:GameContainer;
public function Blocker(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean){
setSize(_arg4, 1);
this.m_id = _arg1;
this.m_isMovable = _arg5;
this.m_color = 0xFFFF;
this.m_direction = Direction.RIGHT;
this.m_posX = _arg2;
this.m_posY = _arg3;
updatePosition();
this.m_speedX = (5 * World.FRAMERATE_FACTOR);
draw();
}
public function init():void{
if (this.m_isMovable){
addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
};
}
private function draw():void{
this.graphics.clear();
this.graphics.beginFill(this.m_color, 1);
this.graphics.drawRect(-(this.m_halfWidth), -(this.m_halfHeight), this.m_width, this.m_height);
this.graphics.endFill();
var _local1:Number = (this.m_height + 8);
var _local2:Number = (_local1 / 2);
this.graphics.beginFill(0, 0);
this.graphics.drawRect(-(this.m_halfWidth), -(_local2), this.m_width, _local1);
this.graphics.endFill();
setGlow();
}
private function onEnterFrame(_arg1:Event):void{
if (!GameState.isGamePaused){
moveHorizontal();
};
}
override public function destroy():void{
super.destroy();
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
this.m_parent.removeBlockerById(this.m_id);
}
public function setParent(_arg1:GameContainer):void{
this.m_parent = _arg1;
}
}
}//package de.pixelate.mrbounce.game
Section 31
//Bonus (de.pixelate.mrbounce.game.Bonus)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.base.*;
import de.pixelate.mrbounce.enumerations.*;
public class Bonus extends EditableSprite {
private var m_parent:BonusGroup;
public function Bonus(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:ColorType){
this.x = _arg2;
this.y = _arg3;
this.m_posX = _arg2;
this.m_posY = _arg3;
setSize(_arg4, _arg4);
this.m_id = _arg1;
this.m_colorType = _arg5;
this.m_color = this.m_colorType.getColor();
draw();
}
private function draw():void{
this.graphics.clear();
this.graphics.lineStyle(2, this.m_color, 0.8);
this.graphics.beginFill(this.m_color, 0);
this.graphics.drawCircle(0, 0, this.m_height);
setGlow();
}
override public function destroy():void{
super.destroy();
this.m_parent.removeElementById(this.m_id);
}
public function setParent(_arg1:BonusGroup):void{
this.m_parent = _arg1;
}
}
}//package de.pixelate.mrbounce.game
Section 32
//BonusGroup (de.pixelate.mrbounce.game.BonusGroup)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.sound.*;
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.utilities.*;
import de.pixelate.mrbounce.enumerations.*;
import flash.display.*;
import de.pixelate.mrbounce.text.*;
import com.adobe.utils.*;
public class BonusGroup extends Sprite {
private var m_isActive:Boolean;
private var m_currentBonusColor:uint;
protected var m_bonusItems:Array;
private var m_uniqueElementId:int;
private var m_currentBonusValue:Number;
private static const BONUS_UNIT:int = 50;
public function BonusGroup(){
this.m_bonusItems = new Array();
this.m_uniqueElementId = 0;
this.m_currentBonusValue = 0;
this.m_currentBonusColor = 0xFFFFFF;
this.m_isActive = false;
}
public function destroy():void{
deleteElements();
}
public function removeElementByIndex(_arg1:int):void{
this.removeChild(this.m_bonusItems[_arg1]);
this.m_bonusItems.splice(_arg1, 1);
}
private function checkIfCleared():Boolean{
if ((((this.m_bonusItems.length == 0)) && (this.m_isActive))){
LevelDataHolder.me().enableSlowmo();
SoundControl.me().stopBackgroundLoop();
SoundControl.me().playHitBonusComplete();
this.m_isActive = false;
return (true);
};
return (false);
}
private function deleteElements():void{
var _local2:int;
var _local1:int = this.m_bonusItems.length;
while (this.m_bonusItems.length > 0) {
_local2 = (this.m_bonusItems.length - 1);
removeElementByIndex(_local2);
};
this.m_isActive = false;
}
public function checkCollision(_arg1:Ball):Boolean{
var _local2:Number = this.m_bonusItems.length;
var _local3:int;
while (_local3 < _local2) {
if (this.m_bonusItems[_local3].hitTestObject(_arg1)){
explodeElement(_local3);
break;
};
_local3++;
};
var _local4:Boolean = this.checkIfCleared();
return (_local4);
}
public function setEditable(_arg1:Boolean):void{
var _local2:int = this.m_bonusItems.length;
var _local3:int;
while (_local3 < _local2) {
this.m_bonusItems[_local3].setEditable(_arg1, _arg1);
_local3++;
};
}
private function explodeElement(_arg1:int):void{
var _local2:Bonus = this.m_bonusItems[_arg1];
var _local3:uint = _local2.getColorType().getColor();
if (_local3 != this.m_currentBonusColor){
this.m_currentBonusValue = BONUS_UNIT;
};
this.m_currentBonusColor = _local3;
var _local4:Number = this.m_currentBonusValue;
if (this.m_currentBonusValue == (BONUS_UNIT * 4)){
PlayerStats.getInstance().completeColorCombo();
};
Score.me().addScore(_local4);
var _local5:Number = _local2.x;
var _local6:Number = _local2.y;
ParticleContainer.createParticles(_local5, _local6, 24, 0xFFFFFF);
createScoreObject(_local5, _local6);
this.m_currentBonusValue = (this.m_currentBonusValue + BONUS_UNIT);
SoundControl.me().playHitBonus();
removeElementByIndex(_arg1);
}
public function init():void{
deleteElements();
createElements();
}
public function removeElementById(_arg1:int):void{
var _local2:int = this.m_bonusItems.length;
var _local3:int;
while (_local3 < _local2) {
if (this.m_bonusItems[_local3].getId() == _arg1){
this.m_bonusItems.splice(_local3, 1);
break;
};
_local3++;
};
}
private function createElements():void{
var _local4:Number;
var _local5:Number;
var _local6:Number;
var _local7:ColorType;
this.m_isActive = true;
resetBonus();
var _local1:Array = LevelDataHolder.me().getCurrentLevel().getBonusList();
var _local2:int = _local1.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _local1[_local3].posX;
_local5 = _local1[_local3].posY;
_local6 = _local1[_local3].size;
_local7 = _local1[_local3].colorType;
addElement(_local4, _local5, _local6, _local7, false);
_local3++;
};
}
public function resetBonus():void{
this.m_currentBonusValue = BONUS_UNIT;
}
public function getList():Array{
return (ArrayUtil.copyArray(m_bonusItems));
}
private function createScoreObject(_arg1:Number, _arg2:Number):void{
var _local3:ScoreObject = new ScoreObject(_arg1, _arg2);
this.addChild(_local3);
_local3.display(this.m_currentBonusValue, this.m_currentBonusColor);
}
public function addElement(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:ColorType, _arg5:Boolean):void{
this.m_uniqueElementId++;
var _local6:int = this.m_bonusItems.length;
var _local7:Bonus = new Bonus(this.m_uniqueElementId, _arg1, _arg2, _arg3, _arg4);
this.m_bonusItems.push(_local7);
this.addChild(this.m_bonusItems[_local6]);
this.m_bonusItems[_local6].setParent(this);
if (_arg5){
this.m_bonusItems[_local6].setEditable(true, true);
};
}
}
}//package de.pixelate.mrbounce.game
Section 33
//Border (de.pixelate.mrbounce.game.Border)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.level.*;
import flash.display.*;
public class Border extends Sprite {
private var m_color:uint;
private var m_thickness:Number;
public function Border(){
showGameBorder();
this.y = -(World.OFFSET_Y);
}
public function showEditorBorder():void{
this.m_color = 0xEDED;
this.m_thickness = 5;
draw();
}
public function showGameBorder():void{
this.m_color = 789516;
this.m_thickness = 2;
draw();
}
private function draw():void{
this.graphics.clear();
var _local1 = 50;
var _local2 = 800;
this.graphics.lineStyle(0, 0, 0);
this.graphics.beginFill(0, 1);
this.graphics.drawRect((World.BORDER_LEFT - _local1), (World.BORDER_TOP - _local2), (World.BORDER_RIGHT + (_local1 * 2)), _local2);
this.graphics.drawRect((World.BORDER_LEFT - _local1), World.BORDER_TOP, _local1, World.BORDER_BOTTOM);
this.graphics.drawRect(World.BORDER_RIGHT, World.BORDER_TOP, _local1, World.BORDER_BOTTOM);
this.graphics.drawRect((World.BORDER_LEFT - _local1), World.BORDER_BOTTOM, (World.BORDER_RIGHT + (_local1 * 2)), _local2);
this.graphics.endFill();
this.graphics.lineStyle(this.m_thickness, this.m_color, 1, false, "normal", CapsStyle.NONE);
this.graphics.beginFill(this.m_color, 0);
this.graphics.drawRect(World.BORDER_LEFT, World.BORDER_TOP, World.BORDER_RIGHT, World.BORDER_BOTTOM);
this.graphics.endFill();
}
}
}//package de.pixelate.mrbounce.game
Section 34
//Bouncer (de.pixelate.mrbounce.game.Bouncer)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.base.*;
import flash.events.*;
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.enumerations.*;
public class Bouncer extends EditableSprite {
private var m_hasDownSide:Boolean;
private var m_rightSide:BouncerSide;
private var m_isClosed:Boolean;
private var m_leftSide:BouncerSide;
private var m_isMovable:Boolean;
private var m_friction:Number;
private var m_upSide:BouncerSide;
private var m_hasLeftSide:Boolean;
private var m_hasRightSide:Boolean;
private var m_downSide:BouncerSide;
private var m_isDestroyable:Boolean;
private var m_hasUpSide:Boolean;
private var m_parent:GameContainer;
public function Bouncer(_arg1:int, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Boolean, _arg7:Boolean, _arg8:Boolean, _arg9:Boolean, _arg10:Boolean, _arg11:Boolean){
this.m_isDestroyable = _arg6;
this.m_isMovable = _arg7;
this.m_hasLeftSide = _arg8;
this.m_hasUpSide = _arg9;
this.m_hasRightSide = _arg10;
this.m_hasDownSide = _arg11;
if (((((((_arg8) && (_arg11))) && (_arg10))) && (_arg9))){
this.m_isClosed = true;
} else {
this.m_isClosed = false;
};
setSize(_arg4, _arg5);
this.m_id = _arg1;
this.m_color = 0xFFFF;
this.m_friction = 0.99;
this.m_posX = _arg2;
this.m_posY = _arg3;
updatePosition();
this.m_speedX = 0;
this.m_speedY = 0;
draw();
init();
}
private function onEnterFrame(_arg1:Event):void{
if (!GameState.isGamePaused){
move();
};
}
private function draw():void{
if (this.m_hasUpSide){
this.m_upSide = new BouncerSide(Direction.UP, this.m_width, this.m_height, this);
this.addChild(this.m_upSide);
};
if (this.m_hasDownSide){
this.m_downSide = new BouncerSide(Direction.DOWN, this.m_width, this.m_height, this);
this.addChild(this.m_downSide);
};
if (this.m_hasLeftSide){
this.m_leftSide = new BouncerSide(Direction.LEFT, this.m_width, this.m_height, this);
this.addChild(this.m_leftSide);
};
if (this.m_hasRightSide){
this.m_rightSide = new BouncerSide(Direction.RIGHT, this.m_width, this.m_height, this);
this.addChild(this.m_rightSide);
};
setGlow();
}
public function hasLeftSide():Boolean{
return (this.m_hasLeftSide);
}
private function move():void{
this.m_speedX = (this.m_speedX * this.m_friction);
this.m_speedY = (this.m_speedY * this.m_friction);
if ((((this.m_speedX < 0.1)) && ((this.m_speedX > -0.1)))){
this.m_speedX = 0;
};
if ((((this.m_speedY < 0.1)) && ((this.m_speedY > -0.1)))){
this.m_speedY = 0;
};
if (this.m_speedX < 0){
if (this.getLeftBorder() > World.BORDER_LEFT){
this.m_posX = (this.m_posX + this.m_speedX);
} else {
this.m_speedX = (this.m_speedX * -1);
};
} else {
if (this.m_speedX > 0){
if (this.getRightBorder() < World.BORDER_RIGHT){
this.m_posX = (this.m_posX + this.m_speedX);
} else {
this.m_speedX = (this.m_speedX * -1);
};
};
};
if (this.m_speedY < 0){
if (this.getTopBorder() > World.BORDER_TOP){
this.m_posY = (this.m_posY + this.m_speedY);
} else {
this.m_speedY = (this.m_speedY * -1);
};
} else {
if (this.m_speedY > 0){
if (this.getBottomBorder() < World.SAFE_BOTTOM){
this.m_posY = (this.m_posY + this.m_speedY);
} else {
this.m_speedY = (this.m_speedY * -1);
};
};
};
updatePosition();
if (this.m_upSide){
this.m_upSide.updateInternalPosition();
};
if (this.m_downSide){
this.m_downSide.updateInternalPosition();
};
if (this.m_leftSide){
this.m_leftSide.updateInternalPosition();
};
if (this.m_rightSide){
this.m_rightSide.updateInternalPosition();
};
}
public function hasRightSide():Boolean{
return (this.m_hasRightSide);
}
public function push(_arg1:Number, _arg2:Number):void{
if (this.m_isMovable){
this.m_speedX = (this.m_speedX + (_arg1 * 0.5));
this.m_speedY = (this.m_speedY + (_arg2 * 0.5));
};
}
public function hasUpSide():Boolean{
return (this.m_hasUpSide);
}
override public function destroy():void{
super.destroy();
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
if (this.m_hasUpSide){
this.removeChild(this.m_upSide);
this.m_upSide = null;
};
if (this.m_hasDownSide){
this.removeChild(this.m_downSide);
this.m_downSide = null;
};
if (this.m_hasLeftSide){
this.removeChild(this.m_leftSide);
this.m_leftSide = null;
};
if (this.m_hasRightSide){
this.removeChild(this.m_rightSide);
this.m_rightSide = null;
};
this.m_parent.removeBouncerById(this.m_id);
}
public function getDownSide():BouncerSide{
return (this.m_downSide);
}
public function hasDownSide():Boolean{
return (this.m_hasDownSide);
}
override protected function onMouseUp(_arg1:MouseEvent):void{
super.onMouseUp(_arg1);
if (this.m_isDragable){
if (this.m_upSide){
this.m_upSide.updateInternalPosition();
};
if (this.m_downSide){
this.m_downSide.updateInternalPosition();
};
if (this.m_leftSide){
this.m_leftSide.updateInternalPosition();
};
if (this.m_rightSide){
this.m_rightSide.updateInternalPosition();
};
};
}
public function init():void{
if (this.m_isMovable){
addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
};
}
private function createParticles(_arg1:Side):void{
var _local2:Number;
var _local3:Number;
var _local4:Number;
var _local5:Number;
var _local14:Particle;
if (_arg1 == Side.TOP){
_local2 = -(this.m_halfWidth);
_local3 = this.m_halfWidth;
_local4 = -(this.m_halfHeight);
_local5 = -(this.m_halfHeight);
} else {
if (_arg1 == Side.BOTTOM){
_local2 = -(this.m_halfWidth);
_local3 = this.m_halfWidth;
_local4 = this.m_halfHeight;
_local5 = this.m_halfHeight;
} else {
if (_arg1 == Side.LEFT){
_local2 = -(this.m_halfWidth);
_local3 = -(this.m_halfWidth);
_local4 = -(this.m_halfHeight);
_local5 = this.m_halfHeight;
} else {
if (_arg1 == Side.RIGHT){
_local2 = this.m_halfWidth;
_local3 = this.m_halfWidth;
_local4 = -(this.m_halfHeight);
_local5 = this.m_halfHeight;
};
};
};
};
var _local6 = 20;
var _local7:Number = Math.abs((_local3 - _local2));
var _local8:Number = Math.abs((_local5 - _local4));
var _local9:Number = (_local7 / _local6);
var _local10:Number = (_local8 / _local6);
var _local11:Number = (_local2 + this.x);
var _local12:Number = (_local4 + this.y);
var _local13:int;
while (_local13 <= _local6) {
_local14 = new Particle(_local11, _local12, this.m_color);
ParticleContainer.me().addChild(_local14);
_local14.explode();
_local11 = (_local11 + _local9);
_local12 = (_local12 + _local10);
_local13++;
};
}
public function getUpSide():BouncerSide{
return (this.m_upSide);
}
public function setParent(_arg1:GameContainer):void{
this.m_parent = _arg1;
}
public function destroySide(_arg1:Side):void{
if (this.m_isDestroyable){
if (_arg1 == Side.RIGHT){
this.m_isClosed = false;
this.m_hasRightSide = false;
this.removeChild(this.m_rightSide);
this.m_rightSide = null;
createParticles(Side.RIGHT);
} else {
if (_arg1 == Side.LEFT){
this.m_isClosed = false;
this.m_hasLeftSide = false;
this.removeChild(this.m_leftSide);
this.m_leftSide = null;
createParticles(Side.LEFT);
} else {
if (_arg1 == Side.BOTTOM){
this.m_isClosed = false;
this.m_hasDownSide = false;
this.removeChild(this.m_downSide);
this.m_downSide = null;
createParticles(Side.BOTTOM);
} else {
if (_arg1 == Side.TOP){
this.m_isClosed = false;
this.m_hasUpSide = false;
this.removeChild(this.m_upSide);
this.m_upSide = null;
createParticles(Side.TOP);
};
};
};
};
};
}
public function getRightSide():BouncerSide{
return (this.m_rightSide);
}
public function isClosed():Boolean{
return (this.m_isClosed);
}
public function getLeftSide():BouncerSide{
return (this.m_leftSide);
}
}
}//package de.pixelate.mrbounce.game
Section 35
//BouncerSide (de.pixelate.mrbounce.game.BouncerSide)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.base.*;
import de.pixelate.mrbounce.enumerations.*;
public class BouncerSide extends BasicSprite {
private var m_side:Direction;
private var m_bouncerWidth:Number;
private var m_bouncerHalfHeight:Number;
private var m_bouncerHalfWidth:Number;
private var m_parent:Bouncer;
private var m_bouncerHeight:Number;
public function BouncerSide(_arg1:Direction, _arg2:Number, _arg3:Number, _arg4:Bouncer){
this.m_parent = _arg4;
this.m_side = _arg1;
this.m_bouncerWidth = _arg2;
this.m_bouncerHeight = _arg3;
this.m_bouncerHalfWidth = (this.m_bouncerWidth / 2);
this.m_bouncerHalfHeight = (this.m_bouncerHeight / 2);
if (this.m_side == Direction.UP){
_arg3 = 1;
} else {
if (this.m_side == Direction.DOWN){
_arg3 = 1;
} else {
if (this.m_side == Direction.LEFT){
_arg2 = 1;
} else {
if (this.m_side == Direction.RIGHT){
_arg2 = 1;
};
};
};
};
setSize(_arg2, _arg3);
updateInternalPosition();
this.m_color = 0xFFFF;
draw();
}
private function draw():void{
this.graphics.clear();
this.graphics.lineStyle(2, this.m_color, 0.8);
this.graphics.beginFill(this.m_color, 0);
if (this.m_side == Direction.UP){
this.graphics.moveTo(-(this.m_bouncerHalfWidth), -(this.m_bouncerHalfHeight));
this.graphics.lineTo(this.m_bouncerHalfWidth, -(this.m_bouncerHalfHeight));
} else {
if (this.m_side == Direction.DOWN){
this.graphics.moveTo(-(this.m_bouncerHalfWidth), this.m_bouncerHalfHeight);
this.graphics.lineTo(this.m_bouncerHalfWidth, this.m_bouncerHalfHeight);
} else {
if (this.m_side == Direction.LEFT){
this.graphics.moveTo(-(this.m_bouncerHalfWidth), -(this.m_bouncerHalfHeight));
this.graphics.lineTo(-(this.m_bouncerHalfWidth), this.m_bouncerHalfHeight);
} else {
if (this.m_side == Direction.RIGHT){
this.graphics.moveTo(this.m_bouncerHalfWidth, -(this.m_bouncerHalfHeight));
this.graphics.lineTo(this.m_bouncerHalfWidth, this.m_bouncerHalfHeight);
};
};
};
};
}
public function updateInternalPosition():void{
if (this.m_side == Direction.UP){
this.m_posX = this.m_parent.x;
this.m_posY = (this.m_parent.y - this.m_bouncerHalfHeight);
} else {
if (this.m_side == Direction.DOWN){
this.m_posX = this.m_parent.x;
this.m_posY = (this.m_parent.y + this.m_bouncerHalfHeight);
} else {
if (this.m_side == Direction.LEFT){
this.m_posX = (this.m_parent.x - this.m_bouncerHalfWidth);
this.m_posY = this.m_parent.y;
} else {
if (this.m_side == Direction.RIGHT){
this.m_posX = (this.m_parent.x + this.m_bouncerHalfWidth);
this.m_posY = this.m_parent.y;
};
};
};
};
}
}
}//package de.pixelate.mrbounce.game
Section 36
//Game (de.pixelate.mrbounce.game.Game)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.events.*;
import de.pixelate.mrbounce.base.*;
import flash.events.*;
import de.pixelate.mrbounce.sound.*;
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.utilities.*;
import de.pixelate.mrbounce.enumerations.*;
import flash.display.*;
import de.pixelate.mrbounce.text.*;
import de.pixelate.mrbounce.tutorial.*;
import flash.ui.*;
import de.pixelate.pelikan.utilities.*;
import flash.utils.*;
import de.pixelate.mrbounce.ui.*;
public class Game extends Sprite {
private var m_textInstructions:Instructions;
private var m_ticker:Timer;
private var m_isPausePermitted:Boolean;
private var m_timeTextField:Watch;
private var m_border:Border;
private var m_spinner:Spinner;
private var m_evaluatePrepareTimer:Timer;
private var m_main:Main;
private var m_isPauseKeyLocked:Boolean;
private var m_isMuteKeyLocked:Boolean;
private var m_isWaitingForRestart:Boolean;
private var m_gameContainer:GameContainer;
private var m_projection:Projection;
private var m_scoreTextField:ScoreCombo;
private var m_statusBar:StatusBar;
private var m_textPause:BulletinPause;
private var m_readyTimer:Timer;
private var m_paddle:Paddle;
private var m_lastGameOverType:GameOverType;
private var m_ball:Ball;
private var m_isGameRunning:Boolean;
private var m_fpsDisplay:FpsDisplay;
private var m_bonusGroup:BonusGroup;
private var m_lives:int;
private var m_muteButton:MuteButton;
private var m_isDead:Boolean;
private var m_endScreen:EndScreen;
private var m_tail:Tail;
private var m_evaluateTimer:Timer;
private var m_isEscapeKeyLocked:Boolean;
private var m_peek:Peek;
private static const START_LIVES:int = 5;
public function Game(_arg1:Main, _arg2:GameContainer){
this.visible = false;
this.m_main = _arg1;
this.m_gameContainer = _arg2;
this.m_bonusGroup = this.m_gameContainer.getBonusGroup();
this.m_isGameRunning = false;
this.m_isDead = false;
this.m_isWaitingForRestart = false;
this.m_isPausePermitted = false;
this.m_isPauseKeyLocked = false;
this.m_isMuteKeyLocked = false;
this.m_isEscapeKeyLocked = false;
Tutorial.me().isInTutorialMode = false;
this.m_lastGameOverType = null;
}
private function togglePause():void{
if (this.m_isGameRunning){
this.pauseGame();
} else {
this.unpauseGame();
};
}
private function onLevelCleared(_arg1:LevelEvent):void{
this.m_isPausePermitted = false;
this.m_isDead = true;
var _local2:int = this.m_timeTextField.getSeconds();
if (_local2 > 0){
this.m_textInstructions.displayLevelClearBonus();
} else {
this.m_textInstructions.displayLevelClear();
};
if (_local2 <= Watch.HURRY_THRESHOLD){
PlayerStats.getInstance().completeLastSecond();
};
stopGame();
evaluateTimeScore();
}
private function onExtraLife(_arg1:ExtraLifeEvent):void{
SoundControl.me().playExtraLife();
this.m_lives = (this.m_lives + _arg1.lives);
this.m_statusBar.displayBalls(this.m_lives);
this.m_textInstructions.displayExtraLife();
}
public function pauseGame(_arg1:Boolean=true):void{
if (this.m_isPausePermitted){
GameState.pause();
stopGame();
SoundControl.me().turnMusicVolumeDown();
if (_arg1){
this.m_textPause.displayPause();
};
};
}
private function stopGame():void{
this.m_timeTextField.stop();
this.m_isGameRunning = false;
this.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onLevelChanged(_arg1:LevelEvent):void{
LevelDataHolder.me().disableSlowmo();
this.m_ball.setLevelSpeed(LevelDataHolder.me().getCurrentLevel().getSpeed());
this.m_ball.stopFollowPath();
ParticleContainer.clear();
this.m_gameContainer.update();
this.m_statusBar.getLevelTextField().display();
this.m_tail.clear();
this.live();
if (GameState.isEditorActive){
this.m_gameContainer.setEditable(true);
};
}
public function init():void{
LevelUtil.createLevels();
this.createGameElements();
this.createTextElements();
this.m_fpsDisplay = new FpsDisplay();
this.addChild(this.m_fpsDisplay);
PlayerStats.getInstance().init();
LevelDataHolder.me().addEventListener(LevelEvent.CHANGE, onLevelChanged, false, 0, true);
LevelDataHolder.me().addEventListener(LevelEvent.CLEARED, onLevelCleared, false, 0, true);
Score.me().addEventListener(ScoreEvent.CHANGE, onChangeScore, false, 0, true);
Score.me().addEventListener(ExtraLifeEvent.EXTRALIFE, onExtraLife, false, 0, true);
this.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);
StageHelper.getStage().addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown, false, 0, true);
StageHelper.getStage().addEventListener(KeyboardEvent.KEY_UP, onKeyUp, false, 0, true);
Key.initialize(StageHelper.getStage());
}
private function createGameElements():void{
this.m_paddle = new Paddle();
this.addChild(this.m_paddle);
this.m_projection = new Projection();
this.addChild(this.m_projection);
this.m_tail = new Tail();
this.addChild(this.m_tail);
this.m_ball = new Ball();
this.addChild(this.m_ball);
this.m_peek = new Peek();
this.addChild(this.m_peek);
this.addChild(ParticleContainer.me());
}
private function checkIfBallLost():void{
if (this.m_ball.isLost()){
this.die();
};
}
private function evaluateTimeScore():void{
var _local1:int = this.m_timeTextField.getSeconds();
if (_local1 > 0){
this.m_evaluatePrepareTimer = new Timer(10);
} else {
this.m_evaluatePrepareTimer = new Timer(2000);
};
this.m_evaluatePrepareTimer.addEventListener(TimerEvent.TIMER, onPrepareEvaluateScore, false, 0, true);
this.m_evaluatePrepareTimer.start();
}
public function getBorder():Border{
return (this.m_border);
}
private function triggerRestart():void{
this.m_textInstructions.clear();
this.m_isWaitingForRestart = false;
if ((((((this.m_lastGameOverType == GameOverType.NO_LIVES_LEFT)) || ((this.m_lastGameOverType == GameOverType.TIME_UP)))) || (LevelDataHolder.me().isLastLevel()))){
this.quitGame();
} else {
if (this.m_lastGameOverType == GameOverType.COMPLETED_STAGE){
this.startNextStage();
};
};
}
private function onPrepareEvaluateScore(_arg1:TimerEvent):void{
this.m_evaluatePrepareTimer.removeEventListener(TimerEvent.TIMER, onPrepareEvaluateScore);
this.m_evaluatePrepareTimer.reset();
this.m_evaluatePrepareTimer = null;
this.m_evaluateTimer = new Timer(30);
this.m_evaluateTimer.addEventListener(TimerEvent.TIMER, onEvaluateScore, false, 0, true);
this.m_evaluateTimer.start();
var _local2:int = this.m_timeTextField.getSeconds();
if (_local2 > 0){
SoundControl.me().playTimeBonus();
};
}
private function onUpdatePercentage(_arg1:TutorialEvent):void{
this.m_spinner.setPercentage(_arg1.percentage);
}
private function checkWinds():void{
var _local4:Number;
var _local1:Array = this.m_gameContainer.getWinds();
var _local2:int = _local1.length;
var _local3:int;
while (_local3 < _local2) {
if (this.m_ball.hitTestObject(_local1[_local3])){
_local4 = _local1[_local3].getSpeed();
this.m_ball.blow(_local4);
};
_local3++;
};
}
private function onCheatKeys(_arg1:uint):void{
switch (_arg1){
case 49:
LevelDataHolder.me().getCurrentLevel().setSpeed(0.2);
break;
case 50:
LevelDataHolder.me().getCurrentLevel().setSpeed(0.325);
break;
case 51:
LevelDataHolder.me().getCurrentLevel().setSpeed(0.45);
break;
case 52:
LevelDataHolder.me().getCurrentLevel().setSpeed(0.575);
break;
case 53:
LevelDataHolder.me().getCurrentLevel().setSpeed(0.7);
break;
case 57:
SoundControl.me().stopBackgroundLoop();
LevelDataHolder.me().goPreviousLevel();
break;
case 48:
SoundControl.me().stopBackgroundLoop();
LevelDataHolder.me().goNextLevel();
break;
};
}
private function endTutorial():void{
Tutorial.me().removeEventListener(TutorialEvent.UPDATE_PERCENTAGE, onUpdatePercentage);
Tutorial.me().reset();
Tutorial.me().isInTutorialMode = false;
this.prepareGame();
this.m_main.showGame();
}
private function onWaitAfterLive(_arg1:TimerEvent):void{
this.m_timeTextField.start();
this.m_isGameRunning = true;
this.m_isPausePermitted = true;
this.m_readyTimer.stop();
this.m_readyTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onWaitAfterLive);
}
private function createTextElements():void{
this.m_statusBar = new StatusBar();
this.addChild(this.m_statusBar);
this.m_scoreTextField = this.m_statusBar.getScoreTextField();
this.m_timeTextField = this.m_statusBar.getTimeTextField();
this.m_timeTextField.addEventListener(WatchEvent.HURRY, onHurry, false, 0, true);
this.m_timeTextField.addEventListener(WatchEvent.SHRINK, onShrink, false, 0, true);
this.m_endScreen = new EndScreen();
this.addChild(this.m_endScreen);
this.m_textInstructions = new Instructions();
this.addChild(this.m_textInstructions);
this.m_textPause = new BulletinPause();
this.addChild(this.m_textPause);
this.m_spinner = new Spinner();
this.addChild(this.m_spinner);
this.m_border = new Border();
this.addChild(this.m_border);
this.m_muteButton = new MuteButton();
this.addChild(this.m_muteButton);
this.m_muteButton.init();
var _local1:CustomContextMenu = new CustomContextMenu(this.m_muteButton);
m_main.contextMenu = _local1.getContextMenu();
}
private function waitForRestart():void{
this.m_isWaitingForRestart = true;
}
private function onChangeScore(_arg1:ScoreEvent):void{
this.m_scoreTextField.display(_arg1.score);
}
private function removeTimers():void{
if (this.m_ticker){
this.m_ticker.stop();
if (this.m_ticker.hasEventListener(TimerEvent.TIMER_COMPLETE)){
this.m_ticker.removeEventListener(TimerEvent.TIMER_COMPLETE, onWaitAfterDead);
};
};
if (this.m_readyTimer){
this.m_readyTimer.stop();
if (this.m_readyTimer.hasEventListener(TimerEvent.TIMER_COMPLETE)){
this.m_readyTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onWaitAfterLive);
};
};
if (this.m_evaluateTimer){
this.m_evaluateTimer.stop();
if (this.m_evaluateTimer.hasEventListener(TimerEvent.TIMER)){
this.m_evaluateTimer.removeEventListener(TimerEvent.TIMER, onEvaluateScore);
};
};
if (this.m_evaluatePrepareTimer){
this.m_evaluatePrepareTimer.stop();
if (this.m_evaluatePrepareTimer.hasEventListener(TimerEvent.TIMER)){
this.m_evaluatePrepareTimer.removeEventListener(TimerEvent.TIMER, onPrepareEvaluateScore);
};
};
}
private function startGame():void{
if (!Tutorial.me().isInTutorialMode){
this.prepareGame();
};
Score.me().resetScore();
this.m_isDead = false;
this.m_isGameRunning = true;
this.m_isPausePermitted = true;
this.m_ball.setLevelSpeed(LevelDataHolder.me().getCurrentLevel().getSpeed());
this.m_ball.setStartPosition();
this.m_paddle.setStartPosition();
this.m_paddle.resetSize();
this.m_peek.setStartPosition();
this.m_tail.clear();
GameState.isGamePaused = false;
PlayerStats.getInstance().playerLostBall = false;
this.addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
}
private function onHurry(_arg1:WatchEvent):void{
this.m_textInstructions.displayHurry();
}
private function checkTutorial():void{
var _local1:TutorialState;
if (Tutorial.me().isInTutorialMode){
_local1 = Tutorial.me().checkState();
switch (_local1){
case TutorialState.MOVED_VERTICAL:
this.m_textInstructions.displayTutorialVertical();
break;
case TutorialState.USED_SLOWMO:
this.m_textInstructions.displayTutorialSlowmo();
break;
case TutorialState.DONE:
this.m_textInstructions.displayTutorialStartGame();
this.endTutorial();
break;
};
};
}
private function die():void{
if (!this.m_isDead){
SoundControl.me().playLostBall();
this.m_isPausePermitted = false;
this.m_timeTextField.stop();
this.m_isDead = true;
this.m_lives--;
PlayerStats.getInstance().playerLostBall = true;
if (!Tutorial.me().isInTutorialMode){
this.m_statusBar.displayBalls(this.m_lives);
};
if ((((this.m_lives <= 0)) && (!(Tutorial.me().isInTutorialMode)))){
this.m_textInstructions.displayGameOver();
this.m_endScreen.show();
this.waitForRestart();
this.m_lastGameOverType = GameOverType.NO_LIVES_LEFT;
stopGame();
Score.me().gameOver();
} else {
if (((this.m_timeTextField.isHurry()) && (!(Tutorial.me().isInTutorialMode)))){
this.m_timeTextField.setToZero();
this.m_textInstructions.displayLostBallAndTimeBonus();
} else {
this.m_textInstructions.displayLostBall();
};
this.m_ticker = new Timer(2000, 1);
this.m_ticker.addEventListener(TimerEvent.TIMER_COMPLETE, onWaitAfterDead, false, 0, true);
this.m_ticker.start();
};
};
}
private function startNextStage():void{
LevelDataHolder.me().disableSlowmo();
SoundControl.me().playBackgroundLoop();
this.m_gameContainer.update();
this.m_ball.setLevelSpeed(LevelDataHolder.me().getCurrentLevel().getSpeed());
this.m_ball.stopFollowPath();
this.m_timeTextField.init();
this.m_statusBar.getLevelTextField().display();
this.m_isDead = false;
this.m_isGameRunning = true;
this.m_isPausePermitted = true;
this.m_ball.setStartPosition();
this.m_paddle.setStartPosition();
this.m_paddle.resetSize();
this.m_peek.setStartPosition();
this.m_tail.clear();
this.addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
}
public function unpauseGame():void{
if (this.m_isPausePermitted){
GameState.unpause();
resumeGame();
SoundControl.me().turnMusicVolumeUp();
this.m_textPause.clear();
};
}
private function prepareGame():void{
LevelDataHolder.me().init();
SoundControl.me().playBackgroundLoop();
this.m_timeTextField.init();
this.m_scoreTextField.display(0);
this.m_statusBar.setInfoVisibility(true);
this.m_lives = START_LIVES;
this.m_statusBar.displayBalls(this.m_lives);
}
private function checkPaddle():void{
if (this.m_ball.getVerticalCollision(this.m_paddle)){
this.m_bonusGroup.resetBonus();
SoundControl.me().playHitPaddle();
this.m_paddle.flash();
this.m_ball.comparePositionX(this.m_paddle.x);
this.m_ball.applyBounceSpeed(this.m_peek.y);
};
}
private function scrollWinds():void{
var _local1:Array = this.m_gameContainer.getWinds();
var _local2:int = _local1.length;
var _local3:int;
while (_local3 < _local2) {
_local1[_local3].scroll();
_local3++;
};
}
private function onEnterFrame(_arg1:Event):void{
this.m_timeTextField.update();
this.m_statusBar.setSlowMotionEnergy(this.m_ball.getSlowMotionEnergy());
this.m_tail.enqueue(this.m_ball.x, this.m_ball.y);
this.scrollWinds();
if (this.m_isGameRunning){
this.m_ball.doEveryFrame();
this.m_paddle.doEveryFrame();
this.m_peek.doEveryFrame();
};
if (!this.m_ball.isFollowingPath()){
checkPaddle();
this.m_projection.draw(this.m_ball.getProjection(this.m_peek.y, this.m_paddle));
checkWinds();
checkBlockers();
checkBouncers();
checkPaths();
};
checkIfBallLost();
checkBonus();
checkTutorial();
}
private function resumeGame():void{
this.m_timeTextField.start();
this.m_isGameRunning = true;
this.addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
}
private function checkPaths():void{
var _local4:Array;
var _local5:int;
var _local6:int;
var _local7:Array;
var _local8:Number;
var _local9:Number;
var _local1:Array = this.m_gameContainer.getPaths();
var _local2:int = _local1.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = _local1[_local3].getPathElements();
_local5 = _local4.length;
_local6 = 0;
while (_local6 < _local5) {
if (_local4[_local6].hasAccessPoint()){
if (this.m_ball.hitTestObject(_local4[_local6].getHitSprite())){
_local7 = _local1[_local3].getCompletePath(_local6);
this.m_ball.startFollowPath(_local7);
_local8 = _local1[_local3].getVelocityX();
_local9 = _local1[_local3].getVelocityY();
this.m_ball.setSpeedX(_local8);
this.m_ball.setSpeedY(_local9);
this.m_projection.clear();
};
};
_local6++;
};
_local3++;
};
}
private function onMouseDown(_arg1:MouseEvent):void{
if (this.m_isWaitingForRestart){
triggerRestart();
};
}
private function onKeyDown(_arg1:KeyboardEvent):void{
onCheatKeys(_arg1.keyCode);
if (_arg1.keyCode == 80){
if (((!(this.m_isPauseKeyLocked)) && (!(GameState.isWaitingForQuitConfirmation)))){
togglePause();
this.m_isPauseKeyLocked = true;
};
} else {
if (_arg1.keyCode == 77){
if (!this.m_isMuteKeyLocked){
this.m_muteButton.toggle();
this.m_isMuteKeyLocked = true;
};
} else {
if (_arg1.keyCode == Keyboard.ESCAPE){
if (((((!(this.m_isEscapeKeyLocked)) && (this.m_isPausePermitted))) && (!(GameState.isWaitingForQuitConfirmation)))){
GameState.isWaitingForQuitConfirmation = true;
this.pauseGame(false);
this.m_textInstructions.displayConfirmQuitGame();
this.m_isEscapeKeyLocked = true;
};
};
};
};
if (GameState.isWaitingForQuitConfirmation){
if (_arg1.keyCode == 89){
quitGame();
GameState.isWaitingForQuitConfirmation = false;
this.m_textInstructions.clear();
} else {
if (_arg1.keyCode == 78){
GameState.isWaitingForQuitConfirmation = false;
this.m_textInstructions.clear();
this.unpauseGame();
};
};
};
if (this.m_isWaitingForRestart){
if (_arg1.keyCode == Keyboard.SHIFT){
triggerRestart();
};
};
}
private function onKeyUp(_arg1:KeyboardEvent):void{
if (_arg1.keyCode == 80){
this.m_isPauseKeyLocked = false;
} else {
if (_arg1.keyCode == 77){
this.m_isMuteKeyLocked = false;
} else {
if (_arg1.keyCode == Keyboard.ESCAPE){
this.m_isEscapeKeyLocked = false;
};
};
};
}
private function onWaitAfterDead(_arg1:TimerEvent):void{
this.m_textInstructions.clear();
this.live();
this.m_ticker.stop();
this.m_ticker.removeEventListener(TimerEvent.TIMER_COMPLETE, onWaitAfterDead);
}
private function onShrink(_arg1:WatchEvent):void{
this.m_paddle.shrink();
}
public function startGameFromMenu():void{
this.visible = true;
Tutorial.me().isInTutorialMode = false;
startGame();
}
public function startTutorial():void{
this.visible = true;
this.m_statusBar.setInfoVisibility(false);
Tutorial.me().addEventListener(TutorialEvent.UPDATE_PERCENTAGE, onUpdatePercentage, false, 0, true);
Tutorial.me().isInTutorialMode = true;
this.m_textInstructions.displayTutorialHorizontal();
LevelDataHolder.me().selectTutorialLevel();
startGame();
}
private function quitGame():void{
SoundControl.me().stopBackgroundLoop();
stopGame();
removeTimers();
m_endScreen.hide();
m_main.hideGame();
m_main.showTitleScreen();
}
private function checkBouncers():void{
var _local4:Direction;
var _local1:Array = this.m_gameContainer.getBouncers();
var _local2:int = _local1.length;
var _local3:int;
while (_local3 < _local2) {
if (_local1[_local3].isClosed()){
_local4 = this.m_ball.getBouncerCollision(_local1[_local3]);
switch (_local4){
case Direction.LEFT:
case Direction.RIGHT:
this.m_ball.invertX();
break;
case Direction.UP:
case Direction.DOWN:
this.m_ball.invertY();
break;
};
} else {
if (this.m_ball.getBouncerCollisionX(_local1[_local3])){
this.m_ball.invertX();
};
if (this.m_ball.getBouncerCollisionY(_local1[_local3])){
this.m_ball.invertY();
};
};
_local3++;
};
}
private function onEvaluateScore(_arg1:TimerEvent):void{
var _local2 = 1;
var _local3:int = this.m_timeTextField.getSeconds();
if (_local3 > 0){
this.m_timeTextField.setSeconds((_local3 - _local2));
this.m_timeTextField.display(false);
Score.me().addScore((50 * _local2));
} else {
SoundControl.me().stopTimeBonus();
this.m_timeTextField.setSeconds(0);
this.m_timeTextField.display(false);
this.m_evaluateTimer.reset();
this.m_evaluateTimer.stop();
this.m_evaluateTimer.removeEventListener(TimerEvent.TIMER, onEvaluateScore);
if (LevelDataHolder.me().isLastLevel(true)){
Score.me().gameCompleted();
this.m_textInstructions.displayFinishedGame();
this.m_endScreen.show();
} else {
if (LevelDataHolder.me().isLastLevelOfWorld()){
this.m_textInstructions.displayWorldCleared(LevelDataHolder.me().getCurrentStageId());
} else {
Score.me().completedLevel();
this.m_textInstructions.displayPressMouseButton();
};
};
this.waitForRestart();
this.m_lastGameOverType = GameOverType.COMPLETED_STAGE;
SoundControl.me().playBackgroundLoopEnding();
LevelDataHolder.me().setNextLevel();
};
}
private function live():void{
this.m_isDead = false;
this.m_peek.setStartPosition();
this.m_ball.setStartPosition();
this.m_paddle.setStartPosition();
this.m_paddle.resetSize();
this.m_isGameRunning = false;
this.m_readyTimer = new Timer(1000, 1);
this.m_readyTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onWaitAfterLive, false, 0, true);
this.m_readyTimer.start();
}
private function checkBonus():void{
var _local1:Boolean;
if (!Tutorial.me().isInTutorialMode){
_local1 = this.m_bonusGroup.checkCollision(m_ball);
if (_local1){
this.m_isPausePermitted = false;
this.m_timeTextField.stop();
};
};
}
private function checkBlockers():void{
var _local4:Boolean;
var _local1:Array = this.m_gameContainer.getBlockers();
var _local2:int = _local1.length;
var _local3:int;
while (_local3 < _local2) {
_local4 = this.m_ball.getVerticalCollision(_local1[_local3]);
if (_local4){
this.m_ball.invertY();
};
_local3++;
};
}
public function destroy():void{
this.m_muteButton.destroy();
LevelDataHolder.me().removeEventListener(LevelEvent.CHANGE, onLevelChanged);
LevelDataHolder.me().removeEventListener(LevelEvent.CLEARED, onLevelCleared);
Score.me().removeEventListener(ScoreEvent.CHANGE, onChangeScore);
Score.me().removeEventListener(ExtraLifeEvent.EXTRALIFE, onExtraLife);
this.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
StageHelper.getStage().removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
StageHelper.getStage().removeEventListener(KeyboardEvent.KEY_UP, onKeyUp);
if (this.hasEventListener(Event.ENTER_FRAME)){
this.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
removeTimers();
Key.deinitialize(StageHelper.getStage());
}
}
}//package de.pixelate.mrbounce.game
Section 37
//GameState (de.pixelate.mrbounce.game.GameState)
package de.pixelate.mrbounce.game {
public final class GameState {
public static var isWaitingForQuitConfirmation:Boolean = false;
public static var isGamePaused:Boolean = false;
public static var isEditorActive:Boolean = false;
public static function pause():void{
isGamePaused = true;
}
public static function unpause():void{
isGamePaused = false;
}
}
}//package de.pixelate.mrbounce.game
Section 38
//Paddle (de.pixelate.mrbounce.game.Paddle)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.base.*;
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.utilities.*;
import flash.geom.*;
import de.pixelate.mrbounce.enumerations.*;
import de.pixelate.mrbounce.tutorial.*;
import flash.ui.*;
public class Paddle extends MovableSprite {
private var m_glowStrength:Number;
private var m_isAnimatingHighlight:Boolean;
private var m_isAnimatingFlashIn:Boolean;
private var m_maxSpeed:Number;// = 14
private var m_defaultWidth:Number;// = 100
private var m_currentWidth:Number;
private var m_isAnimatingFlashOut:Boolean;
private var m_isAutoSlow:Boolean;
private var m_targetGreenValue:int;
private var m_currentGreenValue:int;
private var m_defaultHeight:Number;// = 2
private static const ACCELERATION:Number = 1;
private static const AUTO_SLOW_FACTOR:Number = 0.5;
public function Paddle(){
this.m_currentWidth = this.m_defaultWidth;
setSize(this.m_defaultWidth, this.m_defaultHeight);
this.m_direction = Direction.RIGHT;
this.m_color = 0xFFFFFF;
this.m_currentGreenValue = 0;
this.m_targetGreenValue = 0;
this.m_glowStrength = 0;
this.m_speedX = 0;
this.m_isAutoSlow = false;
this.m_isAnimatingHighlight = false;
this.m_isAnimatingFlashIn = false;
this.m_isAnimatingFlashOut = false;
setStartPosition();
draw();
}
private function setTransform():void{
this.m_targetGreenValue = 0xFF;
this.m_isAnimatingHighlight = true;
}
private function unsetTransform():void{
this.m_targetGreenValue = 0;
this.m_isAnimatingHighlight = true;
}
private function draw():void{
this.graphics.clear();
this.graphics.beginFill(this.m_color, 100);
this.graphics.drawRect(-(this.m_halfWidth), -(this.m_halfHeight), m_width, m_height);
this.graphics.endFill();
setGlow();
}
public function shrink():void{
if (this.m_currentWidth > 0){
this.m_currentWidth = (this.m_currentWidth - 5);
setSize(this.m_currentWidth, this.m_defaultHeight);
draw();
};
}
private function move():void{
var _local1:Number = this.m_speedX;
if (this.m_isAutoSlow){
_local1 = (_local1 * AUTO_SLOW_FACTOR);
};
if (this.m_direction == Direction.LEFT){
if (this.m_posX > (World.BORDER_LEFT + this.m_halfWidth)){
this.m_posX = (this.m_posX - _local1);
Tutorial.me().increaseDistanceMovedHorizontal(this.m_speedX);
};
if (this.m_posX < (World.BORDER_LEFT + this.m_halfWidth)){
this.m_posX = (World.BORDER_LEFT + this.m_halfWidth);
};
} else {
if (this.m_direction == Direction.RIGHT){
if (this.m_posX < (World.BORDER_RIGHT - this.m_halfWidth)){
this.m_posX = (this.m_posX + _local1);
Tutorial.me().increaseDistanceMovedHorizontal(this.m_speedX);
};
if (this.m_posX > (World.BORDER_RIGHT - this.m_halfWidth)){
this.m_posX = (World.BORDER_RIGHT - this.m_halfWidth);
};
};
};
updatePosition();
}
private function animateFlash():void{
if (m_isAnimatingFlashIn){
this.m_glowStrength = (this.m_glowStrength + 0.1);
this.setDynamicGlow(this.m_glowStrength);
if (this.m_glowStrength > 3){
this.m_isAnimatingFlashIn = false;
this.m_isAnimatingFlashOut = true;
};
} else {
if (m_isAnimatingFlashOut){
this.m_glowStrength = (this.m_glowStrength - 0.1);
this.setDynamicGlow(this.m_glowStrength);
if (this.m_glowStrength <= 1){
this.setDynamicGlow(this.m_glowStrength);
this.m_isAnimatingFlashOut = false;
};
};
};
}
private function animateHighlight():void{
var _local1:int;
var _local2:ColorTransform;
if (m_isAnimatingHighlight){
_local2 = this.transform.colorTransform;
if (this.m_currentGreenValue < this.m_targetGreenValue){
_local1 = 32;
this.m_currentGreenValue = (this.m_currentGreenValue + _local1);
_local2.blueOffset = (_local2.blueOffset - _local1);
_local2.redOffset = (_local2.redOffset - _local1);
} else {
if (this.m_currentGreenValue > this.m_targetGreenValue){
_local1 = 8;
this.m_currentGreenValue = (this.m_currentGreenValue - _local1);
_local2.blueOffset = (_local2.blueOffset + _local1);
_local2.redOffset = (_local2.redOffset + _local1);
} else {
this.m_currentGreenValue = this.m_targetGreenValue;
this.m_isAnimatingHighlight = false;
};
};
this.transform.colorTransform = _local2;
};
}
private function accelerateX(_arg1:Direction):void{
this.m_direction = _arg1;
if (this.m_speedX < this.m_maxSpeed){
this.m_speedX = (this.m_speedX + ACCELERATION);
};
}
private function checkKeys():void{
if (((Key.isDown(Keyboard.LEFT)) || (Key.isDown(65)))){
this.accelerateX(Direction.LEFT);
} else {
if (((Key.isDown(Keyboard.RIGHT)) || (Key.isDown(68)))){
this.accelerateX(Direction.RIGHT);
} else {
this.decelerateX();
};
};
}
private function decelerateX():void{
if (this.m_speedX > 0){
this.m_speedX = (this.m_speedX - ACCELERATION);
};
}
public function setStartPosition():void{
this.m_posX = (World.BORDER_RIGHT / 2);
this.m_posY = World.START_POS_Y;
updatePosition();
this.m_speedX = 0;
}
public function flash():void{
this.m_glowStrength = 2;
this.m_isAnimatingFlashIn = true;
}
public function setHighlight(_arg1:Boolean):void{
this.m_isAutoSlow = _arg1;
if (_arg1){
setTransform();
} else {
unsetTransform();
};
}
public function resetSize():void{
this.m_currentWidth = this.m_defaultWidth;
setSize(this.m_defaultWidth, this.m_defaultHeight);
draw();
}
public function doEveryFrame():void{
checkKeys();
move();
animateHighlight();
animateFlash();
}
}
}//package de.pixelate.mrbounce.game
Section 39
//Particle (de.pixelate.mrbounce.game.Particle)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.base.*;
import flash.events.*;
import de.pixelate.mrbounce.level.*;
public class Particle extends MovableSprite {
public function Particle(_arg1:Number, _arg2:Number, _arg3:uint){
this.m_width = 1;
this.m_height = 1;
this.m_color = _arg3;
this.x = _arg1;
this.y = _arg2;
var _local4:int = (((Math.random() * 4) + 4) * World.FRAMERATE_FACTOR);
this.m_speedX = (((Math.random() * 2) - 1) * _local4);
this.m_speedY = (((Math.random() * 2) - 1) * _local4);
draw();
}
private function move():void{
var _local1:Number = LevelDataHolder.me().getSlowmo();
this.x = (this.x + (this.m_speedX * _local1));
this.y = (this.y + (this.m_speedY * _local1));
this.alpha = (this.alpha - (0.01 * _local1));
if ((((((((((this.x < World.BORDER_LEFT)) || ((this.x > World.BORDER_RIGHT)))) || ((this.y < World.BORDER_TOP)))) || ((this.y > World.BORDER_BOTTOM)))) || ((this.alpha <= 0)))){
destroy();
};
}
public function explode():void{
addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
}
override public function destroy():void{
super.destroy();
if (hasEventListener(Event.ENTER_FRAME)){
removeEventListener(Event.ENTER_FRAME, onEnterFrame);
};
}
private function onEnterFrame(_arg1:Event):void{
if (!GameState.isGamePaused){
move();
};
}
private function draw():void{
this.graphics.clear();
this.graphics.beginFill(this.m_color, 100);
this.graphics.drawRect(0, 0, m_width, m_height);
this.graphics.endFill();
}
}
}//package de.pixelate.mrbounce.game
Section 40
//ParticleContainer (de.pixelate.mrbounce.game.ParticleContainer)
package de.pixelate.mrbounce.game {
import flash.display.*;
public class ParticleContainer extends Sprite {
private static var instance:ParticleContainer = new (ParticleContainer);
;
public function ParticleContainer(){
if (instance){
throw (new Error("Singleton and can only be accessed through Singleton.me()"));
};
}
public static function me():ParticleContainer{
return (instance);
}
public static function createParticles(_arg1:Number, _arg2:Number, _arg3:int, _arg4:uint):void{
var _local6:Particle;
var _local5:int;
while (_local5 <= _arg3) {
_local6 = new Particle(_arg1, _arg2, _arg4);
me().addChild(_local6);
_local6.explode();
_local5++;
};
}
public static function clear():void{
var _local3:Particle;
var _local1:int = me().numChildren;
var _local2:int = (_local1 - 1);
while (_local2 >= 0) {
_local3 = Particle(me().getChildAt(_local2));
_local3.destroy();
_local2--;
};
}
}
}//package de.pixelate.mrbounce.game
Section 41
//Path (de.pixelate.mrbounce.game.Path)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.utilities.*;
import flash.geom.*;
import flash.display.*;
public class Path extends Sprite {
private var m_pathElements:Array;
public function Path(){
this.m_pathElements = new Array();
}
public function getPathElements():Array{
return (this.m_pathElements);
}
public function getCompletePath(_arg1:int):Array{
var _local7:Point;
var _local8:Point;
var _local9:Point;
var _local10:Number;
var _local11:Array;
var _local12:int;
var _local13:int;
var _local2:int = this.m_pathElements.length;
var _local3:Array = new Array();
var _local4:int;
var _local5 = 20;
var _local6:int = _arg1;
while (_local6 < _local2) {
_local7 = this.m_pathElements[_local6].getP1();
_local8 = this.m_pathElements[_local6].getP2();
_local9 = this.m_pathElements[_local6].getPC();
_local10 = this.m_pathElements[_local6].getSpeed();
_local4 = (_local4 + 4);
if (_local4 > _local5){
_local4 = _local5;
};
_local11 = PathUtil.getBezierPath(_local7, _local8, _local9, (_local10 + _local4));
_local12 = _local11.length;
_local13 = 0;
while (_local13 < _local12) {
_local3.push(_local11[_local13]);
_local13++;
};
_local6++;
};
return (_local3);
}
public function getVelocityY():Number{
var _local1:int = (this.m_pathElements.length - 1);
return (this.m_pathElements[_local1].getVelocityY());
}
public function setEditable(_arg1:Boolean):void{
var _local2:int = this.m_pathElements.length;
var _local3:int;
while (_local3 < _local2) {
this.m_pathElements[_local3].setEditable(_arg1, false);
_local3++;
};
}
public function getVelocityX():Number{
var _local1:int = (this.m_pathElements.length - 1);
return (this.m_pathElements[_local1].getVelocityX());
}
public function insertPathElement(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Boolean, _arg5:Boolean):void{
var _local6:PathElement = new PathElement(_arg1, _arg2, _arg3, _arg4);
this.m_pathElements.push(_local6);
var _local7:int = (this.m_pathElements.length - 1);
this.addChild(this.m_pathElements[_local7]);
this.m_pathElements[_local7].setEditable(_arg5, false);
}
}
}//package de.pixelate.mrbounce.game
Section 42
//PathElement (de.pixelate.mrbounce.game.PathElement)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.base.*;
import flash.events.*;
import de.pixelate.mrbounce.utilities.*;
import flash.geom.*;
import flash.display.*;
import flash.ui.*;
import de.pixelate.mrbounce.editor.*;
import com.senocular.drawing.*;
public class PathElement extends EditableSprite {
private var m_anchor1:EditorBezierToolDrag;
private var m_anchor2:EditorBezierToolDrag;
private var m_control:EditorBezierToolDrag;
private var m_angleInRadians:Number;
private var m_pt1:Point;
private var m_pt2:Point;
private var m_hasAccessPoint:Boolean;
private var m_hitSprite:Sprite;
private var m_ptC:Point;
private static const HIT_SPRITE_SIZE:Number = 8;
private static const SPEED:Number = 5;
public function PathElement(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Boolean){
this.m_pt1 = _arg1;
this.m_pt2 = _arg2;
this.m_ptC = _arg3;
this.m_hasAccessPoint = _arg4;
this.m_color = 0xFFFF;
calculateAngle();
drawAccessPoint();
createHandles();
draw();
setGlow(4);
}
public function getHitSprite():Sprite{
return (this.m_hitSprite);
}
private function draw():void{
var _local1:DashedLine = new DashedLine(this, 3, 6);
_local1.clear();
_local1.lineStyle(1, this.m_color, 1);
_local1.moveTo(this.m_pt1.x, this.m_pt1.y);
_local1.curveTo(this.m_ptC.x, this.m_ptC.y, this.m_pt2.x, this.m_pt2.y);
if (this.m_hasAccessPoint){
this.m_hitSprite.x = this.m_pt1.x;
this.m_hitSprite.y = this.m_pt1.y;
};
}
private function createHandles():void{
this.m_anchor1 = new EditorBezierToolDrag(this.m_pt1.x, this.m_pt1.y);
this.m_anchor2 = new EditorBezierToolDrag(this.m_pt2.x, this.m_pt2.y);
this.m_control = new EditorBezierToolDrag(this.m_ptC.x, this.m_ptC.y);
this.addChild(this.m_anchor1);
this.addChild(this.m_anchor2);
this.addChild(this.m_control);
this.m_anchor1.init();
this.m_anchor2.init();
this.m_control.init();
}
public function getPC():Point{
return (this.m_ptC);
}
private function calculateAngle():void{
var _local1:Array = PathUtil.getBezierPath(this.m_pt1, this.m_pt2, this.m_ptC, SPEED);
var _local2:int = (_local1.length - 1);
var _local3:Point = _local1[_local2];
var _local4:Point = _local1[(_local2 - 1)];
var _local5:Number = Math.round((_local4.x - _local3.x));
var _local6:Number = Math.round((_local4.y - _local3.y));
this.m_angleInRadians = Math.atan2(_local6, _local5);
}
private function linearize():void{
this.m_ptC = Point.interpolate(this.m_pt1, this.m_pt2, 0.5);
this.m_control.x = this.m_ptC.x;
this.m_control.y = this.m_ptC.y;
}
public function getSpeed():Number{
return (SPEED);
}
public function hasAccessPoint():Boolean{
return (this.m_hasAccessPoint);
}
private function updatePositions():void{
this.m_pt1 = new Point(this.m_anchor1.x, this.m_anchor1.y);
this.m_pt2 = new Point(this.m_anchor2.x, this.m_anchor2.y);
this.m_ptC = new Point(this.m_control.x, this.m_control.y);
}
public function getVelocityX():Number{
var _local1:Number = (Math.cos(this.m_angleInRadians) * -(SPEED));
return (_local1);
}
private function drawAccessPoint():void{
if (this.m_hasAccessPoint){
this.m_hitSprite = new Sprite();
this.m_hitSprite.graphics.clear();
this.m_hitSprite.graphics.beginFill(this.m_color, 0.5);
this.m_hitSprite.graphics.drawCircle(0, 0, HIT_SPRITE_SIZE);
this.m_hitSprite.graphics.endFill();
this.m_hitSprite.x = this.m_pt1.x;
this.m_hitSprite.y = this.m_pt1.y;
this.addChild(this.m_hitSprite);
};
}
private function onKeyDown(_arg1:KeyboardEvent):void{
if (this.m_isSelected){
if (_arg1.keyCode == Keyboard.SHIFT){
this.linearize();
};
};
}
private function onEnterFrame(_arg1:Event):void{
this.updatePositions();
this.calculateAngle();
this.draw();
}
override public function setEditable(_arg1:Boolean, _arg2:Boolean):void{
super.setEditable(_arg1, _arg2);
this.m_anchor1.visible = _arg1;
this.m_anchor2.visible = _arg1;
this.m_control.visible = _arg1;
if (_arg1){
this.addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
StageHelper.getStage().addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown, false, 0, true);
} else {
if (this.hasEventListener(Event.ENTER_FRAME)){
this.addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
};
if (StageHelper.getStage() != null){
if (StageHelper.getStage().hasEventListener(KeyboardEvent.KEY_DOWN)){
StageHelper.getStage().removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
};
};
};
}
public function getP1():Point{
return (this.m_pt1);
}
public function getP2():Point{
return (this.m_pt2);
}
public function getVelocityY():Number{
var _local1:Number = (Math.sin(this.m_angleInRadians) * SPEED);
return (_local1);
}
}
}//package de.pixelate.mrbounce.game
Section 43
//Peek (de.pixelate.mrbounce.game.Peek)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.base.*;
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.utilities.*;
import de.pixelate.mrbounce.tutorial.*;
import flash.ui.*;
public class Peek extends MovableSprite {
public function Peek(){
setSize(World.BORDER_RIGHT, 2);
setStartPosition();
this.m_color = 0xFFFFFF;
this.m_speedY = (4 * World.FRAMERATE_FACTOR);
draw();
setGlow();
}
private function moveDown():void{
this.y = (this.y + this.m_speedY);
if (this.y > (World.SAFE_BOTTOM - 50)){
this.y = (World.SAFE_BOTTOM - 50);
} else {
Tutorial.me().increaseDistanceMovedVertical(this.m_speedY);
};
}
private function draw():void{
this.graphics.clear();
this.graphics.lineStyle(1, 0, 0);
this.graphics.beginFill(this.m_color, 1);
var _local1:Number = 3;
var _local2:Number = 1;
var _local3:Number = 1;
var _local4:Number = 0;
var _local5:Number = 0;
do {
this.graphics.drawRect(_local4, _local5, _local2, _local3);
_local4 = (_local4 + (_local2 + _local1));
} while (_local4 < (World.BORDER_RIGHT + _local2));
this.graphics.endFill();
}
public function setStartPosition():void{
this.y = (World.SAFE_BOTTOM - 50);
}
private function moveUp():void{
this.y = (this.y - this.m_speedY);
if (this.y < (World.SAFE_TOP - 25)){
this.y = (World.SAFE_TOP - 25);
} else {
Tutorial.me().increaseDistanceMovedVertical(this.m_speedY);
};
}
private function checkKeys():void{
if (((Key.isDown(Keyboard.UP)) || (Key.isDown(87)))){
moveUp();
} else {
if (((Key.isDown(Keyboard.DOWN)) || (Key.isDown(83)))){
moveDown();
};
};
}
public function doEveryFrame():void{
checkKeys();
}
}
}//package de.pixelate.mrbounce.game
Section 44
//Projection (de.pixelate.mrbounce.game.Projection)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.level.*;
import flash.display.*;
public class Projection extends Sprite {
public function draw(_arg1:Array):void{
var _local5:Number;
var _local6:Number;
this.graphics.clear();
var _local2:int = _arg1.length;
var _local3:Number = World.BORDER_BOTTOM;
var _local4:int;
while (_local4 < _local2) {
_local5 = _arg1[_local4].x;
_local6 = _arg1[_local4].y;
if (_local6 < _local3){
_local3 = _local6;
};
this.graphics.beginFill(0xFFFFFF);
this.graphics.drawRect(_local5, _local6, 1, 1);
_local4++;
};
}
public function clear():void{
this.graphics.clear();
}
}
}//package de.pixelate.mrbounce.game
Section 45
//Score (de.pixelate.mrbounce.game.Score)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.events.*;
import flash.events.*;
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.utilities.*;
import com.miniclip.highscores.*;
public final class Score extends EventDispatcher {
private var m_score:int;
private var m_easyBadgeReached:Boolean;
private var m_supremacyReached:Boolean;
private var m_submittedScore:int;
private var m_mediumBadgeReached:Boolean;
private var m_scoreLives:int;
private static const EASY_BADGE:int = 10000;
private static const MEDIUM_BADGE:int = 50000;
private static const SUPREMACY:int = 160950;
private static var instance:Score = new (Score);
;
public function Score(){
if (instance){
throw (new Error("Singleton and can only be accessed through Singleton.me()"));
};
this.m_score = 0;
this.m_submittedScore = 0;
this.m_easyBadgeReached = false;
this.m_mediumBadgeReached = false;
}
public function resetScore():void{
this.m_score = 0;
this.m_submittedScore = 0;
this.m_scoreLives = 0;
this.m_easyBadgeReached = false;
this.m_mediumBadgeReached = false;
}
private function submitScoreToMiniclip():void{
var _local1:HighscoresLoader = HighscoresLoader.start(StageHelper.getStage(), m_score);
}
public function gameOver():void{
submitScoreToMiniclip();
}
public function addScore(_arg1:int):void{
var _local2:int;
this.m_score = (this.m_score + _arg1);
this.m_scoreLives = (this.m_scoreLives + _arg1);
if (this.m_scoreLives >= World.EXTRALIFE_AT_SCORE){
_local2 = Math.floor((this.m_scoreLives / World.EXTRALIFE_AT_SCORE));
this.dispatchEvent(new ExtraLifeEvent(_local2));
this.m_scoreLives = (this.m_scoreLives - (World.EXTRALIFE_AT_SCORE * _local2));
};
this.dispatchEvent(new ScoreEvent(this.m_score));
}
public function gameCompleted():void{
submitScoreToMiniclip();
}
public function getScore():int{
return (m_score);
}
public function completedLevel():void{
}
public static function me():Score{
return (instance);
}
}
}//package de.pixelate.mrbounce.game
Section 46
//Star (de.pixelate.mrbounce.game.Star)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.enumerations.*;
public class Star {
private var m_speedFactor:Number;
private var m_type:int;
private var m_direction:Direction;
private var m_xPos:Number;
private var m_color:uint;
private var m_yPos:Number;
public function Star(_arg1:Direction, _arg2:Number, _arg3:Number){
this.m_direction = _arg1;
if (_arg1 == Direction.RIGHT){
this.m_xPos = ((Math.random() * World.BORDER_RIGHT) * -1);
} else {
if (_arg1 == Direction.LEFT){
this.m_xPos = (World.BORDER_RIGHT + (Math.random() * World.BORDER_RIGHT));
};
};
this.m_yPos = (Math.random() * _arg3);
this.m_type = Math.round((Math.random() * 2));
if (this.m_type == 0){
this.m_speedFactor = 0.5;
this.m_color = 4737131;
} else {
if (this.m_type == 1){
this.m_speedFactor = 0.7;
this.m_color = 9408419;
} else {
if (this.m_type == 2){
this.m_speedFactor = 0.9;
this.m_color = 12500681;
};
};
};
}
public function scroll(_arg1:Number):void{
this.m_xPos = (this.m_xPos + (_arg1 * this.m_speedFactor));
}
public function getPosX():Number{
return (this.m_xPos);
}
public function getColor():uint{
return (this.m_color);
}
public function setOffset(_arg1:Number):void{
if (this.m_direction == Direction.LEFT){
scroll(-(_arg1));
} else {
if (this.m_direction == Direction.RIGHT){
scroll(_arg1);
};
};
}
public function getPosY():Number{
return (this.m_yPos);
}
}
}//package de.pixelate.mrbounce.game
Section 47
//Tail (de.pixelate.mrbounce.game.Tail)
package de.pixelate.mrbounce.game {
import flash.display.*;
import de.polygonal.ds.*;
public class Tail extends Sprite {
private var m_que:ArrayedQueue;
public function Tail(){
this.m_que = new ArrayedQueue(4);
}
private function dequeue():void{
if (m_que.size == 0){
return;
};
var _local1:Sprite = m_que.dequeue();
removeChild(_local1);
m_que.dispose();
draw();
}
private function draw():void{
var _local2:Sprite;
var _local1:int;
while (_local1 < m_que.size) {
_local2 = m_que.getAt(_local1);
_local2.alpha = (_local1 / m_que.size);
_local1++;
};
}
private function drawNode(_arg1:Sprite):void{
_arg1.graphics.clear();
_arg1.graphics.beginFill(0xFFFFFF, 1);
_arg1.graphics.drawCircle(0, 0, 2);
_arg1.graphics.endFill();
}
public function enqueue(_arg1:Number, _arg2:Number):void{
var _local3:Sprite;
if (m_que.size == 16){
dequeue();
return;
};
_local3 = new Sprite();
_local3.x = _arg1;
_local3.y = _arg2;
addChild(_local3);
drawNode(_local3);
m_que.enqueue(_local3);
draw();
}
public function clear():void{
do {
dequeue();
} while (m_que.size > 0);
}
}
}//package de.pixelate.mrbounce.game
Section 48
//Wind (de.pixelate.mrbounce.game.Wind)
package de.pixelate.mrbounce.game {
import de.pixelate.mrbounce.base.*;
import de.pixelate.mrbounce.level.*;
import flash.geom.*;
import de.pixelate.mrbounce.enumerations.*;
public class Wind extends BasicSprite {
private const ELEMENT_WIDTH:Number = 10;
private const ELEMENT_HEIGHT:Number = 1;
private var m_starList:Array;
private var m_numOfTotalStars:int;
private var m_direction:Direction;
private var m_speed:Number;
private var m_rect:Rectangle;
public function Wind(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Direction, _arg6:Number){
this.m_starList = new Array();
setSize(_arg3, _arg4);
this.x = _arg1;
this.y = _arg2;
this.m_direction = _arg5;
if (this.m_direction == Direction.LEFT){
this.m_speed = -(_arg6);
} else {
this.m_speed = _arg6;
};
(this.m_speed * World.FRAMERATE_FACTOR);
this.m_numOfTotalStars = 150;
var _local7:int;
while (_local7 < this.m_numOfTotalStars) {
this.m_starList.push(new Star(this.m_direction, _arg3, _arg4));
this.m_starList[_local7].setOffset((World.BORDER_RIGHT + 50));
_local7++;
};
draw();
}
public function getDirection():Direction{
return (this.m_direction);
}
private function draw():void{
var _local1:Star;
var _local2:Rectangle;
this.graphics.clear();
for each (_local1 in this.m_starList) {
_local2 = new Rectangle(_local1.getPosX(), _local1.getPosY(), ELEMENT_WIDTH, ELEMENT_HEIGHT);
if ((((_local2.right > World.BORDER_LEFT)) && ((_local2.left < World.BORDER_RIGHT)))){
this.graphics.beginFill(_local1.getColor());
this.graphics.drawRect(_local2.x, _local2.y, _local2.width, _local2.height);
this.graphics.endFill();
};
};
}
public function getSpeed():Number{
return (this.m_speed);
}
public function scroll():void{
var _local1:int;
while (_local1 < this.m_numOfTotalStars) {
this.m_starList[_local1].scroll(this.m_speed);
if (this.m_direction == Direction.RIGHT){
if (this.m_starList[_local1].getPosX() > World.BORDER_RIGHT){
(this.m_starList[_local1] == null);
this.m_starList[_local1] = new Star(this.m_direction, this.m_width, this.m_height);
};
} else {
if (this.m_direction == Direction.LEFT){
if ((this.m_starList[_local1].getPosX() + ELEMENT_WIDTH) < World.BORDER_LEFT){
(this.m_starList[_local1] == null);
this.m_starList[_local1] = new Star(this.m_direction, this.m_width, this.m_height);
};
};
};
_local1++;
};
this.draw();
}
}
}//package de.pixelate.mrbounce.game
Section 49
//Vector (de.pixelate.mrbounce.geometry.Vector)
package de.pixelate.mrbounce.geometry {
import flash.geom.*;
public class Vector {
public var r:Number;
public var sx:Number;
public var bx:Number;
public var by:Number;
public var sy:Number;
public function Vector(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number){
sx = _arg1;
sy = _arg2;
bx = (_arg3 - _arg1);
by = (_arg4 - _arg2);
r = Math.sqrt(((bx * bx) + (by * by)));
}
public static function getLineIntersection(_arg1:Vector, _arg2:Vector):Point{
var _local3:Number = (_arg1.by / _arg1.bx);
var _local4:Number = (_arg1.sy - (_local3 * _arg1.sx));
var _local5:Number = (_arg2.by / _arg2.bx);
var _local6:Number = (_arg2.sy - (_local5 * _arg2.sx));
var _local7:Number = ((_local6 - _local4) / (_local3 - _local5));
var _local8:Number = ((_local3 * _local7) + _local4);
return (new Point(_local7, _local8));
}
}
}//package de.pixelate.mrbounce.geometry
Section 50
//BlockerData (de.pixelate.mrbounce.level.BlockerData)
package de.pixelate.mrbounce.level {
public class BlockerData {
public var posX:Number;
public var posY:Number;
public var width:Number;
public var isMovable:Boolean;
public function BlockerData(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Boolean){
this.posX = _arg1;
this.posY = _arg2;
this.width = _arg3;
this.isMovable = _arg4;
}
}
}//package de.pixelate.mrbounce.level
Section 51
//BonusData (de.pixelate.mrbounce.level.BonusData)
package de.pixelate.mrbounce.level {
import de.pixelate.mrbounce.enumerations.*;
public class BonusData {
public var size:Number;
public var posX:Number;
public var posY:Number;
public var colorType:ColorType;
public function BonusData(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:ColorType){
this.posX = _arg1;
this.posY = _arg2;
this.size = _arg3;
this.colorType = _arg4;
}
}
}//package de.pixelate.mrbounce.level
Section 52
//BouncerData (de.pixelate.mrbounce.level.BouncerData)
package de.pixelate.mrbounce.level {
public class BouncerData {
public var isMovable:Boolean;
public var posY:Number;
public var width:Number;
public var height:Number;
public var isDestroyable:Boolean;
public var posX:Number;
public var hasUpSide:Boolean;
public var hasLeftSide:Boolean;
public var hasRightSide:Boolean;
public var hasDownSide:Boolean;
public function BouncerData(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Boolean, _arg6:Boolean, _arg7:Boolean, _arg8:Boolean, _arg9:Boolean, _arg10:Boolean){
this.posX = _arg1;
this.posY = _arg2;
this.width = _arg3;
this.height = _arg4;
this.isDestroyable = _arg5;
this.isMovable = _arg6;
this.hasLeftSide = _arg7;
this.hasUpSide = _arg8;
this.hasRightSide = _arg9;
this.hasDownSide = _arg10;
}
}
}//package de.pixelate.mrbounce.level
Section 53
//Level (de.pixelate.mrbounce.level.Level)
package de.pixelate.mrbounce.level {
public class Level {
private var m_blockerList:Array;
private var m_bonusList:Array;
private var m_pathList:Array;
private var m_windList:Array;
private var m_speed:Number;
private var m_bouncerList:Array;
public function Level(_arg1:Array, _arg2:Array, _arg3:Array, _arg4:Array, _arg5:Array, _arg6:Number){
this.m_bonusList = _arg1;
this.m_blockerList = _arg2;
this.m_bouncerList = _arg3;
this.m_windList = _arg4;
this.m_pathList = _arg5;
this.m_speed = (_arg6 * World.FRAMERATE_FACTOR);
}
public function getSpeed():Number{
return (this.m_speed);
}
public function getBlockerList():Array{
return (this.m_blockerList);
}
public function getWindList():Array{
return (this.m_windList);
}
public function setSpeed(_arg1:Number):void{
this.m_speed = (_arg1 * World.FRAMERATE_FACTOR);
}
public function getBonusList():Array{
return (this.m_bonusList);
}
public function getBouncerList():Array{
return (this.m_bouncerList);
}
public function getPathList():Array{
return (this.m_pathList);
}
}
}//package de.pixelate.mrbounce.level
Section 54
//LevelDataHolder (de.pixelate.mrbounce.level.LevelDataHolder)
package de.pixelate.mrbounce.level {
import de.pixelate.mrbounce.events.*;
import flash.events.*;
import de.pixelate.mrbounce.sound.*;
import de.pixelate.mrbounce.utilities.*;
public final class LevelDataHolder extends EventDispatcher {
private var startStage:int;
private var currentStage:int;
private var currentLevel:int;
private var m_slowmo:Number;
private var stages:Array;
private static var instance:LevelDataHolder = new (LevelDataHolder);
;
public function LevelDataHolder(){
if (instance){
throw (new Error("Singleton and can only be accessed through Singleton.me()"));
};
this.stages = new Array();
this.stages[0] = new Array();
this.stages[0][0] = new Level(new Array(), new Array(), new Array(), new Array(), new Array(), 0.2);
disableSlowmo();
}
public function getCurrentLevel():Level{
return (stages[currentStage][currentLevel]);
}
public function isLastLevel(_arg1:Boolean=false):Boolean{
var _local2:int = this.currentLevel;
if (_arg1){
_local2++;
};
if ((((this.currentStage == (stages.length - 1))) && ((_local2 == 4)))){
return (true);
};
return (false);
}
public function enableSlowmo():void{
this.m_slowmo = 0.05;
}
public function setNextStage():void{
this.currentLevel = 0;
this.currentStage++;
if (this.currentStage >= stages.length){
this.currentStage = 1;
} else {
PlayerStats.getInstance().highestStage = this.currentStage;
};
}
public function goPreviousLevel():void{
this.currentLevel--;
if (this.currentLevel < 0){
LevelDataHolder.me().setPreviousStage();
};
this.dispatchEvent(new LevelEvent(LevelEvent.CHANGE));
SoundControl.me().playBackgroundLoop();
}
public function reset():void{
this.currentStage = this.startStage;
this.currentLevel = 0;
this.disableSlowmo();
}
public function goNextLevel():void{
this.currentLevel++;
if (this.currentLevel >= stages[currentStage].length){
LevelDataHolder.me().setNextStage();
};
this.dispatchEvent(new LevelEvent(LevelEvent.CHANGE));
SoundControl.me().playBackgroundLoop();
}
public function setPreviousStage():void{
this.currentStage--;
if (this.currentStage < 1){
this.currentStage = (stages.length - 1);
};
this.currentLevel = (this.stages[currentStage].length - 1);
}
public function init():void{
reset();
this.dispatchEvent(new LevelEvent(LevelEvent.CHANGE));
}
public function dispatchLevelClearedEvent():void{
this.dispatchEvent(new LevelEvent(LevelEvent.CLEARED));
}
public function getSlowmo():Number{
return (this.m_slowmo);
}
public function addStage():void{
var _local1:int = stages.length;
stages[_local1] = new Array();
this.currentStage = _local1;
}
public function isLastLevelOfWorld():Boolean{
if (this.currentLevel == 3){
return (true);
};
return (false);
}
public function selectStartStage(_arg1:int):void{
this.startStage = _arg1;
}
public function addLevel(_arg1:Level):void{
stages[currentStage].push(_arg1);
}
public function setNextLevel():void{
this.currentLevel++;
if ((((this.currentLevel >= stages[currentStage].length)) && ((this.currentStage < (stages.length - 1))))){
setNextStage();
};
}
public function getCurrentLevelId():int{
return (this.currentLevel);
}
public function selectTutorialLevel():void{
this.startStage = 1;
this.currentStage = 0;
this.currentLevel = 0;
this.disableSlowmo();
this.dispatchEvent(new LevelEvent(LevelEvent.CHANGE));
}
public function disableSlowmo():void{
this.m_slowmo = 1;
}
public function getCurrentStageId():int{
return (this.currentStage);
}
public static function me():LevelDataHolder{
return (instance);
}
}
}//package de.pixelate.mrbounce.level
Section 55
//LevelUtil (de.pixelate.mrbounce.level.LevelUtil)
package de.pixelate.mrbounce.level {
import flash.geom.*;
import de.pixelate.mrbounce.enumerations.*;
public class LevelUtil {
private static function getPathList(_arg1:XMLList):Array{
var _local3:XML;
var _local2:Array = new Array();
for each (_local3 in _arg1.item) {
if (_local3.@type == "path"){
_local2.push(getPathElementList(_local3));
};
};
return (_local2);
}
private static function getBouncerList(_arg1:XMLList):Array{
var _local3:XML;
var _local4:Boolean;
var _local5:Boolean;
var _local6:Boolean;
var _local7:Boolean;
var _local8:Boolean;
var _local9:Boolean;
var _local10:BouncerData;
var _local2:Array = new Array();
for each (_local3 in _arg1.item) {
if (_local3.@type == "bouncer"){
_local4 = LevelUtil.convertStringToBoolean(_local3.@isMovable);
_local5 = LevelUtil.convertStringToBoolean(_local3.@isDestroyable);
_local6 = LevelUtil.convertStringToBoolean(_local3.@hasLeftSide);
_local7 = LevelUtil.convertStringToBoolean(_local3.@hasUpSide);
_local8 = LevelUtil.convertStringToBoolean(_local3.@hasRightSide);
_local9 = LevelUtil.convertStringToBoolean(_local3.@hasDownSide);
_local10 = new BouncerData(_local3.@x, _local3.@y, _local3.@width, _local3.@height, _local4, _local5, _local6, _local7, _local8, _local9);
_local2.push(_local10);
};
};
return (_local2);
}
private static function getBlockerList(_arg1:XMLList):Array{
var _local3:XML;
var _local4:BlockerData;
var _local2:Array = new Array();
for each (_local3 in _arg1.item) {
if (_local3.@type == "blocker"){
_local4 = new BlockerData(_local3.@x, _local3.@y, _local3.@width, convertStringToBoolean(_local3.@isMovable));
_local2.push(_local4);
};
};
return (_local2);
}
public static function getBezier(_arg1:Number, _arg2:Number, _arg3:Number, _arg4:Number, _arg5:Number, _arg6:Number, _arg7:int):Array{
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local14:Number;
var _local15:Number;
var _local18:Point;
var _local8:Array = new Array();
var _local16:Number = 0;
var _local17:Number = (1 / (_arg7 - 1));
while (_local16 < 1) {
_local11 = (((((1 - _local16) * (1 - _local16)) * _arg1) + (((2 * _local16) * (1 - _local16)) * _arg5)) + ((_local16 * _local16) * _arg3));
_local12 = (((((1 - _local16) * (1 - _local16)) * _arg2) + (((2 * _local16) * (1 - _local16)) * _arg6)) + ((_local16 * _local16) * _arg4));
_local13 = ((((2 * _local16) * ((_arg1 - (2 * _arg5)) + _arg3)) - (2 * _arg1)) + (2 * _arg5));
_local14 = ((((2 * _local16) * ((_arg2 - (2 * _arg6)) + _arg4)) - (2 * _arg2)) + (2 * _arg6));
_local15 = Math.sqrt(((_local13 * _local13) + (_local14 * _local14)));
_local18 = new Point(_local11, _local12);
_local8.push(_local18);
_local16 = (_local16 + _local17);
};
return (_local8);
}
private static function getBonusList(_arg1:XMLList):Array{
var _local3:XML;
var _local4:ColorType;
var _local5:BonusData;
var _local2:Array = new Array();
for each (_local3 in _arg1.item) {
if (_local3.@type == "bonus"){
_local4 = ColorType.fromName(_local3.@color);
_local5 = new BonusData(_local3.@x, _local3.@y, _local3.@size, _local4);
_local2.push(_local5);
};
};
return (_local2);
}
private static function convertStringToBoolean(_arg1:String):Boolean{
if (_arg1 == "true"){
return (true);
};
return (false);
}
public static function createLevels():void{
var _local3:int;
var _local4:int;
var _local5:XML;
var _local6:Array;
var _local7:Array;
var _local8:Array;
var _local9:Array;
var _local10:Array;
var _local11:Number;
var _local12:Level;
var _local1:int = XMLList(XmlData.me().game.stage).length();
var _local2:int;
while (_local2 < _local1) {
LevelDataHolder.me().addStage();
_local3 = XMLList(XmlData.me().game.stage[_local2].level).length();
_local4 = 0;
while (_local4 < _local3) {
_local5 = XmlData.me().game.stage[_local2].level[_local4];
_local6 = getBonusList(_local5.items);
_local7 = getBlockerList(_local5.items);
_local8 = getBouncerList(_local5.items);
_local9 = getWindList(_local5.items);
_local10 = getPathList(_local5.items);
_local11 = Number(_local5.@speed);
_local12 = new Level(_local6, _local7, _local8, _local9, _local10, _local11);
LevelDataHolder.me().addLevel(_local12);
_local4++;
};
_local2++;
};
}
private static function getWindList(_arg1:XMLList):Array{
var _local3:XML;
var _local4:Direction;
var _local5:WindData;
var _local2:Array = new Array();
for each (_local3 in _arg1.item) {
if (_local3.@type == "wind"){
_local4 = Direction.fromName(_local3.@direction);
_local5 = new WindData(_local3.@y, _local3.@height, _local4, _local3.@speed);
_local2.push(_local5);
};
};
return (_local2);
}
private static function getPathElementList(_arg1:XML):Array{
var _local3:XML;
var _local4:Point;
var _local5:Point;
var _local6:Point;
var _local7:Boolean;
var _local8:PathData;
var _local2:Array = new Array();
for each (_local3 in _arg1.pathelement) {
_local4 = new Point(_local3.@x1, _local3.@y1);
_local5 = new Point(_local3.@x2, _local3.@y2);
_local6 = new Point(_local3.@xC, _local3.@yC);
_local7 = LevelUtil.convertStringToBoolean(_local3.@hasAccessPoint);
_local8 = new PathData(_local4, _local5, _local6, _local7);
_local2.push(_local8);
};
return (_local2);
}
}
}//package de.pixelate.mrbounce.level
Section 56
//PathData (de.pixelate.mrbounce.level.PathData)
package de.pixelate.mrbounce.level {
import flash.geom.*;
public class PathData {
public var p1:Point;
public var pC:Point;
public var p2:Point;
public var hasAccessPoint:Boolean;
public function PathData(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Boolean){
this.p1 = _arg1;
this.p2 = _arg2;
this.pC = _arg3;
this.hasAccessPoint = _arg4;
}
}
}//package de.pixelate.mrbounce.level
Section 57
//WindData (de.pixelate.mrbounce.level.WindData)
package de.pixelate.mrbounce.level {
import de.pixelate.mrbounce.enumerations.*;
public class WindData {
public var posY:Number;
public var speed:Number;
public var height:Number;
public var direction:Direction;
public function WindData(_arg1:Number, _arg2:Number, _arg3:Direction, _arg4:Number){
this.posY = _arg1;
this.height = _arg2;
this.direction = _arg3;
this.speed = _arg4;
}
}
}//package de.pixelate.mrbounce.level
Section 58
//World (de.pixelate.mrbounce.level.World)
package de.pixelate.mrbounce.level {
public class World {
public static const SAFE_TOP:Number = (BORDER_TOP + 60);
public static const BORDER_LEFT:Number = 0;
public static const SAFE_RIGHT:Number = 440;
public static const GRID:int = 30;
public static const BORDER_TOP:Number = 0;
public static const START_POS_Y:Number = 460;
public static const EXTRALIFE_AT_SCORE:int = 20000;
public static const FRAMERATE_STAGE:Number = 50;
public static const SAFE_BOTTOM:Number = 420;
public static const BORDER_BOTTOM:Number = 520;
public static const FRAMERATE_VIRTUAL:Number = 50;
public static const FRAMERATE_FACTOR:Number = 1;
public static const WIDTH:Number = 480;
public static const HEIGHT:Number = 520;
public static const BORDER_RIGHT:Number = 480;
public static const OFFSET_Y:int = 5;
public static const SAFE_LEFT:Number = (BORDER_LEFT + 40);
public static const SLOW_MOTION_FACTOR:Number = 0.1;
}
}//package de.pixelate.mrbounce.level
Section 59
//XmlData (de.pixelate.mrbounce.level.XmlData)
package de.pixelate.mrbounce.level {
import flash.events.*;
import flash.net.*;
public class XmlData extends EventDispatcher {
private var myLoader:URLLoader;
private var m_xmlData:XML;
private static var instance:XmlData = new (XmlData);
;
public function XmlData(){
m_xmlData = <game>
// ----------------------------------------------------------------------------------------------------
// World 1 Colors
// ----------------------------------------------------------------------------------------------------
// 1-1 Hello World
// ----------------------------------------------------------------------------------------------------
<stage>
<level speed="0.3" name="Hello World">
<items>
<item type="bonus" x="48" y="272" size="16" color="RED"/>
<item type="bonus" x="102.85714285714288" y="232.81632653061226" size="16" color="RED"/>
<item type="bonus" x="157.71428571428572" y="206.69387755102042" size="16" color="RED"/>
<item type="bonus" x="212.57142857142856" y="193.63265306122446" size="16" color="RED"/>
<item type="bonus" x="267.42857142857144" y="193.63265306122452" size="16" color="RED"/>
<item type="bonus" x="322.2857142857143" y="206.6938775510204" size="16" color="RED"/>
<item type="bonus" x="377.14285714285705" y="232.8163265306122" size="16" color="RED"/>
<item type="bonus" x="431.99999999999994" y="271.99999999999994" size="16" color="RED"/>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 1-2 Small and Big
// ----------------------------------------------------------------------------------------------------
<level speed="0.3" name="Small and Big">
<items>
<item type="bonus" x="420" y="180" size="16" color="BLUE"/>
<item type="bonus" x="80" y="96" size="16" color="RED"/>
<item type="bonus" x="144" y="96" size="32" color="RED"/>
<item type="bonus" x="224" y="112" size="8" color="RED"/>
<item type="bonus" x="224" y="144" size="16" color="RED"/>
<item type="bonus" x="208" y="64" size="24" color="RED"/>
<item type="bonus" x="272" y="80" size="32" color="RED"/>
<item type="bonus" x="224" y="256" size="8" color="RED"/>
<item type="bonus" x="336" y="128" size="8" color="GREEN"/>
<item type="bonus" x="304" y="144" size="16" color="GREEN"/>
<item type="bonus" x="348" y="84" size="24" color="GREEN"/>
<item type="bonus" x="416" y="96" size="24" color="BLUE"/>
<item type="bonus" x="384" y="144" size="24" color="RED"/>
<item type="bonus" x="160" y="176" size="24" color="RED"/>
<item type="bonus" x="128" y="48" size="8" color="BLUE"/>
<item type="bonus" x="120" y="236" size="8" color="BLUE"/>
<item type="bonus" x="192" y="128" size="8" color="BLUE"/>
<item type="bonus" x="268" y="216" size="16" color="BLUE"/>
<item type="bonus" x="224" y="208" size="16" color="GREEN"/>
<item type="bonus" x="68" y="140" size="16" color="GREEN"/>
<item type="bonus" x="96" y="192" size="24" color="GREEN"/>
<item type="bonus" x="320" y="192" size="24" color="BLUE"/>
<item type="bonus" x="384" y="224" size="24" color="BLUE"/>
<item type="bonus" x="176" y="240" size="32" color="BLUE"/>
<item type="bonus" x="288" y="304" size="8" color="BLUE"/>
<item type="bonus" x="240" y="304" size="8" color="GREEN"/>
<item type="bonus" x="224" y="336" size="16" color="BLUE"/>
<item type="bonus" x="76" y="256" size="24" color="BLUE"/>
<item type="bonus" x="312" y="256" size="32" color="BLUE"/>
<item type="bonus" x="372" y="300" size="8" color="BLUE"/>
<item type="bonus" x="400" y="288" size="8" color="RED"/>
<item type="bonus" x="336" y="320" size="16" color="GREEN"/>
<item type="bonus" x="432" y="288" size="16" color="GREEN"/>
<item type="bonus" x="176" y="304" size="24" color="RED"/>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 1-3 Colors, Colors!
// ----------------------------------------------------------------------------------------------------
<level speed="0.3" name="Colors, Colors!">
<items>
<item type="bonus" x="192" y="280" size="8" color="RED"/>
<item type="bonus" x="168" y="256" size="8" color="RED"/>
<item type="bonus" x="192" y="256" size="8" color="RED"/>
<item type="bonus" x="144" y="232" size="8" color="RED"/>
<item type="bonus" x="168" y="280" size="8" color="GREEN"/>
<item type="bonus" x="144" y="256" size="8" color="GREEN"/>
<item type="bonus" x="216" y="304" size="8" color="RED"/>
<item type="bonus" x="240" y="304" size="8" color="RED"/>
<item type="bonus" x="216" y="280" size="8" color="RED"/>
<item type="bonus" x="240" y="280" size="8" color="RED"/>
<item type="bonus" x="216" y="256" size="8" color="RED"/>
<item type="bonus" x="168" y="232" size="8" color="RED"/>
<item type="bonus" x="192" y="232" size="8" color="RED"/>
<item type="bonus" x="144" y="208" size="8" color="RED"/>
<item type="bonus" x="240" y="112" size="8" color="RED"/>
<item type="bonus" x="336" y="208" size="8" color="RED"/>
<item type="bonus" x="312" y="160" size="8" color="RED"/>
<item type="bonus" x="264" y="112" size="8" color="RED"/>
<item type="bonus" x="288" y="136" size="8" color="RED"/>
<item type="bonus" x="336" y="184" size="8" color="RED"/>
<item type="bonus" x="288" y="160" size="8" color="RED"/>
<item type="bonus" x="264" y="136" size="8" color="RED"/>
<item type="bonus" x="312" y="184" size="8" color="RED"/>
<item type="bonus" x="144" y="304" size="8" color="GREEN"/>
<item type="bonus" x="144" y="280" size="8" color="GREEN"/>
<item type="bonus" x="192" y="304" size="8" color="GREEN"/>
<item type="bonus" x="168" y="304" size="8" color="GREEN"/>
<item type="bonus" x="264" y="304" size="8" color="BLUE"/>
<item type="bonus" x="264" y="280" size="8" color="BLUE"/>
<item type="bonus" x="264" y="256" size="8" color="BLUE"/>
<item type="bonus" x="240" y="256" size="8" color="BLUE"/>
<item type="bonus" x="288" y="304" size="8" color="BLUE"/>
<item type="bonus" x="288" y="280" size="8" color="BLUE"/>
<item type="bonus" x="288" y="256" size="8" color="BLUE"/>
<item type="bonus" x="264" y="232" size="8" color="BLUE"/>
<item type="bonus" x="240" y="232" size="8" color="BLUE"/>
<item type="bonus" x="216" y="232" size="8" color="BLUE"/>
<item type="bonus" x="192" y="208" size="8" color="BLUE"/>
<item type="bonus" x="168" y="208" size="8" color="BLUE"/>
<item type="bonus" x="216" y="208" size="8" color="BLUE"/>
<item type="bonus" x="240" y="208" size="8" color="BLUE"/>
<item type="bonus" x="168" y="184" size="8" color="BLUE"/>
<item type="bonus" x="192" y="184" size="8" color="BLUE"/>
<item type="bonus" x="216" y="184" size="8" color="BLUE"/>
<item type="bonus" x="144" y="184" size="8" color="BLUE"/>
<item type="bonus" x="168" y="160" size="8" color="BLUE"/>
<item type="bonus" x="144" y="160" size="8" color="BLUE"/>
<item type="bonus" x="192" y="160" size="8" color="BLUE"/>
<item type="bonus" x="312" y="304" size="8" color="GREEN"/>
<item type="bonus" x="312" y="280" size="8" color="GREEN"/>
<item type="bonus" x="312" y="256" size="8" color="GREEN"/>
<item type="bonus" x="288" y="232" size="8" color="GREEN"/>
<item type="bonus" x="312" y="232" size="8" color="GREEN"/>
<item type="bonus" x="264" y="208" size="8" color="GREEN"/>
<item type="bonus" x="288" y="208" size="8" color="GREEN"/>
<item type="bonus" x="240" y="184" size="8" color="GREEN"/>
<item type="bonus" x="264" y="184" size="8" color="GREEN"/>
<item type="bonus" x="216" y="160" size="8" color="GREEN"/>
<item type="bonus" x="240" y="160" size="8" color="GREEN"/>
<item type="bonus" x="216" y="136" size="8" color="GREEN"/>
<item type="bonus" x="192" y="136" size="8" color="GREEN"/>
<item type="bonus" x="168" y="136" size="8" color="GREEN"/>
<item type="bonus" x="168" y="112" size="8" color="GREEN"/>
<item type="bonus" x="192" y="112" size="8" color="GREEN"/>
<item type="bonus" x="216" y="112" size="8" color="GREEN"/>
<item type="bonus" x="240" y="136" size="8" color="GREEN"/>
<item type="bonus" x="264" y="160" size="8" color="GREEN"/>
<item type="bonus" x="312" y="208" size="8" color="GREEN"/>
<item type="bonus" x="288" y="184" size="8" color="GREEN"/>
<item type="bonus" x="336" y="232" size="8" color="GREEN"/>
<item type="bonus" x="336" y="256" size="8" color="GREEN"/>
<item type="bonus" x="336" y="280" size="8" color="GREEN"/>
<item type="bonus" x="336" y="304" size="8" color="GREEN"/>
<item type="bonus" x="144" y="136" size="8" color="GREEN"/>
<item type="bonus" x="144" y="112" size="8" color="GREEN"/>
<item type="bonus" x="336" y="160" size="8" color="RED"/>
<item type="bonus" x="312" y="136" size="8" color="RED"/>
<item type="bonus" x="288" y="112" size="8" color="RED"/>
<item type="bonus" x="312" y="112" size="8" color="BLUE"/>
<item type="bonus" x="336" y="112" size="8" color="BLUE"/>
<item type="bonus" x="336" y="136" size="8" color="BLUE"/>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 1-4 Landscape
// ----------------------------------------------------------------------------------------------------
<level speed="0.3" name="Landscape">
<items>
<item type="bonus" x="240" y="144" size="8" color="BLUE"/>
<item type="bonus" x="16" y="272" size="8" color="BLUE"/>
<item type="bonus" x="32" y="256" size="8" color="BLUE"/>
<item type="bonus" x="48" y="240" size="8" color="BLUE"/>
<item type="bonus" x="64" y="224" size="8" color="BLUE"/>
<item type="bonus" x="80" y="208" size="8" color="BLUE"/>
<item type="bonus" x="96" y="192" size="8" color="BLUE"/>
<item type="bonus" x="112" y="176" size="8" color="BLUE"/>
<item type="bonus" x="128" y="192" size="8" color="BLUE"/>
<item type="bonus" x="144" y="208" size="8" color="BLUE"/>
<item type="bonus" x="160" y="224" size="8" color="BLUE"/>
<item type="bonus" x="176" y="208" size="8" color="BLUE"/>
<item type="bonus" x="192" y="192" size="8" color="BLUE"/>
<item type="bonus" x="208" y="176" size="8" color="BLUE"/>
<item type="bonus" x="224" y="160" size="8" color="BLUE"/>
<item type="bonus" x="256" y="128" size="8" color="BLUE"/>
<item type="bonus" x="272" y="144" size="8" color="BLUE"/>
<item type="bonus" x="288" y="160" size="8" color="BLUE"/>
<item type="bonus" x="304" y="176" size="8" color="BLUE"/>
<item type="bonus" x="320" y="192" size="8" color="BLUE"/>
<item type="bonus" x="336" y="208" size="8" color="BLUE"/>
<item type="bonus" x="352" y="192" size="8" color="BLUE"/>
<item type="bonus" x="368" y="176" size="8" color="BLUE"/>
<item type="bonus" x="384" y="160" size="8" color="BLUE"/>
<item type="bonus" x="400" y="176" size="8" color="BLUE"/>
<item type="bonus" x="416" y="192" size="8" color="BLUE"/>
<item type="bonus" x="432" y="208" size="8" color="BLUE"/>
<item type="bonus" x="448" y="224" size="8" color="BLUE"/>
<item type="bonus" x="464" y="240" size="8" color="BLUE"/>
<item type="bonus" x="256" y="160" size="8" color="GREEN"/>
<item type="bonus" x="240" y="176" size="8" color="GREEN"/>
<item type="bonus" x="272" y="176" size="8" color="GREEN"/>
<item type="bonus" x="112" y="208" size="8" color="GREEN"/>
<item type="bonus" x="128" y="224" size="8" color="GREEN"/>
<item type="bonus" x="96" y="224" size="8" color="GREEN"/>
<item type="bonus" x="384" y="192" size="8" color="GREEN"/>
<item type="bonus" x="400" y="208" size="8" color="GREEN"/>
<item type="bonus" x="368" y="208" size="8" color="GREEN"/>
<item type="bonus" x="160" y="152" size="32" color="RED"/>
<item type="bonus" x="120" y="128" size="8" color="RED"/>
<item type="bonus" x="96" y="120" size="8" color="RED"/>
<item type="bonus" x="72" y="112" size="8" color="RED"/>
<item type="bonus" x="112" y="152" size="8" color="RED"/>
<item type="bonus" x="88" y="152" size="8" color="RED"/>
<item type="bonus" x="64" y="152" size="8" color="RED"/>
<item type="bonus" x="136" y="112" size="8" color="RED"/>
<item type="bonus" x="120" y="96" size="8" color="RED"/>
<item type="bonus" x="104" y="80" size="8" color="RED"/>
<item type="bonus" x="160" y="104" size="8" color="RED"/>
<item type="bonus" x="160" y="80" size="8" color="RED"/>
<item type="bonus" x="160" y="56" size="8" color="RED"/>
<item type="bonus" x="184" y="112" size="8" color="RED"/>
<item type="bonus" x="200" y="96" size="8" color="RED"/>
<item type="bonus" x="216" y="80" size="8" color="RED"/>
<item type="bonus" x="200" y="128" size="8" color="RED"/>
<item type="bonus" x="224" y="120" size="8" color="RED"/>
<item type="bonus" x="248" y="112" size="8" color="RED"/>
<item type="bonus" x="208" y="152" size="8" color="RED"/>
</items>
</level>
</stage>
// ----------------------------------------------------------------------------------------------------
// World 2 Blockers
// ----------------------------------------------------------------------------------------------------
// 2-1
// ----------------------------------------------------------------------------------------------------
<stage>
<level speed="0.4" name="">
<items>
<item type="bonus" x="128" y="88" size="16" color="BLUE"/>
<item type="bonus" x="184" y="88" size="16" color="BLUE"/>
<item type="bonus" x="240" y="88" size="16" color="BLUE"/>
<item type="bonus" x="296" y="88" size="16" color="BLUE"/>
<item type="bonus" x="352" y="88" size="16" color="BLUE"/>
<item type="bonus" x="128" y="144" size="16" color="BLUE"/>
<item type="bonus" x="184" y="144" size="16" color="BLUE"/>
<item type="bonus" x="296" y="144" size="16" color="BLUE"/>
<item type="bonus" x="240" y="144" size="16" color="BLUE"/>
<item type="bonus" x="352" y="144" size="16" color="BLUE"/>
<item type="bonus" x="128" y="264" size="16" color="BLUE"/>
<item type="bonus" x="184" y="264" size="16" color="BLUE"/>
<item type="bonus" x="240" y="264" size="16" color="BLUE"/>
<item type="bonus" x="296" y="264" size="16" color="BLUE"/>
<item type="bonus" x="352" y="264" size="16" color="BLUE"/>
<item type="bonus" x="128" y="320" size="16" color="BLUE"/>
<item type="bonus" x="184" y="320" size="16" color="BLUE"/>
<item type="bonus" x="296" y="320" size="16" color="BLUE"/>
<item type="bonus" x="352" y="320" size="16" color="BLUE"/>
<item type="bonus" x="240" y="320" size="16" color="BLUE"/>
<item type="bonus" x="160" y="120" size="8" color="GREEN"/>
<item type="bonus" x="216" y="112" size="8" color="GREEN"/>
<item type="bonus" x="272" y="120" size="8" color="GREEN"/>
<item type="bonus" x="328" y="112" size="8" color="GREEN"/>
<item type="bonus" x="320" y="296" size="8" color="GREEN"/>
<item type="bonus" x="272" y="288" size="8" color="GREEN"/>
<item type="bonus" x="216" y="296" size="8" color="GREEN"/>
<item type="bonus" x="152" y="288" size="8" color="GREEN"/>
<item type="blocker" x="240" y="205" width="148"/>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 2-2
// ----------------------------------------------------------------------------------------------------
<level speed="0.4" name="">
<items>
<item type="bonus" x="360" y="120" size="32" color="RED"/>
<item type="bonus" x="192" y="72" size="32" color="RED"/>
<item type="bonus" x="96" y="96" size="32" color="RED"/>
<item type="bonus" x="144" y="168" size="32" color="RED"/>
<item type="bonus" x="408" y="192" size="32" color="RED"/>
<item type="bonus" x="336" y="216" size="32" color="RED"/>
<item type="bonus" x="240" y="288" size="32" color="RED"/>
<item type="bonus" x="168" y="264" size="32" color="RED"/>
<item type="bonus" x="96" y="312" size="32" color="RED"/>
<item type="bonus" x="180" y="60" size="8" color="GREEN"/>
<item type="bonus" x="368" y="136" size="8" color="GREEN"/>
<item type="bonus" x="404" y="208" size="8" color="GREEN"/>
<item type="bonus" x="320" y="220" size="8" color="GREEN"/>
<item type="bonus" x="252" y="300" size="8" color="GREEN"/>
<item type="bonus" x="152" y="260" size="8" color="GREEN"/>
<item type="bonus" x="88" y="328" size="8" color="GREEN"/>
<item type="bonus" x="84" y="108" size="8" color="GREEN"/>
<item type="bonus" x="160" y="172" size="8" color="GREEN"/>
<item type="bonus" x="432" y="336" size="32" color="RED"/>
<item type="bonus" x="360" y="312" size="32" color="RED"/>
<item type="bonus" x="336" y="384" size="32" color="RED"/>
<item type="bonus" x="424" y="352" size="8" color="GREEN"/>
<item type="bonus" x="348" y="300" size="8" color="GREEN"/>
<item type="bonus" x="352" y="388" size="8" color="GREEN"/>
<item type="blocker" x="184" y="120" width="70"/>
<item type="blocker" x="320" y="168" width="70"/>
<item type="blocker" x="176" y="320" width="70"/>
<item type="blocker" x="416" y="384" width="70"/>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 2-3
// ----------------------------------------------------------------------------------------------------
<level speed="0.4" name="">
<items>
<item type="bonus" x="120" y="120" size="16" color="GREEN"/>
<item type="bonus" x="180" y="120" size="16" color="GREEN"/>
<item type="bonus" x="240" y="120" size="16" color="GREEN"/>
<item type="bonus" x="300" y="120" size="16" color="GREEN"/>
<item type="bonus" x="360" y="120" size="16" color="GREEN"/>
<item type="bonus" x="420" y="120" size="16" color="GREEN"/>
<item type="bonus" x="60" y="120" size="16" color="GREEN"/>
<item type="bonus" x="120" y="180" size="16" color="GREEN"/>
<item type="bonus" x="180" y="180" size="16" color="GREEN"/>
<item type="bonus" x="240" y="180" size="16" color="GREEN"/>
<item type="bonus" x="300" y="180" size="16" color="GREEN"/>
<item type="bonus" x="360" y="180" size="16" color="GREEN"/>
<item type="bonus" x="420" y="180" size="16" color="GREEN"/>
<item type="bonus" x="60" y="180" size="16" color="GREEN"/>
<item type="bonus" x="88" y="152" size="8" color="RED"/>
<item type="bonus" x="152" y="152" size="8" color="RED"/>
<item type="bonus" x="216" y="152" size="8" color="RED"/>
<item type="bonus" x="272" y="152" size="8" color="RED"/>
<item type="bonus" x="328" y="152" size="8" color="RED"/>
<item type="bonus" x="392" y="152" size="8" color="RED"/>
<item type="blocker" x="85" y="220" width="170" isMovable="true"/>
<item type="blocker" x="395" y="264" width="170" isMovable="true"/>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 2-4 Grid
// ----------------------------------------------------------------------------------------------------
<level speed="0.4" name="">
<items>
<item type="bonus" x="60" y="240" size="8" color="RED"/>
<item type="bonus" x="120" y="240" size="8" color="RED"/>
<item type="bonus" x="180" y="240" size="8" color="RED"/>
<item type="bonus" x="240" y="240" size="8" color="RED"/>
<item type="bonus" x="300" y="240" size="8" color="RED"/>
<item type="bonus" x="360" y="240" size="8" color="RED"/>
<item type="bonus" x="420" y="240" size="8" color="RED"/>
<item type="bonus" x="150" y="210" size="8" color="RED"/>
<item type="bonus" x="90" y="210" size="8" color="RED"/>
<item type="bonus" x="90" y="270" size="8" color="RED"/>
<item type="bonus" x="150" y="270" size="8" color="RED"/>
<item type="bonus" x="210" y="270" size="8" color="RED"/>
<item type="bonus" x="210" y="210" size="8" color="RED"/>
<item type="bonus" x="270" y="210" size="8" color="RED"/>
<item type="bonus" x="270" y="270" size="8" color="RED"/>
<item type="bonus" x="330" y="210" size="8" color="RED"/>
<item type="bonus" x="330" y="270" size="8" color="RED"/>
<item type="bonus" x="390" y="210" size="8" color="RED"/>
<item type="bonus" x="390" y="270" size="8" color="RED"/>
<item type="bonus" x="60" y="300" size="8" color="RED"/>
<item type="bonus" x="120" y="300" size="8" color="RED"/>
<item type="bonus" x="180" y="300" size="8" color="RED"/>
<item type="bonus" x="240" y="300" size="8" color="RED"/>
<item type="bonus" x="300" y="300" size="8" color="RED"/>
<item type="bonus" x="360" y="300" size="8" color="RED"/>
<item type="bonus" x="420" y="300" size="8" color="RED"/>
<item type="bonus" x="60" y="180" size="8" color="RED"/>
<item type="bonus" x="120" y="180" size="8" color="RED"/>
<item type="bonus" x="180" y="180" size="8" color="RED"/>
<item type="bonus" x="240" y="180" size="8" color="RED"/>
<item type="bonus" x="300" y="180" size="8" color="RED"/>
<item type="bonus" x="360" y="180" size="8" color="RED"/>
<item type="bonus" x="420" y="180" size="8" color="RED"/>
<item type="bonus" x="90" y="150" size="8" color="RED"/>
<item type="bonus" x="150" y="150" size="8" color="RED"/>
<item type="bonus" x="210" y="150" size="8" color="RED"/>
<item type="bonus" x="270" y="150" size="8" color="RED"/>
<item type="bonus" x="330" y="150" size="8" color="RED"/>
<item type="bonus" x="390" y="150" size="8" color="RED"/>
<item type="bonus" x="90" y="330" size="8" color="RED"/>
<item type="bonus" x="150" y="330" size="8" color="RED"/>
<item type="bonus" x="210" y="330" size="8" color="RED"/>
<item type="bonus" x="270" y="330" size="8" color="RED"/>
<item type="bonus" x="330" y="330" size="8" color="RED"/>
<item type="bonus" x="390" y="330" size="8" color="RED"/>
<item type="bonus" x="300" y="120" size="8" color="RED"/>
<item type="bonus" x="180" y="120" size="8" color="RED"/>
<item type="bonus" x="60" y="120" size="8" color="RED"/>
<item type="bonus" x="420" y="120" size="8" color="RED"/>
<item type="bonus" x="60" y="360" size="8" color="RED"/>
<item type="bonus" x="180" y="360" size="8" color="RED"/>
<item type="bonus" x="300" y="360" size="8" color="RED"/>
<item type="bonus" x="420" y="360" size="8" color="RED"/>
<item type="blocker" x="240" y="270" width="10"/>
<item type="blocker" x="300" y="270" width="10"/>
<item type="blocker" x="180" y="270" width="10"/>
<item type="blocker" x="120" y="270" width="10"/>
<item type="blocker" x="120" y="330" width="10"/>
<item type="blocker" x="180" y="330" width="10"/>
<item type="blocker" x="240" y="330" width="10"/>
<item type="blocker" x="300" y="330" width="10"/>
<item type="blocker" x="360" y="330" width="10"/>
<item type="blocker" x="360" y="270" width="10"/>
<item type="blocker" x="360" y="210" width="10"/>
<item type="blocker" x="300" y="210" width="10"/>
<item type="blocker" x="240" y="210" width="10"/>
<item type="blocker" x="180" y="210" width="10"/>
<item type="blocker" x="120" y="210" width="10"/>
<item type="blocker" x="120" y="150" width="10"/>
<item type="blocker" x="180" y="150" width="10"/>
<item type="blocker" x="300" y="150" width="10"/>
<item type="blocker" x="360" y="150" width="10"/>
<item type="blocker" x="240" y="152" width="10"/>
</items>
</level>
</stage>
// ----------------------------------------------------------------------------------------------------
// World 3 Bouncers
// ----------------------------------------------------------------------------------------------------
// 3-1 Pair Programming
// ----------------------------------------------------------------------------------------------------
<stage>
<level speed="0.5" name="Pair Programming">
<items>
<item type="bonus" x="120" y="220" size="16" color="GREEN"/>
<item type="bonus" x="180" y="220" size="16" color="GREEN"/>
<item type="bonus" x="120" y="280" size="16" color="GREEN"/>
<item type="bonus" x="180" y="280" size="16" color="GREEN"/>
<item type="bonus" x="360" y="220" size="16" color="GREEN"/>
<item type="bonus" x="360" y="280" size="16" color="GREEN"/>
<item type="bonus" x="300" y="220" size="16" color="GREEN"/>
<item type="bonus" x="300" y="280" size="16" color="GREEN"/>
<item type="bouncer" x="120" y="340" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="180" y="340" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="240" y="340" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="300" y="340" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="60" y="340" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="360" y="340" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="420" y="340" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="60" y="280" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="60" y="220" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="60" y="160" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="120" y="160" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="180" y="160" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="240" y="160" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="240" y="220" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="240" y="280" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="300" y="160" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="360" y="160" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="420" y="160" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="420" y="220" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="420" y="280" height="50" width="50" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 3-2 More Boxes!
// ----------------------------------------------------------------------------------------------------
<level speed="0.5" name="More Boxes!">
<items>
<item type="bonus" x="283" y="333" size="16" color="RED"/>
<item type="bonus" x="179" y="115" size="16" color="RED"/>
<item type="bonus" x="192" y="252" size="16" color="RED"/>
<item type="bonus" x="120" y="240" size="16" color="RED"/>
<item type="bonus" x="120" y="180" size="16" color="RED"/>
<item type="bonus" x="120" y="120" size="16" color="RED"/>
<item type="bonus" x="143" y="282" size="16" color="RED"/>
<item type="bonus" x="117" y="329" size="16" color="RED"/>
<item type="bonus" x="333" y="176" size="16" color="RED"/>
<item type="bonus" x="324" y="159" size="16" color="RED"/>
<item type="bonus" x="277" y="178" size="16" color="RED"/>
<item type="bonus" x="397" y="268" size="16" color="RED"/>
<item type="bonus" x="239" y="169" size="16" color="RED"/>
<item type="bonus" x="292" y="132" size="16" color="RED"/>
<item type="bonus" x="130" y="159" size="16" color="RED"/>
<item type="bonus" x="56" y="225" size="16" color="RED"/>
<item type="bonus" x="76" y="267" size="16" color="RED"/>
<item type="bonus" x="88" y="320" size="16" color="RED"/>
<item type="bonus" x="129" y="364" size="16" color="RED"/>
<item type="bonus" x="224" y="332" size="16" color="RED"/>
<item type="bonus" x="214" y="313" size="16" color="RED"/>
<item type="bonus" x="264" y="320" size="16" color="RED"/>
<item type="bonus" x="353" y="364" size="16" color="RED"/>
<item type="bonus" x="332" y="308" size="16" color="RED"/>
<item type="bonus" x="428" y="348" size="16" color="RED"/>
<item type="bonus" x="419" y="276" size="16" color="RED"/>
<item type="bonus" x="414" y="256" size="16" color="RED"/>
<item type="bonus" x="441" y="210" size="16" color="RED"/>
<item type="bonus" x="385" y="133" size="16" color="RED"/>
<item type="bonus" x="363" y="123" size="16" color="RED"/>
<item type="bonus" x="311" y="106" size="16" color="RED"/>
<item type="bonus" x="267" y="114" size="16" color="RED"/>
<item type="bonus" x="146" y="221" size="16" color="RED"/>
<item type="bonus" x="301" y="270" size="16" color="RED"/>
<item type="bonus" x="210" y="263" size="16" color="RED"/>
<item type="bonus" x="248" y="260" size="8" color="BLUE"/>
<item type="bonus" x="196" y="180" size="8" color="BLUE"/>
<item type="bonus" x="84" y="216" size="8" color="BLUE"/>
<item type="bonus" x="172" y="280" size="8" color="BLUE"/>
<item type="bonus" x="372" y="184" size="8" color="BLUE"/>
<item type="bonus" x="356" y="224" size="8" color="BLUE"/>
<item type="bonus" x="352" y="280" size="8" color="BLUE"/>
<item type="bonus" x="228" y="132" size="8" color="BLUE"/>
<item type="bonus" x="184" y="148" size="8" color="BLUE"/>
<item type="bonus" x="156" y="324" size="8" color="BLUE"/>
<item type="bonus" x="84" y="352" size="8" color="BLUE"/>
<item type="bonus" x="376" y="320" size="8" color="BLUE"/>
<item type="bonus" x="308" y="360" size="8" color="BLUE"/>
<item type="bouncer" x="216" y="213" height="13" width="24" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="67" y="133" height="24" width="35" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="50" y="275" height="14" width="41" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="50" y="376" height="63" width="15" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="192" y="335" height="42" width="29" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="308" y="50" height="63" width="60" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="298" y="230" height="23" width="52" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="404" y="197" height="25" width="41" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="350" y="322" height="36" width="93" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="438" y="417" height="96" width="23" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="173" y="85" height="35" width="23" isDestroyable="false" isMovable="true" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 3-3 Open the Box
// ----------------------------------------------------------------------------------------------------
<level speed="0.5" name="Open the Box!">
<items>
<item type="bouncer" x="240" y="220" height="100" width="100" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="240" y="220" height="150" width="150" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="240" y="220" height="200" width="200" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="240" y="220" height="250" width="250" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bonus" x="208" y="220" size="8" color="GREEN"/>
<item type="bonus" x="208" y="188" size="8" color="GREEN"/>
<item type="bonus" x="240" y="188" size="8" color="GREEN"/>
<item type="bonus" x="272" y="188" size="8" color="GREEN"/>
<item type="bonus" x="208" y="252" size="8" color="GREEN"/>
<item type="bonus" x="240" y="220" size="8" color="GREEN"/>
<item type="bonus" x="272" y="220" size="8" color="GREEN"/>
<item type="bonus" x="240" y="252" size="8" color="GREEN"/>
<item type="bonus" x="272" y="252" size="8" color="GREEN"/>
<item type="bonus" x="224" y="204" size="8" color="BLUE"/>
<item type="bonus" x="256" y="204" size="8" color="BLUE"/>
<item type="bonus" x="224" y="236" size="8" color="BLUE"/>
<item type="bonus" x="256" y="236" size="8" color="BLUE"/>
<item type="blocker" x="240" y="332" width="10"/>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 3-4 Logo
// ----------------------------------------------------------------------------------------------------
<level speed="0.5" name="Logo">
<items>
<item type="bouncer" x="90" y="225" height="20" width="50" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="false" hasRightSide="false" hasDownSide="false"/>
<item type="bouncer" x="90" y="260" height="50" width="50" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="150" y="260" height="50" width="50" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="210" y="260" height="50" width="50" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="false" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="270" y="260" height="50" width="50" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="false"/>
<item type="bouncer" x="330" y="260" height="50" width="50" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="false" hasDownSide="true"/>
<item type="bouncer" x="390" y="260" height="50" width="50" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="false" hasDownSide="true"/>
<item type="bouncer" x="390" y="248" height="25" width="50" isDestroyable="true" isMovable="false" hasLeftSide="false" hasUpSide="false" hasRightSide="true" hasDownSide="true"/>
<item type="bonus" x="80" y="248" size="8" color="RED"/>
<item type="bonus" x="100" y="248" size="8" color="RED"/>
<item type="bonus" x="80" y="268" size="8" color="RED"/>
<item type="bonus" x="100" y="268" size="8" color="RED"/>
<item type="bonus" x="140" y="248" size="8" color="RED"/>
<item type="bonus" x="160" y="248" size="8" color="RED"/>
<item type="bonus" x="140" y="268" size="8" color="RED"/>
<item type="bonus" x="160" y="268" size="8" color="RED"/>
<item type="bonus" x="200" y="248" size="8" color="RED"/>
<item type="bonus" x="220" y="248" size="8" color="RED"/>
<item type="bonus" x="200" y="268" size="8" color="RED"/>
<item type="bonus" x="220" y="268" size="8" color="RED"/>
<item type="bonus" x="260" y="248" size="8" color="RED"/>
<item type="bonus" x="280" y="248" size="8" color="RED"/>
<item type="bonus" x="260" y="268" size="8" color="RED"/>
<item type="bonus" x="280" y="268" size="8" color="RED"/>
<item type="bonus" x="320" y="248" size="8" color="RED"/>
<item type="bonus" x="340" y="248" size="8" color="RED"/>
<item type="bonus" x="320" y="268" size="8" color="RED"/>
<item type="bonus" x="340" y="268" size="8" color="RED"/>
<item type="bonus" x="380" y="248" size="8" color="RED"/>
<item type="bonus" x="400" y="248" size="8" color="RED"/>
<item type="blocker" x="188" y="116" width="10"/>
<item type="blocker" x="288" y="116" width="10"/>
<item type="bouncer" x="208" y="152" height="50" width="50" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="268" y="152" height="50" width="50" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="200" y="144" height="15" width="15" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="276" y="148" height="15" width="15" isDestroyable="true" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
</items>
</level>
</stage>
// ----------------------------------------------------------------------------------------------------
// World 4 Paths
// ----------------------------------------------------------------------------------------------------
// 4-1 Hi!
// ----------------------------------------------------------------------------------------------------
<stage>
<level speed="0.6" name="Hi!">
<items>
<item type="bonus" x="376" y="336" size="8" color="RED"/>
<item type="bonus" x="280" y="196" size="8" color="RED"/>
<item type="path">
<pathelement x1="68" y1="336" x2="116" y2="128" xC="109" yC="224" hasAccessPoint="true"/>
<pathelement x1="116" y1="128" x2="96" y2="138" xC="100" yC="68" hasAccessPoint="false"/>
<pathelement x1="96" y1="140" x2="116" y2="336" xC="100" yC="224" hasAccessPoint="false"/>
<pathelement x1="116" y1="336" x2="148" y2="208" xC="112" yC="228" hasAccessPoint="false"/>
<pathelement x1="148" y1="208" x2="197" y2="335" xC="212" yC="192" hasAccessPoint="false"/>
<pathelement x1="197" y1="335" x2="228" y2="336" xC="212" yC="334" hasAccessPoint="false"/>
<pathelement x1="228" y1="336" x2="278" y2="223" xC="276" yC="288" hasAccessPoint="false"/>
<pathelement x1="278" y1="223" x2="332" y2="336" xC="276" yC="336" hasAccessPoint="false"/>
<pathelement x1="380" y1="312" x2="384" y2="112" xC="396" yC="248" hasAccessPoint="false"/>
<pathelement x1="384" y1="112" x2="420" y2="116" xC="402" yC="113" hasAccessPoint="false"/>
<pathelement x1="420" y1="116" x2="380" y2="312" xC="404" yC="216" hasAccessPoint="false"/>
</item>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 4-2 Three Slides
// ----------------------------------------------------------------------------------------------------
<level speed="0.6" name="Three Slides">
<items>
<item type="bonus" x="148.8979591836735" y="186.44897959183675" size="8" color="RED"/>
<item type="bonus" x="197.87755102040816" y="190.3673469387755" size="8" color="RED"/>
<item type="bonus" x="242.93877551020407" y="187.75510204081627" size="8" color="RED"/>
<item type="bonus" x="284.0816326530612" y="178.61224489795916" size="8" color="RED"/>
<item type="bonus" x="321.3061224489796" y="162.9387755102041" size="8" color="RED"/>
<item type="bonus" x="354.6122448979591" y="140.73469387755102" size="8" color="RED"/>
<item type="bonus" x="384" y="112" size="8" color="RED"/>
<item type="bonus" x="96" y="240" size="8" color="GREEN"/>
<item type="bonus" x="137.14285714285717" y="272" size="8" color="GREEN"/>
<item type="bonus" x="178.2857142857143" y="294.8571428571429" size="8" color="GREEN"/>
<item type="bonus" x="219.42857142857144" y="308.57142857142856" size="8" color="GREEN"/>
<item type="bonus" x="260.57142857142856" y="313.14285714285717" size="8" color="GREEN"/>
<item type="bonus" x="301.71428571428567" y="308.57142857142856" size="8" color="GREEN"/>
<item type="bonus" x="342.8571428571428" y="294.8571428571429" size="8" color="GREEN"/>
<item type="bonus" x="95" y="62" size="8" color="BLUE"/>
<item type="bonus" x="136.16326530612247" y="90.02040816326532" size="8" color="BLUE"/>
<item type="bonus" x="177.3673469387755" y="108.9387755102041" size="8" color="BLUE"/>
<item type="bonus" x="218.61224489795916" y="118.75510204081631" size="8" color="BLUE"/>
<item type="bonus" x="259.8979591836735" y="119.46938775510203" size="8" color="BLUE"/>
<item type="bonus" x="301.2244897959183" y="111.08163265306123" size="8" color="BLUE"/>
<item type="bonus" x="342.5918367346938" y="93.5918367346939" size="8" color="BLUE"/>
<item type="path">
<pathelement x1="384" y1="272" x2="96" y2="240" xC="240" yC="368" hasAccessPoint="true"/>
</item>
<item type="path">
<pathelement x1="384" y1="64" x2="96" y2="64" xC="240" yC="176" hasAccessPoint="true"/>
</item>
<item type="path">
<pathelement x1="96" y1="176" x2="384" y2="112" xC="272" yC="224" hasAccessPoint="true"/>
</item>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 4-3 The Owl
// ----------------------------------------------------------------------------------------------------
<level speed="0.6" name="The Owl">
<items>
<item type="bonus" x="336" y="160" size="8" color="GREEN"/>
<item type="bonus" x="272" y="160" size="8" color="GREEN"/>
<item type="bonus" x="304" y="64" size="8" color="GREEN"/>
<item type="bonus" x="368" y="128" size="8" color="GREEN"/>
<item type="bonus" x="336" y="96" size="8" color="GREEN"/>
<item type="bonus" x="272" y="96" size="8" color="GREEN"/>
<item type="bonus" x="208" y="160" size="8" color="GREEN"/>
<item type="bonus" x="112" y="128" size="8" color="GREEN"/>
<item type="bonus" x="368" y="256" size="8" color="GREEN"/>
<item type="bonus" x="336" y="224" size="8" color="GREEN"/>
<item type="bonus" x="144" y="288" size="8" color="GREEN"/>
<item type="bonus" x="144" y="224" size="8" color="GREEN"/>
<item type="bonus" x="144" y="160" size="8" color="GREEN"/>
<item type="bonus" x="112" y="256" size="8" color="GREEN"/>
<item type="bonus" x="176" y="192" size="8" color="GREEN"/>
<item type="bonus" x="176" y="320" size="8" color="GREEN"/>
<item type="bonus" x="304" y="320" size="8" color="GREEN"/>
<item type="bonus" x="336" y="288" size="8" color="GREEN"/>
<item type="bonus" x="208" y="224" size="8" color="GREEN"/>
<item type="bonus" x="240" y="128" size="8" color="GREEN"/>
<item type="bonus" x="144" y="96" size="8" color="GREEN"/>
<item type="bonus" x="208" y="96" size="8" color="GREEN"/>
<item type="bonus" x="304" y="192" size="8" color="GREEN"/>
<item type="bonus" x="272" y="224" size="8" color="GREEN"/>
<item type="bonus" x="176" y="64" size="8" color="GREEN"/>
<item type="blocker" x="240" y="288" width="16"/>
<item type="path">
<pathelement x1="240" y1="256" x2="176" y2="192" xC="208" yC="224" hasAccessPoint="true"/>
<pathelement x1="176" y1="192" x2="240" y2="128" xC="208" yC="160" hasAccessPoint="false"/>
<pathelement x1="240" y1="128" x2="304" y2="192" xC="272" yC="160" hasAccessPoint="false"/>
<pathelement x1="304" y1="192" x2="368" y2="128" xC="336" yC="160" hasAccessPoint="false"/>
<pathelement x1="368" y1="128" x2="304" y2="64" xC="336" yC="96" hasAccessPoint="false"/>
<pathelement x1="304" y1="64" x2="240" y2="128" xC="272" yC="96" hasAccessPoint="false"/>
<pathelement x1="240" y1="128" x2="176" y2="64" xC="208" yC="96" hasAccessPoint="false"/>
<pathelement x1="176" y1="64" x2="112" y2="128" xC="144" yC="96" hasAccessPoint="false"/>
<pathelement x1="112" y1="128" x2="176" y2="192" xC="144" yC="160" hasAccessPoint="false"/>
<pathelement x1="176" y1="192" x2="112" y2="256" xC="144" yC="224" hasAccessPoint="false"/>
<pathelement x1="112" y1="256" x2="176" y2="320" xC="144" yC="288" hasAccessPoint="false"/>
<pathelement x1="176" y1="320" x2="304" y2="320" xC="240" yC="320" hasAccessPoint="false"/>
<pathelement x1="304" y1="320" x2="368" y2="256" xC="336" yC="288" hasAccessPoint="false"/>
<pathelement x1="368" y1="256" x2="304" y2="192" xC="336" yC="224" hasAccessPoint="false"/>
<pathelement x1="304" y1="192" x2="240" y2="256" xC="272" yC="224" hasAccessPoint="false"/>
</item>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 4-4 Labyrinth
// ----------------------------------------------------------------------------------------------------
<level speed="0.6" name="Labyrinth">
<items>
<item type="bonus" x="64" y="95" size="8" color="RED"/>
<item type="bonus" x="128" y="128" size="8" color="RED"/>
<item type="bonus" x="320" y="192" size="8" color="RED"/>
<item type="bonus" x="416" y="192" size="8" color="RED"/>
<item type="bonus" x="416" y="96" size="8" color="RED"/>
<item type="bonus" x="80" y="128" size="8" color="RED"/>
<item type="bonus" x="128" y="64" size="8" color="RED"/>
<item type="bonus" x="80" y="288" size="8" color="RED"/>
<item type="bonus" x="96" y="320" size="8" color="RED"/>
<item type="bonus" x="160" y="320" size="8" color="RED"/>
<item type="bonus" x="160" y="192" size="8" color="RED"/>
<item type="bonus" x="288" y="192" size="8" color="RED"/>
<item type="bonus" x="288" y="384" size="8" color="RED"/>
<item type="bonus" x="384" y="384" size="8" color="RED"/>
<item type="bonus" x="244" y="288" size="8" color="RED"/>
<item type="bonus" x="96" y="160" size="8" color="RED"/>
<item type="bonus" x="320" y="160" size="8" color="RED"/>
<item type="bonus" x="320" y="224" size="8" color="RED"/>
<item type="bonus" x="320" y="352" size="8" color="RED"/>
<item type="bonus" x="416" y="224" size="8" color="RED"/>
<item type="bonus" x="416" y="288" size="8" color="RED"/>
<item type="bonus" x="352" y="256" size="8" color="RED"/>
<item type="bonus" x="352" y="320" size="8" color="RED"/>
<item type="bonus" x="416" y="320" size="8" color="RED"/>
<item type="bonus" x="256" y="64" size="8" color="RED"/>
<item type="bonus" x="256" y="176" size="8" color="RED"/>
<item type="bonus" x="128" y="176" size="8" color="RED"/>
<item type="bonus" x="128" y="304" size="8" color="RED"/>
<item type="bonus" x="144" y="48" size="8" color="RED"/>
<item type="bonus" x="352" y="48" size="8" color="RED"/>
<item type="bonus" x="352" y="128" size="8" color="RED"/>
<item type="bonus" x="224" y="128" size="8" color="RED"/>
<item type="bonus" x="224" y="240" size="8" color="RED"/>
<item type="bonus" x="208" y="304" size="8" color="RED"/>
<item type="path">
<pathelement x1="416" y1="352" x2="416" y2="320" xC="416" yC="337.5" hasAccessPoint="true"/>
<pathelement x1="416" y1="320" x2="352" y2="320" xC="384" yC="320" hasAccessPoint="false"/>
<pathelement x1="352" y1="320" x2="352" y2="256" xC="352" yC="288" hasAccessPoint="false"/>
<pathelement x1="352" y1="256" x2="384" y2="256" xC="368" yC="256" hasAccessPoint="false"/>
<pathelement x1="384" y1="256" x2="384" y2="288" xC="384" yC="272" hasAccessPoint="false"/>
<pathelement x1="384" y1="288" x2="416" y2="288" xC="400" yC="288" hasAccessPoint="false"/>
<pathelement x1="416" y1="288" x2="416" y2="224" xC="416" yC="256" hasAccessPoint="false"/>
<pathelement x1="416" y1="224" x2="320" y2="224" xC="368" yC="224" hasAccessPoint="false"/>
<pathelement x1="320" y1="224" x2="320" y2="352" xC="320" yC="288" hasAccessPoint="false"/>
<pathelement x1="320" y1="352" x2="384" y2="352" xC="352" yC="352" hasAccessPoint="false"/>
<pathelement x1="384" y1="352" x2="384" y2="384" xC="384" yC="368" hasAccessPoint="false"/>
<pathelement x1="384" y1="384" x2="288" y2="384" xC="336" yC="384" hasAccessPoint="false"/>
<pathelement x1="288" y1="384" x2="288" y2="192" xC="288" yC="288" hasAccessPoint="false"/>
<pathelement x1="288" y1="192" x2="160" y2="192" xC="224" yC="192" hasAccessPoint="false"/>
<pathelement x1="160" y1="192" x2="160" y2="320" xC="160" yC="256" hasAccessPoint="false"/>
<pathelement x1="160" y1="320" x2="96" y2="320" xC="128" yC="320" hasAccessPoint="false"/>
<pathelement x1="96" y1="320" x2="96" y2="160" xC="96" yC="240" hasAccessPoint="false"/>
<pathelement x1="96" y1="160" x2="320" y2="160" xC="208" yC="160" hasAccessPoint="false"/>
<pathelement x1="320" y1="160" x2="320" y2="192" xC="320" yC="176" hasAccessPoint="false"/>
<pathelement x1="320" y1="192" x2="416" y2="192" xC="368" yC="192" hasAccessPoint="false"/>
<pathelement x1="416" y1="192" x2="416" y2="96" xC="416" yC="144" hasAccessPoint="false"/>
<pathelement x1="416" y1="96" x2="64" y2="96" xC="240" yC="96" hasAccessPoint="false"/>
<pathelement x1="64" y1="96" x2="64" y2="356" xC="64" yC="226" hasAccessPoint="false"/>
</item>
<item type="path">
<pathelement x1="208" y1="352" x2="208" y2="304" xC="208" yC="328" hasAccessPoint="true"/>
<pathelement x1="208" y1="304" x2="128" y2="304" xC="168" yC="304" hasAccessPoint="false"/>
<pathelement x1="128" y1="304" x2="128" y2="176" xC="128" yC="240" hasAccessPoint="false"/>
<pathelement x1="128" y1="176" x2="256" y2="177" xC="207.5" yC="177" hasAccessPoint="false"/>
<pathelement x1="256" y1="176" x2="256" y2="64" xC="256" yC="120" hasAccessPoint="false"/>
<pathelement x1="256" y1="64" x2="128" y2="64" xC="192" yC="64" hasAccessPoint="false"/>
<pathelement x1="128" y1="64" x2="128" y2="128" xC="128" yC="96" hasAccessPoint="false"/>
<pathelement x1="128" y1="128" x2="80" y2="128" xC="104" yC="128" hasAccessPoint="false"/>
<pathelement x1="80" y1="128" x2="80" y2="288" xC="80" yC="209" hasAccessPoint="false"/>
<pathelement x1="80" y1="288" x2="244" y2="288" xC="162" yC="288" hasAccessPoint="false"/>
<pathelement x1="244" y1="288" x2="244" y2="328" xC="244" yC="308" hasAccessPoint="false"/>
</item>
<item type="path">
<pathelement x1="176" y1="368" x2="176" y2="320" xC="176" yC="344" hasAccessPoint="true"/>
<pathelement x1="176" y1="320" x2="176" y2="240" xC="176" yC="280" hasAccessPoint="false"/>
<pathelement x1="176" y1="240" x2="224" y2="240" xC="200" yC="240" hasAccessPoint="false"/>
<pathelement x1="224" y1="240" x2="224" y2="128" xC="224" yC="184" hasAccessPoint="false"/>
<pathelement x1="224" y1="128" x2="352" y2="128" xC="288" yC="128" hasAccessPoint="false"/>
<pathelement x1="352" y1="128" x2="352" y2="48" xC="352" yC="88" hasAccessPoint="false"/>
<pathelement x1="352" y1="48" x2="144" y2="48" xC="248" yC="48" hasAccessPoint="false"/>
<pathelement x1="144" y1="48" x2="144" y2="344" xC="144" yC="196" hasAccessPoint="false"/>
</item>
</items>
</level>
</stage>
// ----------------------------------------------------------------------------------------------------
// World 5 Crazy Shit
// ----------------------------------------------------------------------------------------------------
<stage>
// ----------------------------------------------------------------------------------------------------
// 5-1
// ----------------------------------------------------------------------------------------------------
<level speed="0.7" name="">
<items>
<item type="bonus" x="120" y="220" size="24" color="RED"/>
<item type="bonus" x="120" y="160" size="24" color="RED"/>
<item type="bonus" x="180" y="160" size="24" color="RED"/>
<item type="bonus" x="240" y="160" size="24" color="RED"/>
<item type="bonus" x="300" y="160" size="24" color="RED"/>
<item type="bonus" x="360" y="160" size="24" color="RED"/>
<item type="bonus" x="420" y="160" size="24" color="RED"/>
<item type="bonus" x="420" y="220" size="24" color="RED"/>
<item type="bonus" x="360" y="220" size="24" color="RED"/>
<item type="bonus" x="60" y="220" size="24" color="RED"/>
<item type="bonus" x="60" y="160" size="24" color="RED"/>
<item type="bonus" x="180" y="280" size="24" color="RED"/>
<item type="bonus" x="300" y="280" size="24" color="RED"/>
<item type="bonus" x="120" y="340" size="24" color="RED"/>
<item type="bonus" x="120" y="280" size="24" color="RED"/>
<item type="bonus" x="300" y="340" size="24" color="RED"/>
<item type="bonus" x="360" y="280" size="24" color="RED"/>
<item type="bonus" x="180" y="340" size="24" color="RED"/>
<item type="bonus" x="60" y="280" size="24" color="RED"/>
<item type="bonus" x="420" y="280" size="24" color="RED"/>
<item type="bonus" x="360" y="340" size="24" color="RED"/>
<item type="bonus" x="120" y="100" size="24" color="RED"/>
<item type="bonus" x="180" y="100" size="24" color="RED"/>
<item type="bonus" x="240" y="100" size="24" color="RED"/>
<item type="bonus" x="300" y="100" size="24" color="RED"/>
<item type="bonus" x="360" y="100" size="24" color="RED"/>
<item type="bonus" x="180" y="220" size="24" color="BLUE"/>
<item type="bonus" x="300" y="220" size="24" color="BLUE"/>
<item type="wind" y="75" height="290" direction="RIGHT" speed="3"/>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 5-2
// ----------------------------------------------------------------------------------------------------
<level speed="0.7" name="">
<items>
<item type="bonus" x="272" y="208" size="8" color="GREEN"/>
<item type="bonus" x="336" y="208" size="8" color="GREEN"/>
<item type="bonus" x="240" y="208" size="8" color="GREEN"/>
<item type="bonus" x="208" y="208" size="8" color="GREEN"/>
<item type="bonus" x="304" y="208" size="8" color="GREEN"/>
<item type="bonus" x="368" y="208" size="8" color="GREEN"/>
<item type="bonus" x="400" y="208" size="8" color="GREEN"/>
<item type="bonus" x="432" y="208" size="8" color="GREEN"/>
<item type="bonus" x="176" y="208" size="8" color="GREEN"/>
<item type="bonus" x="144" y="208" size="8" color="GREEN"/>
<item type="bonus" x="112" y="208" size="8" color="GREEN"/>
<item type="bonus" x="80" y="208" size="8" color="GREEN"/>
<item type="bonus" x="48" y="208" size="8" color="GREEN"/>
<item type="bonus" x="320" y="240" size="8" color="GREEN"/>
<item type="bonus" x="256" y="240" size="8" color="GREEN"/>
<item type="bonus" x="224" y="240" size="8" color="GREEN"/>
<item type="bonus" x="288" y="240" size="8" color="GREEN"/>
<item type="bonus" x="352" y="240" size="8" color="GREEN"/>
<item type="bonus" x="384" y="240" size="8" color="GREEN"/>
<item type="bonus" x="416" y="240" size="8" color="GREEN"/>
<item type="bonus" x="192" y="240" size="8" color="GREEN"/>
<item type="bonus" x="160" y="240" size="8" color="GREEN"/>
<item type="bonus" x="128" y="240" size="8" color="GREEN"/>
<item type="bonus" x="96" y="240" size="8" color="GREEN"/>
<item type="bonus" x="64" y="240" size="8" color="GREEN"/>
<item type="bonus" x="32" y="240" size="8" color="GREEN"/>
<item type="bonus" x="16" y="208" size="8" color="GREEN"/>
<item type="bonus" x="448" y="240" size="8" color="GREEN"/>
<item type="bonus" x="464" y="208" size="8" color="GREEN"/>
<item type="bonus" x="16" y="272" size="8" color="GREEN"/>
<item type="bonus" x="48" y="272" size="8" color="GREEN"/>
<item type="bonus" x="80" y="272" size="8" color="GREEN"/>
<item type="bonus" x="112" y="272" size="8" color="GREEN"/>
<item type="bonus" x="144" y="272" size="8" color="GREEN"/>
<item type="bonus" x="176" y="272" size="8" color="GREEN"/>
<item type="bonus" x="208" y="272" size="8" color="GREEN"/>
<item type="bonus" x="240" y="272" size="8" color="GREEN"/>
<item type="bonus" x="272" y="272" size="8" color="GREEN"/>
<item type="bonus" x="304" y="272" size="8" color="GREEN"/>
<item type="bonus" x="336" y="272" size="8" color="GREEN"/>
<item type="bonus" x="368" y="272" size="8" color="GREEN"/>
<item type="bonus" x="400" y="272" size="8" color="GREEN"/>
<item type="bonus" x="432" y="272" size="8" color="GREEN"/>
<item type="bonus" x="464" y="272" size="8" color="GREEN"/>
<item type="blocker" x="74" y="184" width="150" isMovable="true"/>
<item type="blocker" x="408" y="296" width="150" isMovable="true"/>
<item type="wind" y="200" height="75" direction="RIGHT" speed="4"/>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 5-3
// ----------------------------------------------------------------------------------------------------
<level speed="0.7" name="">
<items>
<item type="bonus" x="236" y="128" size="8" color="RED"/>
<item type="bonus" x="236" y="108" size="8" color="RED"/>
<item type="bonus" x="236" y="88" size="8" color="RED"/>
<item type="bonus" x="236" y="68" size="8" color="RED"/>
<item type="bonus" x="256" y="168" size="8" color="GREEN"/>
<item type="bonus" x="256" y="188" size="8" color="GREEN"/>
<item type="bonus" x="256" y="208" size="8" color="GREEN"/>
<item type="bonus" x="256" y="228" size="8" color="GREEN"/>
<item type="bonus" x="276" y="268" size="8" color="BLUE"/>
<item type="bonus" x="276" y="288" size="8" color="BLUE"/>
<item type="bonus" x="276" y="308" size="8" color="BLUE"/>
<item type="bonus" x="276" y="328" size="8" color="BLUE"/>
<item type="bonus" x="256" y="68" size="8" color="RED"/>
<item type="bonus" x="256" y="88" size="8" color="RED"/>
<item type="bonus" x="256" y="108" size="8" color="RED"/>
<item type="bonus" x="256" y="128" size="8" color="RED"/>
<item type="bonus" x="276" y="128" size="8" color="RED"/>
<item type="bonus" x="276" y="108" size="8" color="RED"/>
<item type="bonus" x="276" y="88" size="8" color="RED"/>
<item type="bonus" x="276" y="68" size="8" color="RED"/>
<item type="bonus" x="296" y="128" size="8" color="RED"/>
<item type="bonus" x="296" y="108" size="8" color="RED"/>
<item type="bonus" x="296" y="88" size="8" color="RED"/>
<item type="bonus" x="296" y="68" size="8" color="RED"/>
<item type="bonus" x="276" y="168" size="8" color="GREEN"/>
<item type="bonus" x="276" y="188" size="8" color="GREEN"/>
<item type="bonus" x="276" y="208" size="8" color="GREEN"/>
<item type="bonus" x="276" y="228" size="8" color="GREEN"/>
<item type="bonus" x="296" y="168" size="8" color="GREEN"/>
<item type="bonus" x="316" y="168" size="8" color="GREEN"/>
<item type="bonus" x="296" y="188" size="8" color="GREEN"/>
<item type="bonus" x="316" y="188" size="8" color="GREEN"/>
<item type="bonus" x="296" y="208" size="8" color="GREEN"/>
<item type="bonus" x="316" y="208" size="8" color="GREEN"/>
<item type="bonus" x="296" y="228" size="8" color="GREEN"/>
<item type="bonus" x="316" y="228" size="8" color="GREEN"/>
<item type="bonus" x="296" y="268" size="8" color="BLUE"/>
<item type="bonus" x="316" y="268" size="8" color="BLUE"/>
<item type="bonus" x="336" y="268" size="8" color="BLUE"/>
<item type="bonus" x="296" y="288" size="8" color="BLUE"/>
<item type="bonus" x="316" y="288" size="8" color="BLUE"/>
<item type="bonus" x="336" y="288" size="8" color="BLUE"/>
<item type="bonus" x="296" y="308" size="8" color="BLUE"/>
<item type="bonus" x="316" y="308" size="8" color="BLUE"/>
<item type="bonus" x="336" y="308" size="8" color="BLUE"/>
<item type="bonus" x="296" y="328" size="8" color="BLUE"/>
<item type="bonus" x="316" y="328" size="8" color="BLUE"/>
<item type="bonus" x="336" y="328" size="8" color="BLUE"/>
<item type="wind" y="58" height="80" direction="RIGHT" speed="3"/>
<item type="wind" y="158" height="80" direction="RIGHT" speed="4"/>
<item type="wind" y="258" height="80" direction="RIGHT" speed="5"/>
<item type="bouncer" x="245" y="98" height="76" width="50" isDestroyable="false" isMovable="false" hasLeftSide="true" hasUpSide="false" hasRightSide="false" hasDownSide="false"/>
<item type="bouncer" x="265" y="198" height="76" width="50" isDestroyable="false" isMovable="false" hasLeftSide="true" hasUpSide="false" hasRightSide="false" hasDownSide="false"/>
<item type="bouncer" x="285" y="298" height="76" width="50" isDestroyable="false" isMovable="false" hasLeftSide="true" hasUpSide="false" hasRightSide="false" hasDownSide="false"/>
</items>
</level>
// ----------------------------------------------------------------------------------------------------
// 5-4
// ----------------------------------------------------------------------------------------------------
<level speed="0.7" name="">
<items>
<item type="bonus" x="288" y="216" size="8" color="GREEN"/>
<item type="bonus" x="312" y="216" size="8" color="BLUE"/>
<item type="bonus" x="336" y="216" size="8" color="RED"/>
<item type="bonus" x="360" y="216" size="8" color="RED"/>
<item type="bonus" x="384" y="216" size="8" color="GREEN"/>
<item type="bonus" x="432" y="240" size="8" color="GREEN"/>
<item type="bonus" x="408" y="240" size="8" color="BLUE"/>
<item type="bonus" x="384" y="240" size="8" color="RED"/>
<item type="bonus" x="336" y="240" size="8" color="BLUE"/>
<item type="bonus" x="312" y="240" size="8" color="RED"/>
<item type="bonus" x="288" y="240" size="8" color="GREEN"/>
<item type="bonus" x="264" y="240" size="8" color="BLUE"/>
<item type="bonus" x="264" y="216" size="8" color="RED"/>
<item type="bonus" x="240" y="216" size="8" color="GREEN"/>
<item type="bonus" x="240" y="240" size="8" color="BLUE"/>
<item type="bonus" x="216" y="240" size="8" color="RED"/>
<item type="bonus" x="216" y="216" size="8" color="GREEN"/>
<item type="bonus" x="192" y="240" size="8" color="BLUE"/>
<item type="bonus" x="192" y="264" size="8" color="RED"/>
<item type="bonus" x="240" y="264" size="8" color="BLUE"/>
<item type="bonus" x="264" y="264" size="8" color="RED"/>
<item type="bonus" x="264" y="288" size="8" color="GREEN"/>
<item type="bonus" x="240" y="288" size="8" color="BLUE"/>
<item type="bonus" x="216" y="288" size="8" color="RED"/>
<item type="bonus" x="192" y="288" size="8" color="GREEN"/>
<item type="bonus" x="168" y="288" size="8" color="BLUE"/>
<item type="bonus" x="168" y="264" size="8" color="RED"/>
<item type="bonus" x="144" y="240" size="8" color="BLUE"/>
<item type="bonus" x="144" y="264" size="8" color="RED"/>
<item type="bonus" x="144" y="288" size="8" color="GREEN"/>
<item type="bonus" x="120" y="288" size="8" color="BLUE"/>
<item type="bonus" x="120" y="240" size="8" color="GREEN"/>
<item type="bonus" x="96" y="240" size="8" color="BLUE"/>
<item type="bonus" x="96" y="264" size="8" color="RED"/>
<item type="bonus" x="96" y="288" size="8" color="GREEN"/>
<item type="bonus" x="312" y="312" size="8" color="RED"/>
<item type="bonus" x="288" y="312" size="8" color="GREEN"/>
<item type="bonus" x="240" y="312" size="8" color="BLUE"/>
<item type="bonus" x="264" y="312" size="8" color="RED"/>
<item type="bonus" x="264" y="336" size="8" color="GREEN"/>
<item type="bonus" x="288" y="336" size="8" color="BLUE"/>
<item type="bonus" x="312" y="336" size="8" color="RED"/>
<item type="bonus" x="336" y="312" size="8" color="RED"/>
<item type="bonus" x="336" y="288" size="8" color="GREEN"/>
<item type="bonus" x="192" y="216" size="8" color="GREEN"/>
<item type="bonus" x="192" y="192" size="8" color="GREEN"/>
<item type="bonus" x="168" y="168" size="8" color="GREEN"/>
<item type="bonus" x="168" y="216" size="8" color="GREEN"/>
<item type="bonus" x="128" y="192" size="8" color="GREEN"/>
<item type="bonus" x="168" y="312" size="8" color="RED"/>
<item type="bonus" x="264" y="192" size="8" color="RED"/>
<item type="bonus" x="360" y="288" size="8" color="RED"/>
<item type="bonus" x="336" y="264" size="8" color="GREEN"/>
<item type="bonus" x="360" y="264" size="8" color="GREEN"/>
<item type="bonus" x="384" y="264" size="8" color="BLUE"/>
<item type="bonus" x="384" y="288" size="8" color="BLUE"/>
<item type="bonus" x="264" y="168" size="8" color="BLUE"/>
<item type="bonus" x="192" y="168" size="8" color="BLUE"/>
<item type="bonus" x="192" y="144" size="8" color="BLUE"/>
<item type="bonus" x="216" y="144" size="8" color="RED"/>
<item type="bonus" x="240" y="144" size="8" color="GREEN"/>
<item type="bonus" x="264" y="144" size="8" color="BLUE"/>
<item type="bonus" x="288" y="192" size="8" color="BLUE"/>
<item type="bonus" x="288" y="168" size="8" color="BLUE"/>
<item type="bonus" x="216" y="312" size="8" color="BLUE"/>
<item type="bonus" x="192" y="312" size="8" color="BLUE"/>
<item type="bonus" x="216" y="336" size="8" color="BLUE"/>
<item type="bonus" x="144" y="216" size="8" color="RED"/>
<item type="bonus" x="336" y="192" size="8" color="GREEN"/>
<item type="bonus" x="360" y="192" size="8" color="GREEN"/>
<item type="bonus" x="312" y="168" size="8" color="RED"/>
<item type="bonus" x="312" y="144" size="8" color="RED"/>
<item type="bonus" x="288" y="144" size="8" color="GREEN"/>
<item type="bonus" x="312" y="192" size="8" color="BLUE"/>
<item type="bonus" x="384" y="192" size="8" color="BLUE"/>
<item type="bonus" x="384" y="168" size="8" color="BLUE"/>
<item type="bonus" x="384" y="144" size="8" color="BLUE"/>
<item type="bonus" x="312" y="120" size="8" color="BLUE"/>
<item type="bonus" x="336" y="120" size="8" color="BLUE"/>
<item type="bonus" x="360" y="120" size="8" color="RED"/>
<item type="bonus" x="384" y="120" size="8" color="GREEN"/>
<item type="bonus" x="192" y="120" size="8" color="GREEN"/>
<item type="bonus" x="88" y="96" size="8" color="GREEN"/>
<item type="bonus" x="136" y="120" size="8" color="GREEN"/>
<item type="bonus" x="232" y="80" size="8" color="BLUE"/>
<item type="bonus" x="312" y="72" size="8" color="RED"/>
<item type="bonus" x="408" y="144" size="8" color="GREEN"/>
<item type="bonus" x="376" y="88" size="8" color="GREEN"/>
<item type="bonus" x="288" y="104" size="8" color="BLUE"/>
<item type="bonus" x="64" y="216" size="8" color="RED"/>
<item type="bonus" x="32" y="256" size="8" color="BLUE"/>
<item type="bonus" x="72" y="352" size="8" color="RED"/>
<item type="bonus" x="104" y="360" size="8" color="GREEN"/>
<item type="bonus" x="176" y="80" size="8" color="BLUE"/>
<item type="bonus" x="256" y="56" size="8" color="RED"/>
<item type="bonus" x="408" y="216" size="8" color="RED"/>
<item type="bouncer" x="420" y="276" height="32" width="32" isDestroyable="false" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="132" y="324" height="32" width="32" isDestroyable="false" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="228" y="180" height="32" width="32" isDestroyable="false" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="348" y="156" height="32" width="32" isDestroyable="false" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="56" y="128" height="32" width="32" isDestroyable="false" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="bouncer" x="128" y="80" height="32" width="32" isDestroyable="false" isMovable="false" hasLeftSide="true" hasUpSide="true" hasRightSide="true" hasDownSide="true"/>
<item type="wind" y="50" height="150" direction="LEFT" speed="3"/>
<item type="wind" y="205" height="150" direction="RIGHT" speed="3"/>
</items>
</level>
</stage>
</game>
;
super();
if (instance){
throw (new Error("Singleton and can only be accessed through Singleton.me()"));
};
}
public function get game():XML{
return (m_xmlData);
}
public static function me():XmlData{
return (instance);
}
}
}//package de.pixelate.mrbounce.level
Section 60
//MuteButton (de.pixelate.mrbounce.sound.MuteButton)
package de.pixelate.mrbounce.sound {
import de.pixelate.mrbounce.events.*;
import flash.events.*;
import flash.media.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
public class MuteButton extends Sprite {
private var m_hitSpriteWidth:int;// = 40
private var rect:Rectangle;
private var m_hitSprite:Sprite;
private var m_mute:Boolean;// = false
private var m_hitSpriteHeight:int;// = 60
private var m_lastPeak:Array;
private var m_lastPeakSpeed:int;// = 1
private var bytes:ByteArray;
public function MuteButton(){
m_lastPeak = new Array(0, 0, 0, 0, 0);
super();
this.x = 450;
this.y = 26;
this.alpha = 0.7;
}
public function destroy():void{
this.m_hitSprite.removeEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
this.m_hitSprite.removeEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
this.m_hitSprite.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
this.removeChild(this.m_hitSprite);
this.removeEventListener(Event.ENTER_FRAME, onEnterFrame);
}
private function onEnterFrame(_arg1:Event):void{
var _local2:Number;
var _local3:Number;
SoundMixer.computeSpectrum(bytes, true, 0);
this.graphics.clear();
var _local4:int;
while (_local4 < 5) {
_local2 = bytes.readFloat();
_local3 = (2 + (_local2 * 15));
if (this.m_lastPeak[_local4] > _local3){
_local3 = this.m_lastPeak[_local4];
};
this.m_lastPeak[_local4] = (_local3 - this.m_lastPeakSpeed);
rect.height = _local3;
rect.width = 3;
rect.x = (_local4 * (rect.width + 1));
rect.y = -(_local3);
this.graphics.beginFill(0xEDED);
this.graphics.drawRect(rect.x, rect.y, rect.width, rect.height);
this.graphics.endFill();
_local4++;
};
}
private function onMouseOver(_arg1:Event):void{
this.alpha = 1;
}
private function onMouseDown(_arg1:Event):void{
this.toggle();
}
public function init():void{
bytes = new ByteArray();
rect = new Rectangle(0, 0, 1, 0);
this.addEventListener(Event.ENTER_FRAME, onEnterFrame, false, 0, true);
this.m_hitSprite = new Sprite();
this.m_hitSprite.x = -10;
this.addChild(this.m_hitSprite);
this.m_hitSprite.y = (-(this.m_hitSpriteHeight) + 10);
this.m_hitSprite.graphics.beginFill(0xFFFFFF, 0);
this.m_hitSprite.graphics.drawRect(0, 0, this.m_hitSpriteWidth, this.m_hitSpriteHeight);
this.m_hitSprite.graphics.endFill();
this.m_hitSprite.buttonMode = true;
this.m_hitSprite.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver, false, 0, true);
this.m_hitSprite.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut, false, 0, true);
this.m_hitSprite.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);
}
public function toggle():void{
if (this.m_mute){
this.m_mute = false;
SoundControl.me().unmute();
} else {
this.m_mute = true;
SoundControl.me().mute();
};
dispatchToggleEvent();
}
private function onMouseOut(_arg1:Event):void{
this.alpha = 0.7;
}
private function dispatchToggleEvent():void{
var _local1:ToggleSoundEvent = new ToggleSoundEvent(this.m_mute);
this.dispatchEvent(_local1);
}
}
}//package de.pixelate.mrbounce.sound
Section 61
//SoundControl (de.pixelate.mrbounce.sound.SoundControl)
package de.pixelate.mrbounce.sound {
import flash.events.*;
import flash.media.*;
import mx.core.*;
import de.pixelate.mrbounce.level.*;
import flash.utils.*;
public final class SoundControl extends EventDispatcher {
private var soundAssetComplete4:SoundAsset;
public var soundSpeechTitle:Class;
private var soundAssetBackground1_1:SoundAsset;
private var soundAssetBackground1_2:SoundAsset;
private var soundAssetBackground1_4:SoundAsset;
private var soundAssetBackground1_5:SoundAsset;
private var soundAssetBackground1_3:SoundAsset;
public var soundBackground4_1:Class;
public var soundBackground4_2:Class;
public var soundBackground4_3:Class;
public var soundBackground4_4:Class;
public var soundBackground4_5:Class;
public var soundHurry:Class;
private var fadeTimer:Timer;
private var currentTimeBonusVolume:Number;
public var soundHitElement:Class;
private var isSoundMuted:Boolean;
public var soundBackground3_1:Class;
public var soundBackground3_2:Class;
public var soundBackground3_3:Class;
public var soundBackground3_4:Class;
public var soundBackground3_5:Class;
private var currentMusicVolume:Number;
public var soundHitComplete1:Class;
public var soundHitComplete2:Class;
public var soundHitComplete3:Class;
public var soundHitComplete4:Class;
public var soundHitComplete5:Class;
public var soundHitPaddle:Class;
private var soundAssetElement:SoundAsset;
public var soundBackground2_1:Class;
public var soundBackground2_2:Class;
public var soundBackground2_3:Class;
public var soundBackground2_4:Class;
public var soundBackground2_5:Class;
private var soundAssetSpeechTitle:SoundAsset;
private var timerBreak:Timer;
private var soundCompleteTimer:Timer;
private var soundChannelTimeBonus:SoundChannel;
private var soundChannelFX:SoundChannel;
public var soundExtraLife:Class;
public var soundCompleteTutorial:Class;
public var soundBackground1_2:Class;
public var soundBackground1_4:Class;
public var soundBackground1_1:Class;
public var soundButtonClick:Class;
public var soundBackground1_3:Class;
public var soundBackground1_5:Class;
private var soundAssetCompleteTutorial:SoundAsset;
public var soundTimeBonus:Class;
private var soundAssetExtraLife:SoundAsset;
public var soundButtonRollover:Class;
private var soundAssetBackground5_1:SoundAsset;
private var soundAssetBackground5_2:SoundAsset;
private var soundAssetBackground5_3:SoundAsset;
private var soundAssetBackground5_4:SoundAsset;
private var soundAssetBackground5_5:SoundAsset;
private var soundAssetTimeBonus:SoundAsset;
private var targetMusicVolume:Number;
private var soundAssetBackground4_1:SoundAsset;
private var soundAssetBackground4_2:SoundAsset;
private var soundAssetBackground4_3:SoundAsset;
private var soundAssetBackground4_4:SoundAsset;
private var soundAssetBackground4_5:SoundAsset;
private var soundAssetHurry:SoundAsset;
public var soundLostBall:Class;
private var soundAssetLostBall:SoundAsset;
private var soundChannelMusic:SoundChannel;
private var soundAssetButtonClick:SoundAsset;
private var soundAssetBackground3_1:SoundAsset;
private var soundAssetBackground3_2:SoundAsset;
private var soundAssetBackground3_3:SoundAsset;
private var soundAssetBackground3_4:SoundAsset;
private var soundAssetBackground3_5:SoundAsset;
private var soundAssetButtonRollover:SoundAsset;
private var currentSoundFxVolume:Number;
private var soundAssetBackground2_1:SoundAsset;
private var soundAssetBackground2_2:SoundAsset;
private var soundAssetBackground2_3:SoundAsset;
private var soundAssetBackground2_4:SoundAsset;
private var soundAssetBackground2_5:SoundAsset;
public var soundBackground5_2:Class;
public var soundBackground5_3:Class;
public var soundBackground5_4:Class;
public var soundBackground5_5:Class;
public var soundBackground5_1:Class;
private var soundAssetComplete2:SoundAsset;
private var soundAssetComplete3:SoundAsset;
private var soundAssetPaddle:SoundAsset;
private var soundAssetComplete5:SoundAsset;
private var soundAssetComplete1:SoundAsset;
private static const MUSIC_FULL_VOLUME:Number = 1;
private static const MUSIC_PAUSE_VOLUME:Number = 0.4;
private static var instance:SoundControl = new (SoundControl);
;
public function SoundControl(){
soundSpeechTitle = SoundControl_soundSpeechTitle;
soundButtonClick = SoundControl_soundButtonClick;
soundButtonRollover = SoundControl_soundButtonRollover;
soundHitPaddle = SoundControl_soundHitPaddle;
soundLostBall = SoundControl_soundLostBall;
soundExtraLife = SoundControl_soundExtraLife;
soundHurry = SoundControl_soundHurry;
soundTimeBonus = SoundControl_soundTimeBonus;
soundHitElement = SoundControl_soundHitElement;
soundCompleteTutorial = SoundControl_soundCompleteTutorial;
soundHitComplete1 = SoundControl_soundHitComplete1;
soundHitComplete2 = SoundControl_soundHitComplete2;
soundHitComplete3 = SoundControl_soundHitComplete3;
soundHitComplete4 = SoundControl_soundHitComplete4;
soundHitComplete5 = SoundControl_soundHitComplete5;
soundBackground1_1 = SoundControl_soundBackground1_1;
soundBackground1_2 = SoundControl_soundBackground1_2;
soundBackground1_3 = SoundControl_soundBackground1_3;
soundBackground1_4 = SoundControl_soundBackground1_4;
soundBackground1_5 = SoundControl_soundBackground1_5;
soundBackground2_1 = SoundControl_soundBackground2_1;
soundBackground2_2 = SoundControl_soundBackground2_2;
soundBackground2_3 = SoundControl_soundBackground2_3;
soundBackground2_4 = SoundControl_soundBackground2_4;
soundBackground2_5 = SoundControl_soundBackground2_5;
soundBackground3_1 = SoundControl_soundBackground3_1;
soundBackground3_2 = SoundControl_soundBackground3_2;
soundBackground3_3 = SoundControl_soundBackground3_3;
soundBackground3_4 = SoundControl_soundBackground3_4;
soundBackground3_5 = SoundControl_soundBackground3_5;
soundBackground4_1 = SoundControl_soundBackground4_1;
soundBackground4_2 = SoundControl_soundBackground4_2;
soundBackground4_3 = SoundControl_soundBackground4_3;
soundBackground4_4 = SoundControl_soundBackground4_4;
soundBackground4_5 = SoundControl_soundBackground4_5;
soundBackground5_1 = SoundControl_soundBackground5_1;
soundBackground5_2 = SoundControl_soundBackground5_2;
soundBackground5_3 = SoundControl_soundBackground5_3;
soundBackground5_4 = SoundControl_soundBackground5_4;
soundBackground5_5 = SoundControl_soundBackground5_5;
soundAssetSpeechTitle = (new soundSpeechTitle() as SoundAsset);
soundAssetButtonClick = (new soundButtonClick() as SoundAsset);
soundAssetButtonRollover = (new soundButtonRollover() as SoundAsset);
soundAssetCompleteTutorial = (new soundCompleteTutorial() as SoundAsset);
soundAssetElement = (new soundHitElement() as SoundAsset);
soundAssetPaddle = (new soundHitPaddle() as SoundAsset);
soundAssetLostBall = (new soundLostBall() as SoundAsset);
soundAssetExtraLife = (new soundExtraLife() as SoundAsset);
soundAssetHurry = (new soundHurry() as SoundAsset);
soundAssetTimeBonus = (new soundTimeBonus() as SoundAsset);
soundAssetComplete1 = (new soundHitComplete1() as SoundAsset);
soundAssetComplete2 = (new soundHitComplete2() as SoundAsset);
soundAssetComplete3 = (new soundHitComplete3() as SoundAsset);
soundAssetComplete4 = (new soundHitComplete4() as SoundAsset);
soundAssetComplete5 = (new soundHitComplete5() as SoundAsset);
soundAssetBackground1_1 = (new soundBackground1_1() as SoundAsset);
soundAssetBackground1_2 = (new soundBackground1_2() as SoundAsset);
soundAssetBackground1_3 = (new soundBackground1_3() as SoundAsset);
soundAssetBackground1_4 = (new soundBackground1_4() as SoundAsset);
soundAssetBackground1_5 = (new soundBackground1_5() as SoundAsset);
soundAssetBackground2_1 = (new soundBackground2_1() as SoundAsset);
soundAssetBackground2_2 = (new soundBackground2_2() as SoundAsset);
soundAssetBackground2_3 = (new soundBackground2_3() as SoundAsset);
soundAssetBackground2_4 = (new soundBackground2_4() as SoundAsset);
soundAssetBackground2_5 = (new soundBackground2_5() as SoundAsset);
soundAssetBackground3_1 = (new soundBackground3_1() as SoundAsset);
soundAssetBackground3_2 = (new soundBackground3_2() as SoundAsset);
soundAssetBackground3_3 = (new soundBackground3_3() as SoundAsset);
soundAssetBackground3_4 = (new soundBackground3_4() as SoundAsset);
soundAssetBackground3_5 = (new soundBackground3_5() as SoundAsset);
soundAssetBackground4_1 = (new soundBackground4_1() as SoundAsset);
soundAssetBackground4_2 = (new soundBackground4_2() as SoundAsset);
soundAssetBackground4_3 = (new soundBackground4_3() as SoundAsset);
soundAssetBackground4_4 = (new soundBackground4_4() as SoundAsset);
soundAssetBackground4_5 = (new soundBackground4_5() as SoundAsset);
soundAssetBackground5_1 = (new soundBackground5_1() as SoundAsset);
soundAssetBackground5_2 = (new soundBackground5_2() as SoundAsset);
soundAssetBackground5_3 = (new soundBackground5_3() as SoundAsset);
soundAssetBackground5_4 = (new soundBackground5_4() as SoundAsset);
soundAssetBackground5_5 = (new soundBackground5_5() as SoundAsset);
timerBreak = new Timer(500, 1);
fadeTimer = new Timer(50);
super();
if (instance){
throw (new Error("Singleton and can only be accessed through Singleton.me()"));
};
isSoundMuted = false;
currentSoundFxVolume = 0;
currentTimeBonusVolume = 0;
targetMusicVolume = 0;
currentMusicVolume = MUSIC_FULL_VOLUME;
}
private function onTimerBreak(_arg1:TimerEvent):void{
var _local2:int = LevelDataHolder.me().getCurrentStageId();
var _local3:SoundAsset = this[("soundAssetComplete" + _local2)];
this.playSoundFxChannel(_local3, 1, 0);
this.soundCompleteTimer = new Timer(_local3.length, 1);
this.soundCompleteTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onFillinComplete, false, 0, true);
this.soundCompleteTimer.start();
this.timerBreak.stop();
this.timerBreak.removeEventListener(TimerEvent.TIMER_COMPLETE, onTimerBreak);
}
public function playHitPaddle():void{
this.playSoundFxChannel(soundAssetPaddle, 0.7, 25);
}
public function playBackgroundLoopEnding():void{
playTrack(true);
}
private function playSoundFxChannel(_arg1:SoundAsset, _arg2:Number, _arg3:int):void{
if (isSoundMuted){
currentSoundFxVolume = 0;
} else {
currentSoundFxVolume = _arg2;
};
this.soundChannelFX = _arg1.play(_arg3, 0, new SoundTransform(currentSoundFxVolume, 0));
}
public function mute():void{
isSoundMuted = true;
if (this.soundChannelMusic){
if (fadeTimer.running){
fadeTimer.reset();
fadeTimer.removeEventListener(TimerEvent.TIMER, onFadeMusic);
};
this.soundChannelMusic.soundTransform = new SoundTransform(0, 0);
};
if (this.soundChannelFX){
this.soundChannelFX.soundTransform = new SoundTransform(0, 0);
};
if (this.soundChannelTimeBonus){
this.soundChannelTimeBonus.soundTransform = new SoundTransform(0, 0);
};
}
public function unmute():void{
isSoundMuted = false;
if (this.soundChannelMusic){
this.soundChannelMusic.soundTransform = new SoundTransform(currentMusicVolume, 0);
};
if (this.soundChannelFX){
this.soundChannelFX.soundTransform = new SoundTransform(currentSoundFxVolume, 0);
};
if (this.soundChannelTimeBonus){
this.soundChannelTimeBonus.soundTransform = new SoundTransform(currentTimeBonusVolume, 0);
};
}
public function playExtraLife():void{
this.playSoundFxChannel(soundAssetExtraLife, 0.1, 10);
}
private function playMusicChannel(_arg1:SoundAsset, _arg2:int):void{
var _local3:Number;
if (isSoundMuted){
_local3 = 0;
} else {
_local3 = currentMusicVolume;
};
this.soundChannelMusic = _arg1.play(_arg2, 10000, new SoundTransform(_local3, 0));
}
public function playButtonRollover():void{
this.playSoundFxChannel(soundAssetButtonRollover, 1, 25);
}
public function playTimeBonus():void{
if (isSoundMuted){
this.currentTimeBonusVolume = 0;
} else {
this.currentTimeBonusVolume = 0.325;
};
this.soundChannelTimeBonus = soundAssetTimeBonus.play(25, 10000, new SoundTransform(this.currentTimeBonusVolume, 0));
}
private function playTrack(_arg1:Boolean=false):void{
var _local2:int = LevelDataHolder.me().getCurrentStageId();
var _local3:int = (LevelDataHolder.me().getCurrentLevelId() + 1);
if (_arg1){
if (_local3 == 4){
_local3 = 5;
};
};
var _local4:String = ((("soundAssetBackground" + _local2) + "_") + _local3);
stopBackgroundLoop();
playMusicChannel(this[_local4], 25);
}
public function playLostBall():void{
this.playSoundFxChannel(soundAssetLostBall, 0.3, 24);
}
public function turnMusicVolumeDown():void{
targetMusicVolume = MUSIC_PAUSE_VOLUME;
startMusicFade();
}
public function playHitBonusComplete():void{
this.timerBreak.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerBreak, false, 0, true);
this.timerBreak.start();
}
private function onFillinComplete(_arg1:TimerEvent):void{
LevelDataHolder.me().dispatchLevelClearedEvent();
this.soundCompleteTimer.reset();
this.soundCompleteTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onFillinComplete);
}
public function turnMusicVolumeUp():void{
targetMusicVolume = MUSIC_FULL_VOLUME;
startMusicFade();
}
public function playCompleteTutorial():void{
this.playSoundFxChannel(soundAssetCompleteTutorial, 0.2, 22);
}
public function stopAllChannels():void{
if (this.soundChannelMusic){
if (fadeTimer.running){
fadeTimer.reset();
fadeTimer.removeEventListener(TimerEvent.TIMER, onFadeMusic);
};
this.soundChannelMusic.stop();
};
if (this.soundChannelFX){
this.soundChannelFX.stop();
};
if (this.soundChannelTimeBonus){
this.soundChannelTimeBonus.stop();
};
}
public function playHurry():void{
this.playSoundFxChannel(soundAssetHurry, 0.3, 11);
}
public function playBackgroundLoop():void{
playTrack();
}
public function stopTimeBonus():void{
if (this.soundChannelTimeBonus){
this.soundChannelTimeBonus.stop();
};
}
public function stopBackgroundLoop():void{
if (this.soundChannelMusic){
this.soundChannelMusic.stop();
};
}
public function playHitBonus():void{
this.playSoundFxChannel(soundAssetElement, 0.325, 25);
}
public function playButtonClick():void{
this.playSoundFxChannel(soundAssetButtonClick, 1, 25);
}
public function speakTitle():void{
this.playSoundFxChannel(soundAssetSpeechTitle, 1, 82);
}
public function getSoundChannelFX():SoundChannel{
return (soundChannelFX);
}
private function onFadeMusic(_arg1:TimerEvent):void{
if (targetMusicVolume > currentMusicVolume){
currentMusicVolume = (currentMusicVolume + 0.1);
} else {
currentMusicVolume = (currentMusicVolume - 0.1);
};
if (currentMusicVolume >= MUSIC_FULL_VOLUME){
currentMusicVolume = MUSIC_FULL_VOLUME;
this.removeEventListener(Event.ENTER_FRAME, onFadeMusic);
} else {
if (currentMusicVolume <= MUSIC_PAUSE_VOLUME){
currentMusicVolume = MUSIC_PAUSE_VOLUME;
this.removeEventListener(Event.ENTER_FRAME, onFadeMusic);
};
};
if (!isSoundMuted){
this.soundChannelMusic.soundTransform = new SoundTransform(currentMusicVolume, 0);
};
}
public function startMusicFade():void{
if (this.soundChannelMusic){
if (fadeTimer.running){
fadeTimer.reset();
fadeTimer.removeEventListener(TimerEvent.TIMER, onFadeMusic);
};
fadeTimer.addEventListener(TimerEvent.TIMER, onFadeMusic, false, 0, true);
fadeTimer.start();
};
}
public static function me():SoundControl{
return (instance);
}
}
}//package de.pixelate.mrbounce.sound
Section 62
//SoundControl_soundBackground1_1 (de.pixelate.mrbounce.sound.SoundControl_soundBackground1_1)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground1_1 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 63
//SoundControl_soundBackground1_2 (de.pixelate.mrbounce.sound.SoundControl_soundBackground1_2)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground1_2 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 64
//SoundControl_soundBackground1_3 (de.pixelate.mrbounce.sound.SoundControl_soundBackground1_3)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground1_3 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 65
//SoundControl_soundBackground1_4 (de.pixelate.mrbounce.sound.SoundControl_soundBackground1_4)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground1_4 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 66
//SoundControl_soundBackground1_5 (de.pixelate.mrbounce.sound.SoundControl_soundBackground1_5)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground1_5 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 67
//SoundControl_soundBackground2_1 (de.pixelate.mrbounce.sound.SoundControl_soundBackground2_1)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground2_1 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 68
//SoundControl_soundBackground2_2 (de.pixelate.mrbounce.sound.SoundControl_soundBackground2_2)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground2_2 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 69
//SoundControl_soundBackground2_3 (de.pixelate.mrbounce.sound.SoundControl_soundBackground2_3)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground2_3 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 70
//SoundControl_soundBackground2_4 (de.pixelate.mrbounce.sound.SoundControl_soundBackground2_4)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground2_4 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 71
//SoundControl_soundBackground2_5 (de.pixelate.mrbounce.sound.SoundControl_soundBackground2_5)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground2_5 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 72
//SoundControl_soundBackground3_1 (de.pixelate.mrbounce.sound.SoundControl_soundBackground3_1)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground3_1 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 73
//SoundControl_soundBackground3_2 (de.pixelate.mrbounce.sound.SoundControl_soundBackground3_2)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground3_2 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 74
//SoundControl_soundBackground3_3 (de.pixelate.mrbounce.sound.SoundControl_soundBackground3_3)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground3_3 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 75
//SoundControl_soundBackground3_4 (de.pixelate.mrbounce.sound.SoundControl_soundBackground3_4)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground3_4 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 76
//SoundControl_soundBackground3_5 (de.pixelate.mrbounce.sound.SoundControl_soundBackground3_5)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground3_5 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 77
//SoundControl_soundBackground4_1 (de.pixelate.mrbounce.sound.SoundControl_soundBackground4_1)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground4_1 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 78
//SoundControl_soundBackground4_2 (de.pixelate.mrbounce.sound.SoundControl_soundBackground4_2)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground4_2 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 79
//SoundControl_soundBackground4_3 (de.pixelate.mrbounce.sound.SoundControl_soundBackground4_3)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground4_3 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 80
//SoundControl_soundBackground4_4 (de.pixelate.mrbounce.sound.SoundControl_soundBackground4_4)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground4_4 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 81
//SoundControl_soundBackground4_5 (de.pixelate.mrbounce.sound.SoundControl_soundBackground4_5)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground4_5 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 82
//SoundControl_soundBackground5_1 (de.pixelate.mrbounce.sound.SoundControl_soundBackground5_1)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground5_1 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 83
//SoundControl_soundBackground5_2 (de.pixelate.mrbounce.sound.SoundControl_soundBackground5_2)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground5_2 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 84
//SoundControl_soundBackground5_3 (de.pixelate.mrbounce.sound.SoundControl_soundBackground5_3)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground5_3 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 85
//SoundControl_soundBackground5_4 (de.pixelate.mrbounce.sound.SoundControl_soundBackground5_4)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground5_4 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 86
//SoundControl_soundBackground5_5 (de.pixelate.mrbounce.sound.SoundControl_soundBackground5_5)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundBackground5_5 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 87
//SoundControl_soundButtonClick (de.pixelate.mrbounce.sound.SoundControl_soundButtonClick)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundButtonClick extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 88
//SoundControl_soundButtonRollover (de.pixelate.mrbounce.sound.SoundControl_soundButtonRollover)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundButtonRollover extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 89
//SoundControl_soundCompleteTutorial (de.pixelate.mrbounce.sound.SoundControl_soundCompleteTutorial)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundCompleteTutorial extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 90
//SoundControl_soundExtraLife (de.pixelate.mrbounce.sound.SoundControl_soundExtraLife)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundExtraLife extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 91
//SoundControl_soundHitComplete1 (de.pixelate.mrbounce.sound.SoundControl_soundHitComplete1)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundHitComplete1 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 92
//SoundControl_soundHitComplete2 (de.pixelate.mrbounce.sound.SoundControl_soundHitComplete2)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundHitComplete2 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 93
//SoundControl_soundHitComplete3 (de.pixelate.mrbounce.sound.SoundControl_soundHitComplete3)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundHitComplete3 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 94
//SoundControl_soundHitComplete4 (de.pixelate.mrbounce.sound.SoundControl_soundHitComplete4)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundHitComplete4 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 95
//SoundControl_soundHitComplete5 (de.pixelate.mrbounce.sound.SoundControl_soundHitComplete5)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundHitComplete5 extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 96
//SoundControl_soundHitElement (de.pixelate.mrbounce.sound.SoundControl_soundHitElement)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundHitElement extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 97
//SoundControl_soundHitPaddle (de.pixelate.mrbounce.sound.SoundControl_soundHitPaddle)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundHitPaddle extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 98
//SoundControl_soundHurry (de.pixelate.mrbounce.sound.SoundControl_soundHurry)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundHurry extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 99
//SoundControl_soundLostBall (de.pixelate.mrbounce.sound.SoundControl_soundLostBall)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundLostBall extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 100
//SoundControl_soundSpeechTitle (de.pixelate.mrbounce.sound.SoundControl_soundSpeechTitle)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundSpeechTitle extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 101
//SoundControl_soundTimeBonus (de.pixelate.mrbounce.sound.SoundControl_soundTimeBonus)
package de.pixelate.mrbounce.sound {
import mx.core.*;
public class SoundControl_soundTimeBonus extends SoundAsset {
}
}//package de.pixelate.mrbounce.sound
Section 102
//Bulletin (de.pixelate.mrbounce.text.Bulletin)
package de.pixelate.mrbounce.text {
import flash.events.*;
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.utilities.*;
import flash.geom.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import flash.filters.*;
public class Bulletin extends Sprite {
private var m_quedInstruction:String;
private var m_colorTransformAnim:ColorTransformAnim;
private var m_permanentBlinkTime:int;
protected var m_permanentInstruction:String;
private var m_quedFadeTime:int;
private var m_defaultColorTransform:ColorTransform;
private var m_tickerBlink:Timer;
private var m_isFadingIn:Boolean;
private var m_isBlinking:Boolean;
private var m_currentInstruction:String;
private var textfield:DefaultText;
private var m_tickerFade:Timer;
private var m_isFadingOut:Boolean;
private var m_quedBlinkTime:int;
public function Bulletin(){
textfield = new DefaultText();
this.addChild(textfield);
textfield.autoSize = TextFieldAutoSize.CENTER;
textfield.textColor = 0xFFFF;
var _local1:TextFormat = new TextFormat();
_local1.font = "75 Helvetica Bold";
_local1.size = 14;
_local1.letterSpacing = 0;
_local1.leading = 2;
_local1.align = "center";
textfield.defaultTextFormat = _local1;
this.m_currentInstruction = null;
this.m_permanentInstruction = null;
this.m_quedInstruction = null;
this.m_quedFadeTime = 0;
this.m_quedBlinkTime = 0;
this.m_permanentBlinkTime = 0;
this.m_isBlinking = false;
this.m_isFadingIn = false;
this.m_isFadingOut = false;
this.x = (World.BORDER_RIGHT / 2);
this.m_defaultColorTransform = textfield.transform.colorTransform;
setGlow();
}
public function display(_arg1:String, _arg2:int=0, _arg3:int=0, _arg4:Boolean=false):void{
if (_arg4){
this.m_permanentInstruction = _arg1;
this.m_permanentBlinkTime = _arg3;
};
if (this.m_currentInstruction == null){
this.m_currentInstruction = _arg1;
textfield.text = _arg1;
textfield.x = (-(width) / 2);
textfield.y = (-(height) / 2);
this.alpha = 0;
if (this.m_tickerFade){
this.m_tickerFade.stop();
this.m_tickerFade.reset();
if (this.m_tickerFade.hasEventListener(TimerEvent.TIMER_COMPLETE)){
removeEventListener(TimerEvent.TIMER_COMPLETE, onWaitForClear);
};
};
if (this.m_tickerBlink){
this.m_tickerBlink.stop();
this.m_tickerBlink.reset();
if (this.m_tickerBlink.hasEventListener(TimerEvent.TIMER_COMPLETE)){
removeEventListener(TimerEvent.TIMER_COMPLETE, onWaitForBlink);
};
};
if (this.m_isFadingOut){
removeEventListener(Event.ENTER_FRAME, onFadeIn);
this.m_isFadingOut = false;
};
this.m_isFadingIn = true;
addEventListener(Event.ENTER_FRAME, onFadeIn, false, 0, true);
if (_arg2 > 0){
this.m_tickerFade = new Timer(_arg2, 1);
this.m_tickerFade.addEventListener(TimerEvent.TIMER_COMPLETE, onWaitForClear, false, 0, true);
this.m_tickerFade.start();
};
if (_arg3 > 0){
this.m_tickerBlink = new Timer(_arg3, 1);
this.m_tickerBlink.addEventListener(TimerEvent.TIMER_COMPLETE, onWaitForBlink, false, 0, true);
this.m_tickerBlink.start();
};
} else {
this.m_quedInstruction = _arg1;
this.m_quedFadeTime = _arg2;
this.m_quedBlinkTime = _arg3;
this.clear();
};
}
private function checkPermanent():void{
if (this.m_permanentInstruction != null){
if (this.m_currentInstruction == null){
this.display(this.m_permanentInstruction, 0, this.m_permanentBlinkTime, true);
};
};
}
private function onFadeIn(_arg1:Event):void{
this.alpha = (this.alpha + 0.05);
if (this.alpha >= 1){
this.m_isFadingIn = false;
removeEventListener(Event.ENTER_FRAME, onFadeIn);
};
}
private function setGlow():void{
var _local1:Number = 3;
var _local2:Number = 0.9;
var _local3:Number = 8;
var _local4:Number = 8;
var _local5:GlowFilter = new GlowFilter(0, _local2, _local3, _local4, _local1);
this.filters = [_local5];
}
private function clearInstruction():void{
this.m_currentInstruction = null;
checkQue();
checkPermanent();
}
private function onFadeOut(_arg1:Event):void{
this.alpha = (this.alpha - 0.05);
if (this.alpha <= 0){
this.m_isFadingOut = false;
removeEventListener(Event.ENTER_FRAME, onFadeOut);
clearInstruction();
};
}
public function clear():void{
if (this.m_isBlinking){
removeEventListener(Event.ENTER_FRAME, onBlink);
textfield.transform.colorTransform = this.m_defaultColorTransform;
this.m_isBlinking = false;
};
if (this.m_tickerBlink){
this.m_tickerBlink.reset();
if (this.m_tickerBlink.hasEventListener(TimerEvent.TIMER_COMPLETE)){
removeEventListener(TimerEvent.TIMER_COMPLETE, onWaitForBlink);
};
};
if (this.m_isFadingIn){
removeEventListener(Event.ENTER_FRAME, onFadeIn);
this.m_isFadingIn = false;
};
this.m_isFadingOut = true;
addEventListener(Event.ENTER_FRAME, onFadeOut, false, 0, true);
}
private function checkQue():void{
if (this.m_quedInstruction != null){
this.display(this.m_quedInstruction, this.m_quedFadeTime, this.m_quedBlinkTime);
this.m_quedFadeTime = 0;
this.m_quedBlinkTime = 0;
this.m_quedInstruction = null;
};
}
private function onWaitForBlink(_arg1:TimerEvent):void{
this.m_isBlinking = true;
this.m_colorTransformAnim = new ColorTransformAnim(textfield.transform.colorTransform, new Array(8454143, 0, 0xFFFF), 10);
this.addEventListener(Event.ENTER_FRAME, onBlink, false, 0, true);
this.m_tickerBlink.stop();
this.m_tickerBlink.removeEventListener(TimerEvent.TIMER_COMPLETE, onWaitForBlink);
}
private function onWaitForClear(_arg1:TimerEvent):void{
this.clear();
this.m_tickerFade.stop();
this.m_tickerFade.removeEventListener(TimerEvent.TIMER_COMPLETE, onWaitForClear);
}
private function onBlink(_arg1:Event):void{
textfield.transform.colorTransform = this.m_colorTransformAnim.getNextTransform();
}
}
}//package de.pixelate.mrbounce.text
Section 103
//BulletinPause (de.pixelate.mrbounce.text.BulletinPause)
package de.pixelate.mrbounce.text {
public class BulletinPause extends Bulletin {
public function BulletinPause(){
this.y = 200;
}
public function displayPause():void{
this.display("Pause", 0, 0, false);
}
}
}//package de.pixelate.mrbounce.text
Section 104
//DefaultText (de.pixelate.mrbounce.text.DefaultText)
package de.pixelate.mrbounce.text {
import flash.text.*;
public class DefaultText extends TextField {
protected var m_textFormat:TextFormat;
public function DefaultText(){
textColor = 0xFFFFFF;
autoSize = TextFieldAutoSize.LEFT;
background = false;
border = false;
selectable = false;
embedFonts = true;
this.m_textFormat = new TextFormat();
this.m_textFormat.font = "75 Helvetica Bold";
this.m_textFormat.size = 14;
this.m_textFormat.color = 0xEDED;
this.m_textFormat.align = "left";
this.defaultTextFormat = m_textFormat;
}
public function setTextSize(_arg1:int):void{
m_textFormat.size = _arg1;
this.defaultTextFormat = m_textFormat;
}
}
}//package de.pixelate.mrbounce.text
Section 105
//EndScreen (de.pixelate.mrbounce.text.EndScreen)
package de.pixelate.mrbounce.text {
import flash.display.*;
public class EndScreen extends Sprite {
private var m_background:EndScreenBackground;
private var m_highscoreList:HighscoreList;
public function EndScreen(){
this.m_background = new EndScreenBackground();
this.addChild(this.m_background);
this.m_highscoreList = new HighscoreList();
this.addChild(this.m_highscoreList);
}
public function hide():void{
this.m_background.hide();
}
public function show():void{
this.m_background.show();
}
}
}//package de.pixelate.mrbounce.text
Section 106
//EndScreenBackground (de.pixelate.mrbounce.text.EndScreenBackground)
package de.pixelate.mrbounce.text {
import flash.events.*;
import de.pixelate.mrbounce.level.*;
import flash.display.*;
public class EndScreenBackground extends Sprite {
public function EndScreenBackground(){
visible = false;
draw();
}
private function onFadeIn(_arg1:Event):void{
this.alpha = (this.alpha + 0.2);
if (this.alpha >= 0.8){
this.alpha = 0.8;
removeEventListener(Event.ENTER_FRAME, onFadeIn);
};
}
public function hide():void{
visible = false;
}
private function draw():void{
this.graphics.clear();
this.graphics.lineStyle(0, 0, 0);
this.graphics.beginFill(0, 1);
this.graphics.drawRect(0, 0, World.BORDER_RIGHT, (World.BORDER_BOTTOM - 40));
this.graphics.endFill();
}
public function show():void{
alpha = 0;
visible = true;
addEventListener(Event.ENTER_FRAME, onFadeIn, false, 0, true);
}
}
}//package de.pixelate.mrbounce.text
Section 107
//HighscoreList (de.pixelate.mrbounce.text.HighscoreList)
package de.pixelate.mrbounce.text {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
public class HighscoreList extends Sprite {
private var m_fadeInTimer:Timer;
private var m_currentRowToFade:int;
private var m_rows:Array;
private static const POSITIONS_REFERENCE:Array = new Array("st", "nd", "th", "th", "th", "th", "th", "th", "th", "th");
private static const NUM_OF_ROWS:int = 10;
private static const POSITIONS:Array = new Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10");
public function HighscoreList(){
this.m_rows = new Array();
this.createRows();
this.x = 89;
this.y = 50;
}
public function hide():void{
this.visible = false;
var _local1:int;
while (_local1 < NUM_OF_ROWS) {
this.m_rows[_local1].reset();
_local1++;
};
}
private function onFinishFadeRows(_arg1:TimerEvent):void{
this.m_fadeInTimer.reset();
this.m_fadeInTimer.removeEventListener(TimerEvent.TIMER, onFadeInRow);
this.m_fadeInTimer.removeEventListener(TimerEvent.TIMER_COMPLETE, onFinishFadeRows);
this.m_fadeInTimer = null;
}
public function display():void{
this.visible = true;
this.m_currentRowToFade = 0;
this.m_fadeInTimer = new Timer(200, this.m_rows.length);
this.m_fadeInTimer.addEventListener(TimerEvent.TIMER, onFadeInRow, false, 0, true);
this.m_fadeInTimer.addEventListener(TimerEvent.TIMER_COMPLETE, onFinishFadeRows, false, 0, true);
this.m_fadeInTimer.start();
}
private function onFadeInRow(_arg1:TimerEvent):void{
this.m_rows[this.m_currentRowToFade].fadeIn();
this.m_currentRowToFade++;
}
private function createRows():void{
var _local2:HighscoreRow;
var _local3:int;
var _local1:int;
while (_local1 < NUM_OF_ROWS) {
_local2 = new HighscoreRow();
_local2.x = 0;
_local2.y = (25 * _local1);
_local3 = (5000 * _local1);
_local2.setData(POSITIONS[_local1], POSITIONS_REFERENCE[_local1], "ABCDEFGHIJKLMNOP", _local3.toString());
this.addChild(_local2);
this.m_rows.push(_local2);
_local1++;
};
}
}
}//package de.pixelate.mrbounce.text
Section 108
//HighscoreRow (de.pixelate.mrbounce.text.HighscoreRow)
package de.pixelate.mrbounce.text {
import flash.events.*;
import flash.display.*;
import flash.text.*;
public class HighscoreRow extends Sprite {
private var m_score:DefaultText;
private var m_positionRef:DefaultText;
private var m_position:DefaultText;
private var m_name:DefaultText;
public function HighscoreRow(){
this.m_position = new DefaultText();
this.m_positionRef = new DefaultText();
this.m_name = new DefaultText();
this.m_score = new DefaultText();
this.m_score.autoSize = TextFieldAutoSize.RIGHT;
var _local1:TextFormat = this.m_score.getTextFormat();
_local1.align = "right";
this.m_score.defaultTextFormat = _local1;
this.m_name.x = 40;
this.m_score.x = 300;
this.alpha = 0;
this.addChild(this.m_position);
this.addChild(this.m_positionRef);
this.addChild(this.m_name);
this.addChild(this.m_score);
}
public function fadeIn():void{
addEventListener(Event.ENTER_FRAME, onFadeIn, false, 0, true);
}
private function onFadeIn(_arg1:Event):void{
this.alpha = (this.alpha + 0.05);
if (this.alpha >= 1){
removeEventListener(Event.ENTER_FRAME, onFadeIn);
};
}
public function setData(_arg1:String, _arg2:String, _arg3:String, _arg4:String):void{
this.m_position.text = _arg1;
this.m_positionRef.text = _arg2;
this.m_name.text = _arg3;
this.m_score.text = _arg4;
var _local5:TextFormat = this.m_position.getTextFormat();
_local5.size = 10;
this.m_positionRef.setTextFormat(_local5);
this.m_positionRef.x = this.m_position.textWidth;
if (_arg1 != "1"){
this.m_positionRef.x = (this.m_positionRef.x + 1);
};
}
public function reset():void{
this.alpha = 0;
}
}
}//package de.pixelate.mrbounce.text
Section 109
//Instructions (de.pixelate.mrbounce.text.Instructions)
package de.pixelate.mrbounce.text {
public class Instructions extends Bulletin {
private static var BLINK_TIME:int = 10000;
public function Instructions(){
this.y = 380;
}
public function displayLostBallAndTimeBonus():void{
this.display("Lost ball and time bonus");
}
public function displayTutorialSlowmo():void{
this.display("Hold Space key to slow down ball", 0, BLINK_TIME, true);
}
public function displayTutorialHorizontal():void{
this.display("Use Left and Right arrow keys to move", 0, BLINK_TIME, true);
}
public function displayLostBall():void{
this.display("Lost ball");
}
public function displayFinishedGame():void{
this.display("You made it!\nPress Shift key or mouse button to play again", 0, 5000);
}
public function displayGameOver():void{
this.display("Game over\nPress Shift key or mouse button");
}
public function displayExtraLife():void{
this.display("Extra ball", 5000);
}
public function displayLevelClear():void{
this.display("Level cleared!\nNo time bonus", 0);
}
public function displayShortInfo(_arg1:String):void{
this.display(_arg1, 2000);
}
public function displayHurry():void{
this.display("Hurry up!", 5000);
}
public function displayTutorialStartGame():void{
var _local1 = "";
var _local2 = (("Let's go" + _local1) + "!");
this.display(_local2, 5000);
this.m_permanentInstruction = null;
}
public function displayTutorialVertical():void{
this.display("Use Up and Down arrow keys to set altitude", 0, BLINK_TIME, true);
}
public function displayLevelClearBonus():void{
this.display("Level cleared!\nAdding time bonus ...", 0);
}
public function displayWorldCleared(_arg1:int):void{
this.display((("World " + _arg1.toString()) + " cleared!\nPress Shift key or mouse button to continue"), 0, 5000);
}
public function displayPressMouseButton():void{
this.display("Press Shift key or mouse button to continue", 0, 5000);
}
public function displayConfirmQuitGame():void{
this.display("Do you want to quit and return to the main menu? (Y/N)");
}
}
}//package de.pixelate.mrbounce.text
Section 110
//LevelIndicator (de.pixelate.mrbounce.text.LevelIndicator)
package de.pixelate.mrbounce.text {
import de.pixelate.mrbounce.level.*;
import flash.text.*;
public class LevelIndicator extends DefaultText {
public function LevelIndicator(){
autoSize = TextFieldAutoSize.LEFT;
x = 185;
y = 16;
}
public function display():void{
var _local1:int = (LevelDataHolder.me().getCurrentLevelId() + 1);
var _local2:int = LevelDataHolder.me().getCurrentStageId();
text = ((_local2.toString() + "-") + _local1.toString());
}
}
}//package de.pixelate.mrbounce.text
Section 111
//Lives (de.pixelate.mrbounce.text.Lives)
package de.pixelate.mrbounce.text {
import flash.text.*;
public class Lives extends DefaultText {
public function Lives(){
this.x = 19;
this.y = 16;
autoSize = TextFieldAutoSize.LEFT;
}
public function hide():void{
this.visible = false;
}
public function display(_arg1:Number):void{
text = ("x" + _arg1.toString());
this.visible = true;
}
}
}//package de.pixelate.mrbounce.text
Section 112
//ScoreCombo (de.pixelate.mrbounce.text.ScoreCombo)
package de.pixelate.mrbounce.text {
import flash.text.*;
public class ScoreCombo extends DefaultText {
public function ScoreCombo(){
autoSize = TextFieldAutoSize.LEFT;
x = 235;
y = 16;
}
public function display(_arg1:Number):void{
text = _arg1.toString();
}
}
}//package de.pixelate.mrbounce.text
Section 113
//ScoreObject (de.pixelate.mrbounce.text.ScoreObject)
package de.pixelate.mrbounce.text {
import de.pixelate.mrbounce.base.*;
import flash.events.*;
public class ScoreObject extends BasicSprite {
private var textfield:DefaultText;
public function ScoreObject(_arg1:Number, _arg2:Number){
textfield = new DefaultText();
this.addChild(textfield);
x = _arg1;
y = _arg2;
}
private function onFadeIn(_arg1:Event):void{
this.scaleX = (this.scaleX + 0.02);
this.scaleY = (this.scaleY + 0.02);
this.alpha = (this.alpha + 0.1);
if (this.scaleX >= 1.25){
this.alpha = 1;
addEventListener(Event.ENTER_FRAME, onFadeOut, false, 0, true);
removeEventListener(Event.ENTER_FRAME, onFadeIn);
};
}
public function display(_arg1:Number, _arg2:uint):void{
textfield.textColor = _arg2;
textfield.text = _arg1.toString();
textfield.x = (-(width) / 2);
textfield.y = (-(height) / 2);
this.scaleX = 0.5;
this.scaleY = 0.5;
this.alpha = 0;
addEventListener(Event.ENTER_FRAME, onFadeIn, false, 0, true);
}
private function onFadeOut(_arg1:Event):void{
this.alpha = (this.alpha - 0.1);
if (this.alpha <= 0){
removeEventListener(Event.ENTER_FRAME, onFadeOut);
destroy();
};
}
}
}//package de.pixelate.mrbounce.text
Section 114
//StatusBar (de.pixelate.mrbounce.text.StatusBar)
package de.pixelate.mrbounce.text {
import de.pixelate.mrbounce.level.*;
import flash.display.*;
public class StatusBar extends Sprite {
private const BallIconAsset:Class;
private const StatusBarTextAsset:Class;
private var m_slowMotionEnergyBar:Sprite;
private var m_textLives:Lives;
private var m_ballIcons:Array;
private var m_textLevelIndicator:LevelIndicator;
private var m_textScore:ScoreCombo;
private var m_textWatch:Watch;
private var m_statusBarText:Bitmap;
private static const NUM_BALL_ICONS:int = 5;
public function StatusBar(){
StatusBarTextAsset = StatusBar_StatusBarTextAsset;
BallIconAsset = StatusBar_BallIconAsset;
super();
this.y = -(World.OFFSET_Y);
this.m_statusBarText = new StatusBarTextAsset();
this.addChild(this.m_statusBarText);
this.m_textScore = new ScoreCombo();
this.addChild(this.m_textScore);
this.m_textLevelIndicator = new LevelIndicator();
this.addChild(this.m_textLevelIndicator);
this.m_textWatch = new Watch();
this.addChild(this.m_textWatch);
this.m_textLives = new Lives();
this.addChild(this.m_textLives);
this.m_slowMotionEnergyBar = new Sprite();
this.addChild(this.m_slowMotionEnergyBar);
createBallIcons();
}
public function setSlowMotionEnergy(_arg1:Number):void{
var _local4:uint;
var _local2:Number = (_arg1 / 2);
var _local3:Number = 8;
if (_arg1 < 31){
_local4 = 0xFF0023;
} else {
_local4 = 0xEDED;
};
this.m_slowMotionEnergyBar.graphics.clear();
this.m_slowMotionEnergyBar.graphics.beginFill(_local4, 1);
this.m_slowMotionEnergyBar.graphics.drawRect(74, 22, _local2, _local3);
this.m_slowMotionEnergyBar.graphics.endFill();
}
public function showGame():void{
this.m_statusBarText.visible = true;
}
public function getTimeTextField():Watch{
return (this.m_textWatch);
}
public function getScoreTextField():ScoreCombo{
return (this.m_textScore);
}
public function getLevelTextField():LevelIndicator{
return (this.m_textLevelIndicator);
}
public function setInfoVisibility(_arg1:Boolean):void{
this.m_statusBarText.visible = _arg1;
this.m_textScore.visible = _arg1;
this.m_textLevelIndicator.visible = _arg1;
this.m_textWatch.visible = _arg1;
this.m_textLives.visible = _arg1;
this.m_slowMotionEnergyBar.visible = _arg1;
if (!_arg1){
hideBalls();
};
}
public function displayBalls(_arg1:int):void{
var _local2:int;
var _local3:int;
if (_arg1 > NUM_BALL_ICONS){
_local2 = 0;
while (_local2 < NUM_BALL_ICONS) {
if (_local2 == 0){
this.m_ballIcons[_local2].visible = true;
} else {
this.m_ballIcons[_local2].visible = false;
};
_local2++;
};
this.m_textLives.display(_arg1);
} else {
_local3 = 0;
while (_local3 < NUM_BALL_ICONS) {
if (_arg1 > _local3){
this.m_ballIcons[_local3].visible = true;
} else {
this.m_ballIcons[_local3].visible = false;
};
_local3++;
};
this.m_textLives.hide();
};
}
private function hideBalls():void{
var _local1:int;
while (_local1 < NUM_BALL_ICONS) {
this.m_ballIcons[_local1].visible = false;
_local1++;
};
}
private function createBallIcons():void{
this.m_ballIcons = new Array();
var _local1:Number = 10;
var _local2:Number = 22;
var _local3:Number = 10;
var _local4:int;
while (_local4 < NUM_BALL_ICONS) {
this.m_ballIcons[_local4] = new BallIconAsset();
this.m_ballIcons[_local4].x = _local1;
this.m_ballIcons[_local4].y = _local2;
this.m_ballIcons[_local4].visible = false;
this.addChild(m_ballIcons[_local4]);
_local1 = (_local1 + _local3);
_local4++;
};
}
}
}//package de.pixelate.mrbounce.text
Section 115
//StatusBar_BallIconAsset (de.pixelate.mrbounce.text.StatusBar_BallIconAsset)
package de.pixelate.mrbounce.text {
import mx.core.*;
public class StatusBar_BallIconAsset extends BitmapAsset {
}
}//package de.pixelate.mrbounce.text
Section 116
//StatusBar_StatusBarTextAsset (de.pixelate.mrbounce.text.StatusBar_StatusBarTextAsset)
package de.pixelate.mrbounce.text {
import mx.core.*;
public class StatusBar_StatusBarTextAsset extends BitmapAsset {
}
}//package de.pixelate.mrbounce.text
Section 117
//Watch (de.pixelate.mrbounce.text.Watch)
package de.pixelate.mrbounce.text {
import de.pixelate.mrbounce.events.*;
import de.pixelate.mrbounce.sound.*;
public class Watch extends DefaultText {
private var m_frameCounter:int;
private var m_isRunning:Boolean;
private var m_seconds:int;
private var m_isInitialzed:Boolean;
private var m_isAtZero:Boolean;
private static const PLAYTIME:int = 90;
public static const HURRY_THRESHOLD:int = 19;
private static const TARGET_FRAMERATE:int = 50;
public function Watch(){
x = 137;
y = 16;
this.m_isInitialzed = false;
this.m_isRunning = false;
this.m_frameCounter = 0;
}
public function start():void{
if (this.m_isInitialzed){
this.m_isRunning = true;
};
}
public function setToZero():void{
this.m_isAtZero = true;
this.m_seconds = 0;
display(true, true);
}
public function isHurry():Boolean{
if ((((this.m_seconds <= HURRY_THRESHOLD)) && (!(this.m_isAtZero)))){
return (true);
};
return (false);
}
public function update():void{
if (this.m_isRunning){
this.m_frameCounter++;
if (this.m_frameCounter == TARGET_FRAMERATE){
onTick();
this.m_frameCounter = 0;
};
};
}
public function stop():void{
if (this.m_isInitialzed){
this.m_isRunning = false;
};
}
public function init():void{
this.m_textFormat.color = 0xEDED;
this.defaultTextFormat = m_textFormat;
this.m_isAtZero = false;
this.m_isInitialzed = true;
this.m_seconds = PLAYTIME;
this.display(false);
this.start();
}
public function getSeconds():int{
return (this.m_seconds);
}
public function display(_arg1:Boolean, _arg2:Boolean=false):void{
var _local6:String;
var _local3:int = this.m_seconds;
var _local4:int;
while (_local3 > 59) {
_local4++;
_local3 = (_local3 - 60);
};
if ((((((_local4 == 0)) && ((_local3 == HURRY_THRESHOLD)))) && (_arg1))){
this.dispatchEvent(new WatchEvent(WatchEvent.HURRY));
};
if ((((((_local4 == 0)) && ((_local3 <= HURRY_THRESHOLD)))) && (_arg1))){
this.m_textFormat.color = 0xFF0023;
this.defaultTextFormat = m_textFormat;
if (!_arg2){
SoundControl.me().playHurry();
};
this.dispatchEvent(new WatchEvent(WatchEvent.SHRINK));
};
var _local5:String = _local4.toString();
if (_local3 < 10){
_local6 = ("0" + _local3.toString());
} else {
_local6 = _local3.toString();
};
text = ((_local5 + ":") + _local6);
}
private function onTick():void{
this.m_seconds--;
if (this.m_seconds < 0){
stop();
this.m_seconds = 0;
this.dispatchEvent(new WatchEvent(WatchEvent.TIMEUP));
} else {
this.display(true);
};
}
public function setSeconds(_arg1:int):void{
this.m_seconds = _arg1;
}
}
}//package de.pixelate.mrbounce.text
Section 118
//HelpScreen (de.pixelate.mrbounce.title.HelpScreen)
package de.pixelate.mrbounce.title {
import de.pixelate.mrbounce.events.*;
import flash.display.*;
public class HelpScreen extends Sprite {
private const HelpScreenAsset:Class;
private var backButton:TitleMenuButton;
public function HelpScreen(){
HelpScreenAsset = HelpScreen_HelpScreenAsset;
super();
}
public function init():void{
this.visible = false;
var _local1:Bitmap = new HelpScreenAsset();
this.addChild(_local1);
backButton = new TitleMenuButton(this, "Back to menu", TitleMenuSelectEvent.BACK_TO_MENU);
backButton.x = 198;
backButton.y = 450;
backButton.activate();
this.addChild(backButton);
}
}
}//package de.pixelate.mrbounce.title
Section 119
//HelpScreen_HelpScreenAsset (de.pixelate.mrbounce.title.HelpScreen_HelpScreenAsset)
package de.pixelate.mrbounce.title {
import mx.core.*;
public class HelpScreen_HelpScreenAsset extends BitmapAsset {
}
}//package de.pixelate.mrbounce.title
Section 120
//TitleMenuButton (de.pixelate.mrbounce.title.TitleMenuButton)
package de.pixelate.mrbounce.title {
import de.pixelate.mrbounce.events.*;
import flash.events.*;
import de.pixelate.mrbounce.sound.*;
import flash.display.*;
import de.pixelate.mrbounce.text.*;
import flash.text.*;
public class TitleMenuButton extends Sprite {
private const ButtonIcon:Class;
private var m_eventType:String;
private var m_hitSprite:Sprite;
private var m_isActive:Boolean;
private var textfield:DefaultText;
private var m_titleScreen:Sprite;
private var m_icon:Bitmap;
public function TitleMenuButton(_arg1:Sprite, _arg2:String, _arg3:String){
ButtonIcon = TitleMenuButton_ButtonIcon;
super();
m_titleScreen = _arg1;
m_eventType = _arg3;
m_isActive = false;
textfield = new DefaultText();
this.addChild(textfield);
textfield.textColor = 0xFFFF;
var _local4:TextFormat = new TextFormat();
_local4.font = "75 Helvetica Bold";
_local4.size = 10;
_local4.letterSpacing = 0;
_local4.leading = 2;
textfield.defaultTextFormat = _local4;
alpha = 0.2;
createHitSprite();
setText(_arg2);
this.m_icon = new ButtonIcon();
this.addChild(this.m_icon);
}
public function activate():void{
if (!this.m_isActive){
this.m_isActive = true;
alpha = 1;
initEvents();
};
}
private function onMouseOver(_arg1:MouseEvent):void{
SoundControl.me().playButtonRollover();
this.alpha = 0.5;
}
private function onMouseOut(_arg1:MouseEvent):void{
this.alpha = 1;
}
private function setText(_arg1:String):void{
textfield.text = _arg1;
textfield.x = 21;
textfield.y = -3;
drawHitSprite();
}
private function initEvents():void{
m_hitSprite.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver, false, 0, true);
m_hitSprite.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut, false, 0, true);
m_hitSprite.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);
m_hitSprite.buttonMode = true;
}
private function drawHitSprite():void{
m_hitSprite.graphics.clear();
m_hitSprite.graphics.beginFill(0, 0);
m_hitSprite.graphics.drawRect(0, 0, (textfield.width + textfield.x), textfield.height);
m_hitSprite.graphics.endFill();
}
private function onMouseDown(_arg1:MouseEvent):void{
SoundControl.me().playButtonClick();
m_titleScreen.dispatchEvent(new TitleMenuSelectEvent(m_eventType));
}
private function createHitSprite():void{
this.m_hitSprite = new Sprite();
this.addChild(this.m_hitSprite);
}
}
}//package de.pixelate.mrbounce.title
Section 121
//TitleMenuButton_ButtonIcon (de.pixelate.mrbounce.title.TitleMenuButton_ButtonIcon)
package de.pixelate.mrbounce.title {
import mx.core.*;
public class TitleMenuButton_ButtonIcon extends BitmapAsset {
}
}//package de.pixelate.mrbounce.title
Section 122
//TitleScreen (de.pixelate.mrbounce.title.TitleScreen)
package de.pixelate.mrbounce.title {
import de.pixelate.mrbounce.events.*;
import de.pixelate.mrbounce.game.*;
import de.pixelate.mrbounce.utilities.*;
import flash.display.*;
import de.pixelate.mrbounce.text.*;
import de.pixelate.pelikan.utilities.*;
public class TitleScreen extends Sprite {
private const TitleAsset:Class;
private var gotoWebsiteButton:TitleMenuButton;
private var Logo:Class;
private var helpButton:TitleMenuButton;
private var flashPlayerHint:DefaultText;
private var version:DefaultText;
private var startTutorialButton:TitleMenuButton;
private var startWorld2Button:TitleMenuButton;
private var startWorld3Button:TitleMenuButton;
private var startWorld4Button:TitleMenuButton;
private var startWorld1Button:TitleMenuButton;
private var startWorld5Button:TitleMenuButton;
public function TitleScreen(){
Logo = TitleScreen_Logo;
TitleAsset = TitleScreen_TitleAsset;
super();
}
public function updateStageSelectButtons():void{
var _local1:int = PlayerStats.getInstance().highestStage;
if (_local1 > 1){
startWorld2Button.activate();
};
if (_local1 > 2){
startWorld3Button.activate();
};
if (_local1 > 3){
startWorld4Button.activate();
};
if (_local1 > 4){
startWorld5Button.activate();
};
}
public function init():void{
var _local2:MovieClip;
this.visible = false;
var _local1:Bitmap = new TitleAsset();
this.addChild(_local1);
_local2 = new Logo();
_local2.x = 30;
_local2.y = 20;
this.addChild(_local2);
var _local3:Border = new Border();
this.addChild(_local3);
startTutorialButton = new TitleMenuButton(this, "Start Tutorial", TitleMenuSelectEvent.START_TUTORIAL);
startTutorialButton.x = 30;
startTutorialButton.y = 308;
startTutorialButton.activate();
startWorld1Button = new TitleMenuButton(this, "Start World 1", TitleMenuSelectEvent.START_WORLD_1);
startWorld1Button.x = 130;
startWorld1Button.y = 308;
startWorld1Button.activate();
startWorld2Button = new TitleMenuButton(this, "Start World 2", TitleMenuSelectEvent.START_WORLD_2);
startWorld2Button.x = 230;
startWorld2Button.y = 308;
startWorld3Button = new TitleMenuButton(this, "Start World 3", TitleMenuSelectEvent.START_WORLD_3);
startWorld3Button.x = 30;
startWorld3Button.y = 328;
startWorld4Button = new TitleMenuButton(this, "Start World 4", TitleMenuSelectEvent.START_WORLD_4);
startWorld4Button.x = 130;
startWorld4Button.y = 328;
startWorld5Button = new TitleMenuButton(this, "Start World 5", TitleMenuSelectEvent.START_WORLD_5);
startWorld5Button.x = 230;
startWorld5Button.y = 328;
helpButton = new TitleMenuButton(this, "Show Controls", TitleMenuSelectEvent.HELP_SCREEN);
helpButton.x = 30;
helpButton.y = 368;
helpButton.activate();
gotoWebsiteButton = new TitleMenuButton(this, "Visit www.pixelate.de", TitleMenuSelectEvent.GOTO_WEBSITE);
gotoWebsiteButton.x = 30;
gotoWebsiteButton.y = 388;
gotoWebsiteButton.activate();
version = new DefaultText();
version.setTextSize(10);
version.text = "1.04";
version.x = 27;
version.y = 269;
version.text = (version.text + " (debug)");
flashPlayerHint = new DefaultText();
flashPlayerHint.setTextSize(10);
flashPlayerHint.text = this.getFlashPlayerHint();
flashPlayerHint.x = 30;
flashPlayerHint.y = 487;
this.addChild(startTutorialButton);
this.addChild(startWorld1Button);
this.addChild(startWorld2Button);
this.addChild(startWorld3Button);
this.addChild(startWorld4Button);
this.addChild(startWorld5Button);
this.addChild(gotoWebsiteButton);
this.addChild(helpButton);
this.addChild(version);
this.addChild(flashPlayerHint);
}
private function getFlashPlayerHint():String{
var _local1:String = ("You are using Flash Player " + FlashPlayerVersion.completeVersion);
return (_local1);
}
}
}//package de.pixelate.mrbounce.title
Section 123
//TitleScreen_Logo (de.pixelate.mrbounce.title.TitleScreen_Logo)
package de.pixelate.mrbounce.title {
import mx.core.*;
public class TitleScreen_Logo extends MovieClipAsset {
}
}//package de.pixelate.mrbounce.title
Section 124
//TitleScreen_TitleAsset (de.pixelate.mrbounce.title.TitleScreen_TitleAsset)
package de.pixelate.mrbounce.title {
import mx.core.*;
public class TitleScreen_TitleAsset extends BitmapAsset {
}
}//package de.pixelate.mrbounce.title
Section 125
//Spinner (de.pixelate.mrbounce.tutorial.Spinner)
package de.pixelate.mrbounce.tutorial {
import flash.events.*;
import de.pixelate.mrbounce.level.*;
import flash.display.*;
import de.pixelate.mrbounce.text.*;
import flash.text.*;
public class Spinner extends Sprite {
private var m_isFading:Boolean;
private var textfield:DefaultText;
public function Spinner(){
this.x = (World.BORDER_RIGHT / 2);
this.y = 310;
this.m_isFading = false;
textfield = new DefaultText();
this.addChild(textfield);
textfield.autoSize = TextFieldAutoSize.CENTER;
textfield.textColor = 0xFFFF;
textfield.x = -2;
textfield.y = -8;
var _local1:TextFormat = new TextFormat();
_local1.font = "75 Helvetica Bold";
_local1.size = 12;
_local1.letterSpacing = 0;
_local1.leading = 2;
_local1.align = "center";
textfield.defaultTextFormat = _local1;
}
public function fadeOut():void{
this.m_isFading = true;
if (!hasEventListener(Event.ENTER_FRAME)){
addEventListener(Event.ENTER_FRAME, onFadeOut, false, 0, true);
};
}
private function clear():void{
this.graphics.clear();
this.textfield.text = "";
this.alpha = 1;
}
private function draw(_arg1:Number):void{
var _local2:Number;
var _local3:Number;
var _local4:Number = -((Math.PI / 2));
var _local5:Number = 3;
var _local6:Number = ((((_arg1 + _local5) * Math.PI) / 180) - (Math.PI / 2));
var _local7:Number = 0.1;
var _local8:Number = 16;
var _local9:Number = 5;
graphics.clear();
graphics.lineStyle(_local9, 0xFFFF, 1, false, "normal", CapsStyle.NONE);
_local2 = (Math.cos(_local4) * _local8);
_local3 = (Math.sin(_local4) * _local8);
graphics.moveTo(_local2, _local3);
while (_local4 < _local6) {
_local2 = (Math.cos(_local4) * _local8);
_local3 = (Math.sin(_local4) * _local8);
_local4 = (_local4 + _local7);
graphics.lineTo(_local2, _local3);
};
}
private function onFadeOut(_arg1:Event):void{
this.alpha = (this.alpha - 0.05);
if (this.alpha <= 0){
this.m_isFading = false;
removeEventListener(Event.ENTER_FRAME, onFadeOut);
this.clear();
};
}
public function setPercentage(_arg1:Number):void{
var _local2:Number;
var _local3:String;
if (!this.m_isFading){
_local2 = ((_arg1 / 100) * 360);
draw(_local2);
_local3 = Math.round(_arg1).toString();
if (_local3 == "0"){
_local3 = "";
};
if (_arg1 >= 100){
_local3 = "100";
fadeOut();
};
textfield.text = _local3;
};
}
}
}//package de.pixelate.mrbounce.tutorial
Section 126
//Tutorial (de.pixelate.mrbounce.tutorial.Tutorial)
package de.pixelate.mrbounce.tutorial {
import de.pixelate.mrbounce.events.*;
import flash.events.*;
import de.pixelate.mrbounce.sound.*;
import de.pixelate.mrbounce.enumerations.*;
public class Tutorial extends EventDispatcher {
private const THRESHOLD_SLOWMO:Number = 180;
private const THRESHOLD_VERTICAL_DISTANCE:Number = 320;
private const THRESHOLD_HORIZONTAL_DISTANCE:Number = 1000;
private var m_distanceMovedVertical:Number;
private var m_hasMovedHorizontal:Boolean;
private var m_isInTutorialMode:Boolean;
private var m_usedSlowmo:Boolean;
private var m_hasMovedVertical:Boolean;
private var m_percentageCompletedTask:Number;
private var m_distanceMovedHorizontal:Number;
private var m_currentState:TutorialState;
private var m_framesSlowmo:Number;
private static var instance:Tutorial = new (Tutorial);
;
public function Tutorial(){
if (instance){
throw (new Error("Singleton and can only be accessed through Singleton.me()"));
};
reset();
}
private function checkUsedSlowmo():Boolean{
return (this.m_usedSlowmo);
}
private function checkMovedHorizontal():Boolean{
if (this.m_hasMovedHorizontal){
return (true);
};
return (false);
}
public function reset():void{
this.m_isInTutorialMode = false;
this.m_hasMovedHorizontal = false;
this.m_hasMovedVertical = false;
this.m_usedSlowmo = false;
this.m_distanceMovedHorizontal = 0;
this.m_distanceMovedVertical = 0;
this.m_framesSlowmo = 0;
this.m_percentageCompletedTask = 0;
this.m_currentState = TutorialState.first;
}
public function increaseFramesSlowmo():void{
if (this.m_isInTutorialMode){
if (this.m_currentState == TutorialState.USED_SLOWMO){
this.m_framesSlowmo++;
calculatePercentageCompleted(this.m_framesSlowmo, THRESHOLD_SLOWMO);
if (this.m_framesSlowmo > THRESHOLD_SLOWMO){
this.m_usedSlowmo = true;
};
};
};
}
private function calculatePercentageCompleted(_arg1:Number, _arg2:Number):void{
if (_arg1 > 0){
this.m_percentageCompletedTask = ((_arg1 / _arg2) * 100);
};
this.dispatchEvent(new TutorialEvent(this.m_percentageCompletedTask));
}
private function resetPercentageCompleted():void{
this.m_percentageCompletedTask = 0;
SoundControl.me().playCompleteTutorial();
this.dispatchEvent(new TutorialEvent(this.m_percentageCompletedTask));
}
public function set isInTutorialMode(_arg1:Boolean):void{
this.m_isInTutorialMode = _arg1;
}
private function checkMovedVertical():Boolean{
if (this.m_hasMovedVertical){
return (true);
};
return (false);
}
public function checkState():TutorialState{
var _local1:TutorialState;
switch (this.m_currentState){
case TutorialState.MOVED_HORIZONTAL:
if (checkMovedHorizontal()){
_local1 = TutorialState.next;
resetPercentageCompleted();
};
break;
case TutorialState.MOVED_VERTICAL:
if (checkMovedVertical()){
_local1 = TutorialState.next;
resetPercentageCompleted();
};
break;
case TutorialState.USED_SLOWMO:
if (checkUsedSlowmo()){
_local1 = TutorialState.next;
resetPercentageCompleted();
};
break;
};
if (_local1 != null){
this.m_currentState = _local1;
};
return (_local1);
}
public function increaseDistanceMovedHorizontal(_arg1:Number):void{
if (this.m_isInTutorialMode){
if (this.m_currentState == TutorialState.MOVED_HORIZONTAL){
this.m_distanceMovedHorizontal = (this.m_distanceMovedHorizontal + _arg1);
calculatePercentageCompleted(this.m_distanceMovedHorizontal, THRESHOLD_HORIZONTAL_DISTANCE);
if (this.m_distanceMovedHorizontal >= THRESHOLD_HORIZONTAL_DISTANCE){
this.m_hasMovedHorizontal = true;
};
};
};
}
public function increaseDistanceMovedVertical(_arg1:Number):void{
if (this.m_isInTutorialMode){
if (this.m_currentState == TutorialState.MOVED_VERTICAL){
this.m_distanceMovedVertical = (this.m_distanceMovedVertical + _arg1);
calculatePercentageCompleted(this.m_distanceMovedVertical, THRESHOLD_VERTICAL_DISTANCE);
if (this.m_distanceMovedVertical >= THRESHOLD_VERTICAL_DISTANCE){
this.m_hasMovedVertical = true;
};
};
};
}
public function get isInTutorialMode():Boolean{
return (this.m_isInTutorialMode);
}
public static function me():Tutorial{
return (instance);
}
}
}//package de.pixelate.mrbounce.tutorial
Section 127
//CustomContextMenu (de.pixelate.mrbounce.ui.CustomContextMenu)
package de.pixelate.mrbounce.ui {
import de.pixelate.mrbounce.events.*;
import flash.events.*;
import de.pixelate.mrbounce.sound.*;
import flash.ui.*;
import flash.net.*;
public class CustomContextMenu {
private var m_captionVisitWebsite:String;
private var m_captionToggleSoundOn:String;
private var m_muteButtonReference:MuteButton;
private var m_captionToggleSoundOff:String;
private var m_itemVisitWebsite:ContextMenuItem;
private var m_itemToggleSound:ContextMenuItem;
private var m_contextMenu:ContextMenu;
public function CustomContextMenu(_arg1:MuteButton){
this.m_muteButtonReference = _arg1;
createCaptions();
customizeContextMenu();
}
private function itemToggleSoundHandler(_arg1:ContextMenuEvent):void{
this.m_muteButtonReference.toggle();
}
private function itemVisitWebsiteHandler(_arg1:ContextMenuEvent):void{
var _local2:URLRequest = new URLRequest("http://www.pixelate.de");
navigateToURL(_local2, "_blank");
}
private function createCaptions():void{
m_captionVisitWebsite = "Visit Official Website";
m_captionToggleSoundOn = "Turn Sound On";
m_captionToggleSoundOff = "Turn Sound Off";
}
private function customizeContextMenu():void{
m_contextMenu = new ContextMenu();
m_contextMenu.hideBuiltInItems();
m_itemVisitWebsite = new ContextMenuItem(m_captionVisitWebsite);
m_contextMenu.customItems.push(m_itemVisitWebsite);
m_itemVisitWebsite.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, itemVisitWebsiteHandler, false, 0, true);
m_itemToggleSound = new ContextMenuItem(m_captionToggleSoundOff);
m_contextMenu.customItems.push(m_itemToggleSound);
m_itemToggleSound.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, itemToggleSoundHandler, false, 0, true);
m_muteButtonReference.addEventListener(ToggleSoundEvent.TOGGLE, onToggleSound, false, 0, true);
}
private function onToggleSound(_arg1:ToggleSoundEvent):void{
if (_arg1.isMute){
m_itemToggleSound.caption = m_captionToggleSoundOn;
} else {
m_itemToggleSound.caption = m_captionToggleSoundOff;
};
}
public function getContextMenu():ContextMenu{
return (m_contextMenu);
}
}
}//package de.pixelate.mrbounce.ui
Section 128
//ColorTransformAnim (de.pixelate.mrbounce.utilities.ColorTransformAnim)
package de.pixelate.mrbounce.utilities {
import flash.geom.*;
public class ColorTransformAnim {
private var _speed:int;
private var _currentColorListItem:int;
private var _currentGreenValue:int;
private var _currentBlueValue:int;
private var _colorList:Array;
private var _targetBlueValue:int;
private var _colorTransform:ColorTransform;
private var _defaultColorTransform:ColorTransform;
private var _targetRedValue:int;
private var _currentRedValue:int;
private var _targetGreenValue:int;
public function ColorTransformAnim(_arg1:ColorTransform, _arg2:Array, _arg3:int){
_defaultColorTransform = _arg1;
_colorTransform = _arg1;
_colorList = _arg2;
_currentColorListItem = 0;
_currentRedValue = 0xFF;
_currentGreenValue = 0xFF;
_currentBlueValue = 0xFF;
_speed = _arg3;
setTargetValues();
}
public function getNextTransform():ColorTransform{
if ((_currentRedValue + _speed) < _targetRedValue){
_currentRedValue = (_currentRedValue + _speed);
} else {
if ((_currentRedValue - _speed) > _targetRedValue){
_currentRedValue = (_currentRedValue - _speed);
} else {
_currentRedValue = _targetRedValue;
};
};
if ((_currentGreenValue + _speed) < _targetGreenValue){
_currentGreenValue = (_currentGreenValue + _speed);
} else {
if ((_currentGreenValue - _speed) > _targetGreenValue){
_currentGreenValue = (_currentGreenValue - _speed);
} else {
_currentGreenValue = _targetGreenValue;
};
};
if ((_currentBlueValue + _speed) < _targetBlueValue){
_currentBlueValue = (_currentBlueValue + _speed);
} else {
if ((_currentBlueValue - _speed) > _targetBlueValue){
_currentBlueValue = (_currentBlueValue - _speed);
} else {
_currentBlueValue = _targetBlueValue;
};
};
if ((((((_currentRedValue == _targetRedValue)) && ((_currentGreenValue == _targetGreenValue)))) && ((_currentBlueValue == _targetBlueValue)))){
nextItemInList();
};
_colorTransform.color = ColorUtil.convertRGBToHex(_currentRedValue, _currentGreenValue, _currentBlueValue);
return (_colorTransform);
}
public function getDefault():ColorTransform{
return (_defaultColorTransform);
}
private function setTargetValues():void{
_targetRedValue = ColorUtil.getRedFromHexColor(_colorList[_currentColorListItem]);
_targetGreenValue = ColorUtil.getGreenFromHexColor(_colorList[_currentColorListItem]);
_targetBlueValue = ColorUtil.getBlueFromHexColor(_colorList[_currentColorListItem]);
}
private function nextItemInList():void{
_currentColorListItem++;
if (_currentColorListItem >= _colorList.length){
_currentColorListItem = 0;
};
setTargetValues();
}
}
}//package de.pixelate.mrbounce.utilities
Section 129
//ColorUtil (de.pixelate.mrbounce.utilities.ColorUtil)
package de.pixelate.mrbounce.utilities {
public class ColorUtil {
public static function getBlueFromHexColor(_arg1:uint):uint{
var _local2:uint = (_arg1 & 0xFF);
return (_local2);
}
public static function getRedFromHexColor(_arg1:uint):uint{
var _local2:uint = (_arg1 >> 16);
return (_local2);
}
public static function convertRGBToHex(_arg1:uint, _arg2:uint, _arg3:uint):uint{
var _local4:uint = (((_arg1 << 16) | (_arg2 << 8)) | _arg3);
return (_local4);
}
public static function getGreenFromHexColor(_arg1:uint):uint{
var _local2:uint = ((_arg1 >> 8) & 0xFF);
return (_local2);
}
}
}//package de.pixelate.mrbounce.utilities
Section 130
//Key (de.pixelate.mrbounce.utilities.Key)
package de.pixelate.mrbounce.utilities {
import flash.events.*;
public class Key {
private static var initialized:Boolean = false;
private static var keysDown:Object = new Object();
public static function initialize(_arg1):void{
if (!initialized){
_arg1.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed, false, 0, true);
_arg1.addEventListener(KeyboardEvent.KEY_UP, keyReleased, false, 0, true);
_arg1.addEventListener(Event.DEACTIVATE, clearKeys, false, 0, true);
initialized = true;
};
}
public static function deinitialize(_arg1):void{
if (initialized){
_arg1.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed, false);
_arg1.removeEventListener(KeyboardEvent.KEY_UP, keyReleased, false);
_arg1.removeEventListener(Event.DEACTIVATE, clearKeys, false);
initialized = false;
};
}
public static function isDown(_arg1:uint):Boolean{
if (!initialized){
throw (new Error("Key class has yet been initialized."));
};
return (Boolean((_arg1 in keysDown)));
}
private static function clearKeys(_arg1:Event):void{
keysDown = new Object();
}
private static function keyPressed(_arg1:KeyboardEvent):void{
keysDown[_arg1.keyCode] = true;
}
private static function keyReleased(_arg1:KeyboardEvent):void{
if ((_arg1.keyCode in keysDown)){
delete keysDown[_arg1.keyCode];
};
}
}
}//package de.pixelate.mrbounce.utilities
Section 131
//PathUtil (de.pixelate.mrbounce.utilities.PathUtil)
package de.pixelate.mrbounce.utilities {
import flash.geom.*;
public class PathUtil {
public static function getLinearPath(_arg1:Point, _arg2:Point, _arg3:Number):Array{
var _local9:Point;
var _local4:Number = Math.abs(_arg3);
var _local5:Array = new Array();
var _local6:Number = Point.distance(_arg1, _arg2);
var _local7:int = Math.round((_local6 / _local4));
var _local8:int;
while (_local8 < _local7) {
_local9 = new Point();
_local9.x = (_arg1.x + ((_local8 * (_local4 / _local6)) * (_arg2.x - _arg1.x)));
_local9.y = (_arg1.y + ((_local8 * (_local4 / _local6)) * (_arg2.y - _arg1.y)));
_local5.push(_local9);
_local8++;
};
return (_local5);
}
public static function getBezierPath(_arg1:Point, _arg2:Point, _arg3:Point, _arg4:Number):Array{
var _local7:Number;
var _local8:Number;
var _local9:Number;
var _local10:Number;
var _local11:Number;
var _local12:Number;
var _local13:Number;
var _local15:Point;
var _local5:Number = Math.abs(_arg4);
var _local6:Array = new Array();
var _local14:Number = 0;
while (_local14 < 1) {
_local9 = (((((1 - _local14) * (1 - _local14)) * _arg1.x) + (((2 * _local14) * (1 - _local14)) * _arg3.x)) + ((_local14 * _local14) * _arg2.x));
_local10 = (((((1 - _local14) * (1 - _local14)) * _arg1.y) + (((2 * _local14) * (1 - _local14)) * _arg3.y)) + ((_local14 * _local14) * _arg2.y));
_local11 = ((((2 * _local14) * ((_arg1.x - (2 * _arg3.x)) + _arg2.x)) - (2 * _arg1.x)) + (2 * _arg3.x));
_local12 = ((((2 * _local14) * ((_arg1.y - (2 * _arg3.y)) + _arg2.y)) - (2 * _arg1.y)) + (2 * _arg3.y));
_local13 = Math.sqrt(((_local11 * _local11) + (_local12 * _local12)));
_local15 = new Point(_local9, _local10);
_local6.push(_local15);
_local14 = (_local14 + (_local5 / _local13));
};
return (_local6);
}
}
}//package de.pixelate.mrbounce.utilities
Section 132
//PlayerStats (de.pixelate.mrbounce.utilities.PlayerStats)
package de.pixelate.mrbounce.utilities {
import flash.net.*;
public class PlayerStats {
private var _completedImpossible:Boolean;
private var _completedSingleSession:Boolean;
private var sharedObject:SharedObject;
private var _playerStartedFromFirstWorld:Boolean;
private var _completedLastSecond:Boolean;
private var _completedColorCombo:Boolean;
private var _highestStage:int;
private var _playerLostBall:Boolean;
private static var instance:PlayerStats = new (PlayerStats);
;
public function PlayerStats(){
if (instance){
throw (new Error("Singleton and can only be accessed through Singleton.me()"));
};
}
public function completeLastSecond():void{
if (!_completedLastSecond){
_completedLastSecond = true;
};
}
public function set playerLostBall(_arg1:Boolean):void{
_playerLostBall = _arg1;
}
public function init():void{
sharedObject = SharedObject.getLocal("pixelate_mr_bounce");
_highestStage = sharedObject.data.highestStage;
if (_highestStage == 0){
highestStage = 1;
};
_completedColorCombo = false;
_completedLastSecond = false;
_completedSingleSession = false;
_completedImpossible = false;
}
public function completeColorCombo():void{
if (!_completedColorCombo){
_completedColorCombo = true;
};
}
public function set playerStartedFromFirstWorld(_arg1:Boolean):void{
_playerStartedFromFirstWorld = _arg1;
}
public function set highestStage(_arg1:int):void{
if (_arg1 > _highestStage){
_highestStage = _arg1;
sharedObject.data.highestStage = new int(_highestStage);
sharedObject.flush();
};
}
public function completeSingleSession():void{
if (!_completedSingleSession){
if (_playerStartedFromFirstWorld){
_completedSingleSession = true;
};
};
}
public function get highestStage():int{
return (_highestStage);
}
public function completeImpossible():void{
if (!_completedImpossible){
if (((!(_playerLostBall)) && (_playerStartedFromFirstWorld))){
_completedImpossible = true;
};
};
}
public static function getInstance():PlayerStats{
return (instance);
}
}
}//package de.pixelate.mrbounce.utilities
Section 133
//StageHelper (de.pixelate.mrbounce.utilities.StageHelper)
package de.pixelate.mrbounce.utilities {
public class StageHelper {
private var _stageReference;
private static var instance:StageHelper = new (StageHelper);
;
public function StageHelper(){
if (instance){
throw (new Error("Singleton and can only be accessed through Singleton.me()"));
};
}
public static function getStage(){
return (getInstance()._stageReference);
}
public static function getInstance():StageHelper{
return (instance);
}
public static function init(_arg1):void{
getInstance()._stageReference = _arg1;
}
}
}//package de.pixelate.mrbounce.utilities
Section 134
//FlashPlayerVersion (de.pixelate.pelikan.utilities.FlashPlayerVersion)
package de.pixelate.pelikan.utilities {
import flash.system.*;
public class FlashPlayerVersion {
public static function get internalBuildNumber():String{
return (FlashPlayerVersion.properties[4]);
}
public static function get minorVersion():String{
return (FlashPlayerVersion.properties[2]);
}
public static function compare(_arg1:String):void{
}
public static function get completeVersion():String{
var _local1:String = ((((((FlashPlayerVersion.majorVersion + ",") + FlashPlayerVersion.minorVersion) + ",") + FlashPlayerVersion.buildNumber) + ",") + FlashPlayerVersion.internalBuildNumber);
return (_local1);
}
public static function get buildNumber():String{
return (FlashPlayerVersion.properties[3]);
}
public static function get platform():String{
return (FlashPlayerVersion.properties[0]);
}
private static function get properties():Array{
var _local1:Array = Capabilities.version.split(/ |,/);
return (_local1);
}
public static function get majorVersion():String{
return (FlashPlayerVersion.properties[1]);
}
}
}//package de.pixelate.pelikan.utilities
Section 135
//FpsDisplay (de.pixelate.pelikan.utilities.FpsDisplay)
package de.pixelate.pelikan.utilities {
import flash.events.*;
import flash.display.*;
import flash.utils.*;
import flash.text.*;
import flash.system.*;
public class FpsDisplay extends Sprite {
private var m_ticks:Number;
private var m_timer:Timer;
private var m_textFormat:TextFormat;
private var m_interval:Number;
private var m_textField:TextField;
public function FpsDisplay(){
create();
}
public function hide():void{
if (this.m_textField.visible){
this.m_textField.visible = false;
this.m_timer.removeEventListener("timer", onTimerEvent);
this.m_ticks = 0;
};
}
private function onEnterFrame(_arg1:Event):void{
this.m_ticks++;
}
private function onTimerEvent(_arg1:TimerEvent):void{
this.m_textField.text = (((((this.m_ticks.toString() + "/") + stage.frameRate) + " fps ") + System.totalMemory) + " bytes");
this.m_ticks = 0;
}
public function show(_arg1:Number, _arg2:Number):void{
addEventListener(Event.ENTER_FRAME, this.onEnterFrame, false, 0, true);
this.m_textField.x = _arg1;
this.m_textField.y = _arg2;
if (!this.m_textField.visible){
this.m_textField.visible = true;
this.m_timer = new Timer(1000);
this.m_timer.addEventListener("timer", onTimerEvent, false, 0, true);
this.m_timer.start();
this.m_textField.text = "";
this.m_ticks = 0;
};
}
private function create():void{
this.m_textFormat = new TextFormat();
this.m_textFormat.font = "75 Helvetica Bold";
this.m_textFormat.size = 10;
this.m_textField = new TextField();
this.m_textField.visible = false;
this.m_textField.textColor = 0xEDED;
this.m_textField.autoSize = "left";
this.m_textField.selectable = false;
this.m_textField.embedFonts = true;
this.m_textField.defaultTextFormat = this.m_textFormat;
this.addChild(m_textField);
}
}
}//package de.pixelate.pelikan.utilities
Section 136
//MiniclipButton (de.pixelate.pelikan.utilities.MiniclipButton)
package de.pixelate.pelikan.utilities {
import flash.events.*;
import de.pixelate.mrbounce.sound.*;
import flash.display.*;
import flash.net.*;
public class MiniclipButton extends Sprite {
private const ButtonAsset:Class;
private var m_buttonBitmap:Bitmap;
private var m_hitSprite:Sprite;
public function MiniclipButton(){
ButtonAsset = MiniclipButton_ButtonAsset;
super();
this.x = 386;
this.y = 484;
m_buttonBitmap = new ButtonAsset();
this.addChild(m_buttonBitmap);
drawHitSprite();
}
private function onMouseOver(_arg1:MouseEvent):void{
SoundControl.me().playButtonRollover();
this.alpha = 0.8;
}
private function drawHitSprite():void{
m_hitSprite = new Sprite();
m_hitSprite.graphics.clear();
m_hitSprite.graphics.beginFill(0, 0);
m_hitSprite.graphics.drawRect(0, 0, m_buttonBitmap.width, m_buttonBitmap.height);
m_hitSprite.graphics.endFill();
m_hitSprite.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver, false, 0, true);
m_hitSprite.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut, false, 0, true);
m_hitSprite.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, false, 0, true);
m_hitSprite.buttonMode = true;
this.addChild(m_hitSprite);
}
private function onMouseOut(_arg1:MouseEvent):void{
this.alpha = 1;
}
private function onMouseDown(_arg1:MouseEvent):void{
var _local2:URLRequest = new URLRequest("http://www.miniclip.com");
navigateToURL(_local2, "_blank");
}
}
}//package de.pixelate.pelikan.utilities
Section 137
//MiniclipButton_ButtonAsset (de.pixelate.pelikan.utilities.MiniclipButton_ButtonAsset)
package de.pixelate.pelikan.utilities {
import mx.core.*;
public class MiniclipButton_ButtonAsset extends BitmapAsset {
}
}//package de.pixelate.pelikan.utilities
Section 138
//SiteLocking (de.pixelate.pelikan.utilities.SiteLocking)
package de.pixelate.pelikan.utilities {
import flash.display.*;
public class SiteLocking extends Sprite {
private const ALLOWED_DOMAINS:Array;
private var m_server:String;
private var m_protocol:String;
private var m_url:String;
public function SiteLocking(_arg1:String){
ALLOWED_DOMAINS = new Array("miniclip.com");
super();
this.m_url = _arg1.toLowerCase();
this.m_protocol = this.m_url.substr(0, this.m_url.indexOf(":"));
}
public function isUrlValid():Boolean{
var _local1:int;
if (this.m_protocol == "file"){
return (true);
};
if (this.m_protocol == "http"){
_local1 = 0;
while (_local1 < ALLOWED_DOMAINS.length) {
if (this.m_url.indexOf(ALLOWED_DOMAINS[_local1]) != -1){
return (true);
};
_local1++;
};
};
return (false);
}
}
}//package de.pixelate.pelikan.utilities
Section 139
//ArrayedQueue (de.polygonal.ds.ArrayedQueue)
package de.polygonal.ds {
public class ArrayedQueue implements Collection {
private var _que:Array;
private var _count:int;
private var _size:int;
private var _front:int;
private var _divisor:int;
public function ArrayedQueue(_arg1:int){
if (_arg1 < 3){
_arg1 = 3;
};
_size = (1 << _arg1);
_divisor = (_size - 1);
clear();
}
public function get maxSize():int{
return (_size);
}
public function enqueue(_arg1):Boolean{
if (_size != _count){
_que[int(((_count++ + _front) & _divisor))] = _arg1;
return (true);
};
return (false);
}
public function clear():void{
_que = new Array(_size);
_front = (_count = 0);
}
public function get size():int{
return (_count);
}
public function peek(){
return (_que[_front]);
}
public function toArray():Array{
var _local1:Array = new Array(_count);
var _local2:int;
while (_local2 < _count) {
_local1[_local2] = _que[int(((_local2 + _front) & _divisor))];
_local2++;
};
return (_local1);
}
public function getIterator():Iterator{
return (new ArrayedQueueIterator(this));
}
public function dispose():void{
if (!_front){
_que[int((_size - 1))] = null;
} else {
_que[int((_front - 1))] = null;
};
}
public function getAt(_arg1:int){
if (_arg1 >= _count){
return (null);
};
return (_que[int(((_arg1 + _front) & _divisor))]);
}
public function toString():String{
return ((("[ArrayedQueue, size=" + size) + "]"));
}
public function contains(_arg1):Boolean{
var _local2:int;
while (_local2 < _count) {
if (_que[int(((_local2 + _front) & _divisor))] === _arg1){
return (true);
};
_local2++;
};
return (false);
}
public function dequeue(){
var _local1:*;
if (_count > 0){
_local1 = _que[_front++];
if (_front == _size){
_front = 0;
};
_count--;
return (_local1);
};
return (null);
}
public function dump():String{
var _local2:int;
var _local1 = "[ArrayedQueue]\n";
_local1 = (_local1 + (("\t" + getAt(_local2)) + " -> front\n"));
_local2 = 1;
while (_local2 < _count) {
_local1 = (_local1 + (("\t" + getAt(_local2)) + "\n"));
_local2++;
};
return (_local1);
}
public function setAt(_arg1:int, _arg2):void{
if (_arg1 >= _count){
return;
};
_que[int(((_arg1 + _front) & _divisor))] = _arg2;
}
}
}//package de.polygonal.ds
class ArrayedQueueIterator implements Iterator {
private var _que:ArrayedQueue;
private var _cursor:int;
private function ArrayedQueueIterator(_arg1:ArrayedQueue){
_que = _arg1;
_cursor = 0;
}
public function get data(){
return (_que.getAt(_cursor));
}
public function next(){
if (_cursor < _que.size){
return (_que.getAt(_cursor++));
};
return (null);
}
public function hasNext():Boolean{
return ((_cursor < _que.size));
}
public function set data(_arg1):void{
_que.setAt(_cursor, _arg1);
}
public function start():void{
_cursor = 0;
}
}
Section 140
//Collection (de.polygonal.ds.Collection)
package de.polygonal.ds {
public interface Collection {
function get size():int;
function getIterator():Iterator;
function clear():void;
function toArray():Array;
function contains(_arg1):Boolean;
}
}//package de.polygonal.ds
Section 141
//Iterator (de.polygonal.ds.Iterator)
package de.polygonal.ds {
public interface Iterator {
function start():void;
function set data(_arg1):void;
function get data();
function next();
function hasNext():Boolean;
}
}//package de.polygonal.ds
Section 142
//BitmapAsset (mx.core.BitmapAsset)
package mx.core {
import flash.display.*;
public class BitmapAsset extends FlexBitmap implements IFlexAsset, IFlexDisplayObject {
mx_internal static const VERSION:String = "3.0.0.0";
public function BitmapAsset(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
super(_arg1, _arg2, _arg3);
}
public function get measuredWidth():Number{
if (bitmapData){
return (bitmapData.width);
};
return (0);
}
public function get measuredHeight():Number{
if (bitmapData){
return (bitmapData.height);
};
return (0);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
}
}//package mx.core
Section 143
//EdgeMetrics (mx.core.EdgeMetrics)
package mx.core {
public class EdgeMetrics {
public var top:Number;
public var left:Number;
public var bottom:Number;
public var right:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public static const EMPTY:EdgeMetrics = new EdgeMetrics(0, 0, 0, 0);
;
public function EdgeMetrics(_arg1:Number=0, _arg2:Number=0, _arg3:Number=0, _arg4:Number=0){
this.left = _arg1;
this.top = _arg2;
this.right = _arg3;
this.bottom = _arg4;
}
public function clone():EdgeMetrics{
return (new EdgeMetrics(left, top, right, bottom));
}
}
}//package mx.core
Section 144
//FlexBitmap (mx.core.FlexBitmap)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexBitmap extends Bitmap {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexBitmap(_arg1:BitmapData=null, _arg2:String="auto", _arg3:Boolean=false){
var bitmapData = _arg1;
var pixelSnapping = _arg2;
var smoothing = _arg3;
super(bitmapData, pixelSnapping, smoothing);
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 145
//FlexMovieClip (mx.core.FlexMovieClip)
package mx.core {
import flash.display.*;
import mx.utils.*;
public class FlexMovieClip extends MovieClip {
mx_internal static const VERSION:String = "3.0.0.0";
public function FlexMovieClip(){
super();
try {
name = NameUtil.createUniqueName(this);
} catch(e:Error) {
};
}
override public function toString():String{
return (NameUtil.displayObjectToString(this));
}
}
}//package mx.core
Section 146
//FontAsset (mx.core.FontAsset)
package mx.core {
import flash.text.*;
public class FontAsset extends Font implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 147
//IBorder (mx.core.IBorder)
package mx.core {
public interface IBorder {
function get borderMetrics():EdgeMetrics;
}
}//package mx.core
Section 148
//IFlexAsset (mx.core.IFlexAsset)
package mx.core {
public interface IFlexAsset {
}
}//package mx.core
Section 149
//IFlexDisplayObject (mx.core.IFlexDisplayObject)
package mx.core {
import flash.events.*;
import flash.geom.*;
import flash.display.*;
import flash.accessibility.*;
public interface IFlexDisplayObject extends IBitmapDrawable, IEventDispatcher {
function get visible():Boolean;
function get rotation():Number;
function localToGlobal(_arg1:Point):Point;
function get name():String;
function set width(_arg1:Number):void;
function get measuredHeight():Number;
function get blendMode():String;
function get scale9Grid():Rectangle;
function set name(_arg1:String):void;
function set scaleX(_arg1:Number):void;
function set scaleY(_arg1:Number):void;
function get measuredWidth():Number;
function get accessibilityProperties():AccessibilityProperties;
function set scrollRect(_arg1:Rectangle):void;
function get cacheAsBitmap():Boolean;
function globalToLocal(_arg1:Point):Point;
function get height():Number;
function set blendMode(_arg1:String):void;
function get parent():DisplayObjectContainer;
function getBounds(_arg1:DisplayObject):Rectangle;
function get opaqueBackground():Object;
function set scale9Grid(_arg1:Rectangle):void;
function setActualSize(_arg1:Number, _arg2:Number):void;
function set alpha(_arg1:Number):void;
function set accessibilityProperties(_arg1:AccessibilityProperties):void;
function get width():Number;
function hitTestPoint(_arg1:Number, _arg2:Number, _arg3:Boolean=false):Boolean;
function set cacheAsBitmap(_arg1:Boolean):void;
function get scaleX():Number;
function get scaleY():Number;
function get scrollRect():Rectangle;
function get mouseX():Number;
function get mouseY():Number;
function set height(_arg1:Number):void;
function set mask(_arg1:DisplayObject):void;
function getRect(_arg1:DisplayObject):Rectangle;
function get alpha():Number;
function set transform(_arg1:Transform):void;
function move(_arg1:Number, _arg2:Number):void;
function get loaderInfo():LoaderInfo;
function get root():DisplayObject;
function hitTestObject(_arg1:DisplayObject):Boolean;
function set opaqueBackground(_arg1:Object):void;
function set visible(_arg1:Boolean):void;
function get mask():DisplayObject;
function set x(_arg1:Number):void;
function set y(_arg1:Number):void;
function get transform():Transform;
function set filters(_arg1:Array):void;
function get x():Number;
function get y():Number;
function get filters():Array;
function set rotation(_arg1:Number):void;
function get stage():Stage;
}
}//package mx.core
Section 150
//IRepeaterClient (mx.core.IRepeaterClient)
package mx.core {
public interface IRepeaterClient {
function get instanceIndices():Array;
function set instanceIndices(_arg1:Array):void;
function get isDocument():Boolean;
function set repeaters(_arg1:Array):void;
function initializeRepeaterArrays(_arg1:IRepeaterClient):void;
function get repeaters():Array;
function set repeaterIndices(_arg1:Array):void;
function get repeaterIndices():Array;
}
}//package mx.core
Section 151
//MovieClipAsset (mx.core.MovieClipAsset)
package mx.core {
public class MovieClipAsset extends FlexMovieClip implements IFlexAsset, IFlexDisplayObject, IBorder {
private var _measuredHeight:Number;
private var _measuredWidth:Number;
mx_internal static const VERSION:String = "3.0.0.0";
public function MovieClipAsset(){
_measuredWidth = width;
_measuredHeight = height;
}
public function get measuredWidth():Number{
return (_measuredWidth);
}
public function get measuredHeight():Number{
return (_measuredHeight);
}
public function setActualSize(_arg1:Number, _arg2:Number):void{
width = _arg1;
height = _arg2;
}
public function move(_arg1:Number, _arg2:Number):void{
this.x = _arg1;
this.y = _arg2;
}
public function get borderMetrics():EdgeMetrics{
if (scale9Grid == null){
return (EdgeMetrics.EMPTY);
};
return (new EdgeMetrics(scale9Grid.left, scale9Grid.top, Math.ceil((measuredWidth - scale9Grid.right)), Math.ceil((measuredHeight - scale9Grid.bottom))));
}
}
}//package mx.core
Section 152
//mx_internal (mx.core.mx_internal)
package mx.core {
public namespace mx_internal = "http://www.adobe.com/2006/flex/mx/internal";
}//package mx.core
Section 153
//SoundAsset (mx.core.SoundAsset)
package mx.core {
import flash.media.*;
public class SoundAsset extends Sound implements IFlexAsset {
mx_internal static const VERSION:String = "3.0.0.0";
}
}//package mx.core
Section 154
//NameUtil (mx.utils.NameUtil)
package mx.utils {
import mx.core.*;
import flash.display.*;
import flash.utils.*;
public class NameUtil {
mx_internal static const VERSION:String = "3.0.0.0";
private static var counter:int = 0;
public static function displayObjectToString(_arg1:DisplayObject):String{
var _local2:String;
var _local4:String;
var _local5:Array;
var _local3:DisplayObject = _arg1;
while (_local3 != null) {
if (((((_local3.parent) && (_local3.stage))) && ((_local3.parent == _local3.stage)))){
break;
};
_local4 = _local3.name;
if ((_local3 is IRepeaterClient)){
_local5 = IRepeaterClient(_local3).instanceIndices;
if (_local5){
_local4 = (_local4 + (("[" + _local5.join("][")) + "]"));
};
};
_local2 = ((_local2 == null)) ? _local4 : ((_local4 + ".") + _local2);
_local3 = _local3.parent;
};
return (_local2);
}
public static function createUniqueName(_arg1:Object):String{
if (!_arg1){
return (null);
};
var _local2:String = getQualifiedClassName(_arg1);
var _local3:int = _local2.indexOf("::");
if (_local3 != -1){
_local2 = _local2.substr((_local3 + 2));
};
var _local4:int = _local2.charCodeAt((_local2.length - 1));
if ((((_local4 >= 48)) && ((_local4 <= 57)))){
_local2 = (_local2 + "_");
};
return ((_local2 + counter++));
}
}
}//package mx.utils
Section 155
//Main (Main)
package {
import de.pixelate.mrbounce.events.*;
import de.pixelate.mrbounce.base.*;
import de.pixelate.mrbounce.sound.*;
import de.pixelate.mrbounce.level.*;
import de.pixelate.mrbounce.game.*;
import de.pixelate.mrbounce.utilities.*;
import flash.display.*;
import de.pixelate.pelikan.utilities.*;
import de.pixelate.mrbounce.title.*;
import de.pixelate.mrbounce.editor.*;
import flash.net.*;
public class Main extends Sprite {
private var m_game:Game;
private var m_siteLocking:SiteLocking;
private var m_miniclipButton:MiniclipButton;
private var m_titleScreen:TitleScreen;
private var m_focusHelper:Sprite;
private var m_firstRunFlag:Boolean;
private var m_gameContainer:GameContainer;
private var m_helpScreen:HelpScreen;
private var m_editor:Editor;
public static var fontHelvetica75:Class = Main_fontHelvetica75;
public static var fontSqr35:Class = Main_fontSqr35;
public function Main(){
init();
}
private function onBackToMenu(_arg1:TitleMenuSelectEvent):void{
hideHelpScreen();
}
private function onStartTutorial(_arg1:TitleMenuSelectEvent):void{
PlayerStats.getInstance().playerStartedFromFirstWorld = true;
hideTitleScreen();
showTutorial();
this.m_game.startTutorial();
}
public function hideTitleScreen():void{
this.m_titleScreen.visible = false;
this.m_titleScreen.removeEventListener(TitleMenuSelectEvent.START_TUTORIAL, onStartTutorial);
this.m_titleScreen.removeEventListener(TitleMenuSelectEvent.START_WORLD_1, onStartGame);
this.m_titleScreen.removeEventListener(TitleMenuSelectEvent.START_WORLD_2, onStartGame);
this.m_titleScreen.removeEventListener(TitleMenuSelectEvent.START_WORLD_3, onStartGame);
this.m_titleScreen.removeEventListener(TitleMenuSelectEvent.START_WORLD_4, onStartGame);
this.m_titleScreen.removeEventListener(TitleMenuSelectEvent.START_WORLD_5, onStartGame);
this.m_titleScreen.removeEventListener(TitleMenuSelectEvent.GOTO_WEBSITE, onGotoWebsite);
this.m_titleScreen.removeEventListener(TitleMenuSelectEvent.HELP_SCREEN, onHelpScreen);
}
private function onHelpScreen(_arg1:TitleMenuSelectEvent):void{
showHelpScreen();
}
public function showGame():void{
this.m_gameContainer.visible = true;
this.m_game.visible = true;
}
public function init():void{
this.m_firstRunFlag = false;
StageHelper.init(stage);
StageHelper.getStage().stageFocusRect = false;
checkSiteLocking();
}
private function onStartGame(_arg1:TitleMenuSelectEvent):void{
switch (_arg1.type){
case TitleMenuSelectEvent.START_WORLD_1:
LevelDataHolder.me().selectStartStage(1);
PlayerStats.getInstance().playerStartedFromFirstWorld = true;
break;
case TitleMenuSelectEvent.START_WORLD_2:
LevelDataHolder.me().selectStartStage(2);
PlayerStats.getInstance().playerStartedFromFirstWorld = false;
break;
case TitleMenuSelectEvent.START_WORLD_3:
LevelDataHolder.me().selectStartStage(3);
PlayerStats.getInstance().playerStartedFromFirstWorld = false;
break;
case TitleMenuSelectEvent.START_WORLD_4:
LevelDataHolder.me().selectStartStage(4);
PlayerStats.getInstance().playerStartedFromFirstWorld = false;
break;
case TitleMenuSelectEvent.START_WORLD_5:
LevelDataHolder.me().selectStartStage(5);
PlayerStats.getInstance().playerStartedFromFirstWorld = false;
break;
};
hideTitleScreen();
showGame();
this.m_game.startGameFromMenu();
}
public function hideGame():void{
this.m_gameContainer.visible = false;
this.m_game.visible = false;
}
private function drawBackground():void{
this.graphics.lineStyle(0, 0, 0);
this.graphics.beginFill(0, 1);
this.graphics.drawRect(0, 0, World.BORDER_RIGHT, World.BORDER_BOTTOM);
this.graphics.endFill();
}
public function showTitleScreen():void{
SoundControl.me().speakTitle();
this.m_titleScreen.addEventListener(TitleMenuSelectEvent.START_TUTORIAL, onStartTutorial, false, 0, true);
this.m_titleScreen.addEventListener(TitleMenuSelectEvent.START_WORLD_1, onStartGame, false, 0, true);
this.m_titleScreen.addEventListener(TitleMenuSelectEvent.START_WORLD_2, onStartGame, false, 0, true);
this.m_titleScreen.addEventListener(TitleMenuSelectEvent.START_WORLD_3, onStartGame, false, 0, true);
this.m_titleScreen.addEventListener(TitleMenuSelectEvent.START_WORLD_4, onStartGame, false, 0, true);
this.m_titleScreen.addEventListener(TitleMenuSelectEvent.START_WORLD_5, onStartGame, false, 0, true);
this.m_titleScreen.addEventListener(TitleMenuSelectEvent.GOTO_WEBSITE, onGotoWebsite, false, 0, true);
this.m_titleScreen.addEventListener(TitleMenuSelectEvent.HELP_SCREEN, onHelpScreen, false, 0, true);
this.m_titleScreen.updateStageSelectButtons();
this.m_titleScreen.visible = true;
}
private function showHelpScreen():void{
this.m_helpScreen.visible = true;
this.m_helpScreen.addEventListener(TitleMenuSelectEvent.BACK_TO_MENU, onBackToMenu, false, 0, true);
}
private function checkSiteLocking():void{
this.m_siteLocking = new SiteLocking(stage.loaderInfo.url);
this.addChild(this.m_siteLocking);
if (this.m_siteLocking.isUrlValid()){
built();
};
}
private function onGotoWebsite(_arg1:TitleMenuSelectEvent):void{
var _local2:URLRequest = new URLRequest("http://www.pixelate.de");
navigateToURL(_local2, "_blank");
}
private function hideHelpScreen():void{
this.m_helpScreen.visible = false;
this.m_helpScreen.removeEventListener(TitleMenuSelectEvent.BACK_TO_MENU, onBackToMenu);
}
public function showTutorial():void{
this.m_gameContainer.visible = true;
this.m_game.visible = true;
}
private function built():void{
drawBackground();
this.m_gameContainer = new GameContainer();
this.addChildAt(this.m_gameContainer, 0);
this.m_gameContainer.y = World.OFFSET_Y;
this.m_game = new Game(this, this.m_gameContainer);
this.addChildAt(this.m_game, 1);
this.m_game.init();
this.m_game.y = World.OFFSET_Y;
this.m_titleScreen = new TitleScreen();
this.addChild(m_titleScreen);
this.m_titleScreen.init();
this.m_titleScreen.y = World.OFFSET_Y;
this.m_helpScreen = new HelpScreen();
this.addChild(m_helpScreen);
this.m_helpScreen.init();
this.m_miniclipButton = new MiniclipButton();
this.addChild(m_miniclipButton);
showTitleScreen();
}
}
}//package
Section 156
//Main_fontHelvetica75 (Main_fontHelvetica75)
package {
import mx.core.*;
public class Main_fontHelvetica75 extends FontAsset {
}
}//package
Section 157
//Main_fontSqr35 (Main_fontSqr35)
package {
import mx.core.*;
public class Main_fontSqr35 extends FontAsset {
}
}//package