STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228472
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2564 · P5128

Happy midsummer's day!

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/98715361?noj=FRM98715361-21DC" width="1" height="1"></div>

Under Construction.swf

This is the info page for
Flash #47511

(Click the ID number above for more basic data on this flash file.)


Text
<p align="center"><font face="_sans" size="14" color="#000000" letterSpacing="0.000000" kerning="1"><b>exported_movieclips</b></font></p>

Press Left Mouse
Button on a piece
to select it

Click OutSide Of
The Grid or press
Any Key to rotate
The Piece

Click Correct
Location To Place
Piece On The Grid

Connect bricks of
the same color to
earn extra points

Use powerup tools
- to fill in gaps
- to knock new holes

Drag a piece to
the dumpster to
trash it

Limited power ups
allow you to
remove or fill in
one brick

<p align="center"><font face="Eastwood" size="14" color="#333333" letterSpacing="0.000000" kerning="1">Label</font></p>

<p align="center"></p>

Your progress will be saved

<p align="center"><font face="Eastwood" size="32" color="#ffffff" letterSpacing="0.000000" kerning="1">Try Again (restart level)</font></p>

Level Results

<p align="left"><font face="Eastwood" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">Goal</font></p><p align="left"><font face="Eastwood" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">Bonus</font></p><p align="left"><font face="Eastwood" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">Time Remaining</font></p><p align="left"><font face="Eastwood" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">Unused Powerups</font></p><p align="left"><font face="Eastwood" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">Level Score</font></p><p align="left"><font face="Eastwood" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">Total Score</font></p><p align="left"></p>

<p align="right"><font face="Eastwood" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">0</font></p><p align="right"><font face="Eastwood" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">0</font></p><p align="right"><font face="Eastwood" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">0</font></p><p align="right"><font face="Eastwood" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">0</font></p><p align="right"><font face="Eastwood" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">0</font></p><p align="right"><font face="Eastwood" size="18" color="#ffffff" letterSpacing="0.000000" kerning="1">0</font></p>

Would you like to
continue your previous
game or start a new
one?

<p align="center"><font face="Eastwood" size="24" color="#000000" letterSpacing="0.000000" kerning="1"><b>Building #10</b></font></p>

<p align="center"><font face="Eastwood" size="34" color="#bd3032" letterSpacing="0.000000" kerning="1"><b>&quot;Eiffel&quot;</b></font></p>

GOAL

<p align="center"><font face="Eastwood" size="34" color="#bd3032" letterSpacing="0.000000" kerning="1"><b>600</b></font></p>

<p align="right"><font face="Impact" size="24" color="#ffffff" letterSpacing="0.000000" kerning="1">5</font></p>

<p align="left"><font face="Eastwood" size="19" color="#ffffff" letterSpacing="0.000000" kerning="1">Floor: 10/10</font></p>

<p align="left"><font face="Eastwood" size="19" color="#ffffff" letterSpacing="0.000000" kerning="1">Goal: 00000 Current: 00000</font></p>

<p align="left"><font face="Eastwood" size="19" color="#ffffff" letterSpacing="0.000000" kerning="1">Time: 00:00</font></p>

<p align="center"><font face="Impact" size="21" color="#ffffff" letterSpacing="0.000000" kerning="1">Level 00/00</font></p>

<p align="center"><font face="Impact" size="21" color="#ffffff" letterSpacing="0.000000" kerning="1">Floor 00/00</font></p>

<p align="left"></p>

<p align="left"></p>

<p align="left"></p>

<p align="left"></p>

NAME

GOAL

TIME

You've made it!

<p align="center"><font face="Eastwood" size="30" color="#ffffff" letterSpacing="0.000000" kerning="1">Your Final Score: 0000000</font></p>

<p align="center"><font face="_sans" size="20" color="#000000" letterSpacing="0.000000" kerning="1">1</font></p>

<p align="center"><font face="_sans" size="14" color="#000000" letterSpacing="0.000000" kerning="1"><b>exported_sounds</b></font></p>

ActionScript [AS3]

Section 1
//MD5 (com.adobe.crypto.MD5) package com.adobe.crypto { import com.adobe.utils.*; public class MD5 { public function MD5(){ super(); } private static function ff(a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{ return (transform(f, a, b, c, d, x, s, t)); } private static function createBlocks(s:String):Array{ var blocks:Array; var len:int; var mask:int; var i:int; blocks = new Array(); len = (s.length * 8); mask = 0xFF; i = 0; while (i < len) { blocks[(i >> 5)] = (blocks[(i >> 5)] | ((s.charCodeAt((i / 8)) & mask) << (i % 32))); i = (i + 8); }; blocks[(len >> 5)] = (blocks[(len >> 5)] | (128 << (len % 32))); blocks[((((len + 64) >>> 9) << 4) + 14)] = len; return (blocks); } private static function ii(a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{ return (transform(i, a, b, c, d, x, s, t)); } private static function f(x:int, y:int, z:int):int{ return (((x & y) | (~(x) & z))); } private static function g(x:int, y:int, z:int):int{ return (((x & z) | (y & ~(z)))); } private static function h(x:int, y:int, z:int):int{ return (((x ^ y) ^ z)); } private static function i(x:int, y:int, z:int):int{ return ((y ^ (x | ~(z)))); } private static function transform(func:Function, a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{ var tmp:int; tmp = (((a + int(func(b, c, d))) + x) + t); return ((IntUtil.rol(tmp, s) + b)); } private static function hh(a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{ return (transform(h, a, b, c, d, x, s, t)); } public static function hash(s:String):String{ var a:int; var b:int; var c:int; var d:int; var aa:int; var bb:int; var cc:int; var dd:int; var x:Array; var len:int; var i:int; a = 1732584193; b = -271733879; c = -1732584194; d = 271733878; x = createBlocks(s); len = x.length; i = 0; while (i < len) { aa = a; bb = b; cc = c; dd = d; a = ff(a, b, c, d, x[(i + 0)], 7, -680876936); d = ff(d, a, b, c, x[(i + 1)], 12, -389564586); c = ff(c, d, a, b, x[(i + 2)], 17, 606105819); b = ff(b, c, d, a, x[(i + 3)], 22, -1044525330); a = ff(a, b, c, d, x[(i + 4)], 7, -176418897); d = ff(d, a, b, c, x[(i + 5)], 12, 1200080426); c = ff(c, d, a, b, x[(i + 6)], 17, -1473231341); b = ff(b, c, d, a, x[(i + 7)], 22, -45705983); a = ff(a, b, c, d, x[(i + 8)], 7, 1770035416); d = ff(d, a, b, c, x[(i + 9)], 12, -1958414417); c = ff(c, d, a, b, x[(i + 10)], 17, -42063); b = ff(b, c, d, a, x[(i + 11)], 22, -1990404162); a = ff(a, b, c, d, x[(i + 12)], 7, 1804603682); d = ff(d, a, b, c, x[(i + 13)], 12, -40341101); c = ff(c, d, a, b, x[(i + 14)], 17, -1502002290); b = ff(b, c, d, a, x[(i + 15)], 22, 1236535329); a = gg(a, b, c, d, x[(i + 1)], 5, -165796510); d = gg(d, a, b, c, x[(i + 6)], 9, -1069501632); c = gg(c, d, a, b, x[(i + 11)], 14, 643717713); b = gg(b, c, d, a, x[(i + 0)], 20, -373897302); a = gg(a, b, c, d, x[(i + 5)], 5, -701558691); d = gg(d, a, b, c, x[(i + 10)], 9, 38016083); c = gg(c, d, a, b, x[(i + 15)], 14, -660478335); b = gg(b, c, d, a, x[(i + 4)], 20, -405537848); a = gg(a, b, c, d, x[(i + 9)], 5, 568446438); d = gg(d, a, b, c, x[(i + 14)], 9, -1019803690); c = gg(c, d, a, b, x[(i + 3)], 14, -187363961); b = gg(b, c, d, a, x[(i + 8)], 20, 1163531501); a = gg(a, b, c, d, x[(i + 13)], 5, -1444681467); d = gg(d, a, b, c, x[(i + 2)], 9, -51403784); c = gg(c, d, a, b, x[(i + 7)], 14, 1735328473); b = gg(b, c, d, a, x[(i + 12)], 20, -1926607734); a = hh(a, b, c, d, x[(i + 5)], 4, -378558); d = hh(d, a, b, c, x[(i + 8)], 11, -2022574463); c = hh(c, d, a, b, x[(i + 11)], 16, 1839030562); b = hh(b, c, d, a, x[(i + 14)], 23, -35309556); a = hh(a, b, c, d, x[(i + 1)], 4, -1530992060); d = hh(d, a, b, c, x[(i + 4)], 11, 1272893353); c = hh(c, d, a, b, x[(i + 7)], 16, -155497632); b = hh(b, c, d, a, x[(i + 10)], 23, -1094730640); a = hh(a, b, c, d, x[(i + 13)], 4, 681279174); d = hh(d, a, b, c, x[(i + 0)], 11, -358537222); c = hh(c, d, a, b, x[(i + 3)], 16, -722521979); b = hh(b, c, d, a, x[(i + 6)], 23, 76029189); a = hh(a, b, c, d, x[(i + 9)], 4, -640364487); d = hh(d, a, b, c, x[(i + 12)], 11, -421815835); c = hh(c, d, a, b, x[(i + 15)], 16, 530742520); b = hh(b, c, d, a, x[(i + 2)], 23, -995338651); a = ii(a, b, c, d, x[(i + 0)], 6, -198630844); d = ii(d, a, b, c, x[(i + 7)], 10, 1126891415); c = ii(c, d, a, b, x[(i + 14)], 15, -1416354905); b = ii(b, c, d, a, x[(i + 5)], 21, -57434055); a = ii(a, b, c, d, x[(i + 12)], 6, 1700485571); d = ii(d, a, b, c, x[(i + 3)], 10, -1894986606); c = ii(c, d, a, b, x[(i + 10)], 15, -1051523); b = ii(b, c, d, a, x[(i + 1)], 21, -2054922799); a = ii(a, b, c, d, x[(i + 8)], 6, 1873313359); d = ii(d, a, b, c, x[(i + 15)], 10, -30611744); c = ii(c, d, a, b, x[(i + 6)], 15, -1560198380); b = ii(b, c, d, a, x[(i + 13)], 21, 1309151649); a = ii(a, b, c, d, x[(i + 4)], 6, -145523070); d = ii(d, a, b, c, x[(i + 11)], 10, -1120210379); c = ii(c, d, a, b, x[(i + 2)], 15, 718787259); b = ii(b, c, d, a, x[(i + 9)], 21, -343485551); a = (a + aa); b = (b + bb); c = (c + cc); d = (d + dd); i = (i + 16); }; return ((((IntUtil.toHex(a) + IntUtil.toHex(b)) + IntUtil.toHex(c)) + IntUtil.toHex(d))); } private static function gg(a:int, b:int, c:int, d:int, x:int, s:int, t:int):int{ return (transform(g, a, b, c, d, x, s, t)); } } }//package com.adobe.crypto
Section 2
//IntUtil (com.adobe.utils.IntUtil) package com.adobe.utils { public class IntUtil { private static var hexChars:String = "0123456789abcdef"; public function IntUtil(){ super(); } public static function toHex(n:int, bigEndian:Boolean=false):String{ var s:String; var i:int; var x:int; s = ""; if (bigEndian){ i = 0; while (i < 4) { s = (s + (hexChars.charAt(((n >> (((3 - i) * 8) + 4)) & 15)) + hexChars.charAt(((n >> ((3 - i) * 8)) & 15)))); i++; }; } else { x = 0; while (x < 4) { s = (s + (hexChars.charAt(((n >> ((x * 8) + 4)) & 15)) + hexChars.charAt(((n >> (x * 8)) & 15)))); x++; }; }; return (s); } public static function ror(x:int, n:int):uint{ var nn:int; nn = (32 - n); return (((x << nn) | (x >>> (32 - nn)))); } public static function rol(x:int, n:int):int{ return (((x << n) | (x >>> (32 - n)))); } } }//package com.adobe.utils
Section 3
//Transitions (com.boostworthy.animation.easing.Transitions) package com.boostworthy.animation.easing { public final class Transitions { public static const SINE_OUT:String = "sineOut"; public static const QUAD_IN_AND_OUT:String = "quadInAndOut"; private static const ELASTIC_PERIOD:Number = 400; public static const QUART_OUT:String = "quartOut"; public static const BOUNCE:String = "bounce"; public static const EXPO_IN:String = "expoIn"; public static const SINE_IN:String = "sineIn"; public static const CUBIC_OUT:String = "cubicOut"; public static const QUINT_OUT:String = "quintOut"; public static const QUAD_IN:String = "quadIn"; public static const QUINT_IN_AND_OUT:String = "quintInAndOut"; public static const ELASTIC_OUT:String = "elasticOut"; public static const LINEAR:String = "linear"; public static const QUART_IN_AND_OUT:String = "quartInAndOut"; public static const QUAD_OUT:String = "quadOut"; public static const QUINT_IN:String = "quintIn"; public static const CUBIC_IN_AND_OUT:String = "cubicInAndOut"; public static const QUART_IN:String = "quartIn"; public static const DEFAULT_TRANSITION:String = "linear"; private static const BACK_OVERSHOOT:Number = 1.70158; public static const BACK_OUT:String = "backOut"; private static const ELASTIC_AMPLITUDE:Number = undefined; public static const CUBIC_IN:String = "cubicIn"; public static const ELASTIC_IN_AND_OUT:String = "elasticInAndOut"; public static const EXPO_OUT:String = "expoOut"; public static const BACK_IN_AND_OUT:String = "backInAndOut"; public static const ELASTIC_IN:String = "elasticIn"; public static const EXPO_IN_AND_OUT:String = "expoInAndOut"; public static const BACK_IN:String = "backIn"; public static const SINE_IN_AND_OUT:String = "sineInAndOut"; public function Transitions(){ super(); } public static function quadOut(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / d); return ((((-(c) * t) * (t - 2)) + b)); } public static function expoOut(t:Number, b:Number, c:Number, d:Number):Number{ return (((t)==d) ? (b + c) : ((c * (-(Math.pow(2, ((-10 * t) / d))) + 1)) + b)); } public static function expoInAndOut(t:Number, b:Number, c:Number, d:Number):Number{ if (t == 0){ return (b); }; if (t == d){ return ((b + c)); }; t = (t / (d / 2)); if (t < 1){ return ((((c / 2) * Math.pow(2, (10 * (t - 1)))) + b)); }; --t; return ((((c / 2) * (-(Math.pow(2, (-10 * t))) + 2)) + b)); } public static function quintOut(t:Number, b:Number, c:Number, d:Number):Number{ t = ((t / d) - 1); return (((c * (((((t * t) * t) * t) * t) + 1)) + b)); } public static function cubicIn(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / d); return (((((c * t) * t) * t) + b)); } public static function sineIn(t:Number, b:Number, c:Number, d:Number):Number{ return ((((-(c) * Math.cos(((t / d) * (Math.PI / 2)))) + b) + c)); } public static function sineOut(t:Number, b:Number, c:Number, d:Number):Number{ return (((c * Math.sin(((t / d) * (Math.PI / 2)))) + b)); } public static function quartOut(t:Number, b:Number, c:Number, d:Number):Number{ t = ((t / d) - 1); return (((-(c) * ((((t * t) * t) * t) - 1)) + b)); } public static function sineInAndOut(t:Number, b:Number, c:Number, d:Number):Number{ return ((((-(c) / 2) * (Math.cos(((t / d) * Math.PI)) - 1)) + b)); } public static function bounce(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / d); if (t < (1 / 2.75)){ return (((c * ((7.5625 * t) * t)) + b)); }; if (t < (2 / 2.75)){ t = (t - (1.5 / 2.75)); return (((c * (((7.5625 * t) * t) + 0.75)) + b)); }; if (t < (2.5 / 2.75)){ t = (t - (2.25 / 2.75)); return (((c * (((7.5625 * t) * t) + 0.9375)) + b)); }; t = (t - (2.625 / 2.75)); return (((c * (((7.5625 * t) * t) + 0.984375)) + b)); } public static function backInAndOut(t:Number, b:Number, c:Number, d:Number):Number{ var s:Number; s = BACK_OVERSHOOT; t = (t / (d / 2)); if (t < 1){ s = (s * 1.525); return ((((c / 2) * ((t * t) * (((s + 1) * t) - s))) + b)); }; t = (t - 2); s = (s * 1.525); return ((((c / 2) * (((t * t) * (((s + 1) * t) + s)) + 2)) + b)); } public static function expoIn(t:Number, b:Number, c:Number, d:Number):Number{ return (((t)==0) ? b : ((c * Math.pow(2, (10 * ((t / d) - 1)))) + b)); } public static function cubicOut(t:Number, b:Number, c:Number, d:Number):Number{ t = ((t / d) - 1); return (((c * (((t * t) * t) + 1)) + b)); } public static function linear(t:Number, b:Number, c:Number, d:Number):Number{ return ((((c * t) / d) + b)); } public static function quadIn(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / d); return ((((c * t) * t) + b)); } public static function quintIn(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / d); return (((((((c * t) * t) * t) * t) * t) + b)); } public static function elasticOut(t:Number, b:Number, c:Number, d:Number):Number{ var a:Number; var p:Number; var s:Number; a = ELASTIC_AMPLITUDE; p = ELASTIC_PERIOD; if (t == 0){ return (b); }; t = (t / d); if (t == 1){ return ((b + c)); }; if (!p){ p = (d * 0.3); }; if (((!(a)) || ((a < Math.abs(c))))){ a = c; s = (p / 4); } else { s = ((p / (2 * Math.PI)) * Math.asin((c / a))); }; return (((((a * Math.pow(2, (-10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p))) + c) + b)); } public static function quartInAndOut(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / (d / 2)); if (t < 1){ return (((((((c / 2) * t) * t) * t) * t) + b)); }; t = (t - 2); return ((((-(c) / 2) * ((((t * t) * t) * t) - 2)) + b)); } public static function quartIn(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / d); return ((((((c * t) * t) * t) * t) + b)); } public static function quadInAndOut(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / (d / 2)); if (t < 1){ return (((((c / 2) * t) * t) + b)); }; --t; return ((((-(c) / 2) * ((t * (t - 2)) - 1)) + b)); } public static function quintInAndOut(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / (d / 2)); if (t < 1){ return ((((((((c / 2) * t) * t) * t) * t) * t) + b)); }; t = (t - 2); return ((((c / 2) * (((((t * t) * t) * t) * t) + 2)) + b)); } public static function elasticIn(t:Number, b:Number, c:Number, d:Number):Number{ var a:Number; var p:Number; var s:Number; a = ELASTIC_AMPLITUDE; p = ELASTIC_PERIOD; if (t == 0){ return (b); }; t = (t / d); if (t == 1){ return ((b + c)); }; if (!p){ p = (d * 0.3); }; if (((!(a)) || ((a < Math.abs(c))))){ a = c; s = (p / 4); } else { s = ((p / (2 * Math.PI)) * Math.asin((c / a))); }; --t; return ((-(((a * Math.pow(2, (10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p)))) + b)); } public static function cubicInAndOut(t:Number, b:Number, c:Number, d:Number):Number{ t = (t / (d / 2)); if (t < 1){ return ((((((c / 2) * t) * t) * t) + b)); }; t = (t - 2); return ((((c / 2) * (((t * t) * t) + 2)) + b)); } public static function backOut(t:Number, b:Number, c:Number, d:Number):Number{ var s:Number; s = BACK_OVERSHOOT; t = ((t / d) - 1); return (((c * (((t * t) * (((s + 1) * t) + s)) + 1)) + b)); } public static function elasticInAndOut(t:Number, b:Number, c:Number, d:Number):Number{ var a:Number; var p:Number; var s:Number; a = ELASTIC_AMPLITUDE; p = ELASTIC_PERIOD; if (t == 0){ return (b); }; t = (t / (d / 2)); if (t == 2){ return ((b + c)); }; if (!p){ p = (d * (0.3 * 1.5)); }; if (((!(a)) || ((a < Math.abs(c))))){ a = c; s = (p / 4); } else { s = ((p / (2 * Math.PI)) * Math.asin((c / a))); }; if (t < 1){ --t; return (((-0.5 * ((a * Math.pow(2, (10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p)))) + b)); }; --t; return ((((((a * Math.pow(2, (-10 * t))) * Math.sin(((((t * d) - s) * (2 * Math.PI)) / p))) * 0.5) + c) + b)); } public static function backIn(t:Number, b:Number, c:Number, d:Number):Number{ var s:Number; s = BACK_OVERSHOOT; t = (t / d); return (((((c * t) * t) * (((s + 1) * t) - s)) + b)); } } }//package com.boostworthy.animation.easing
Section 4
//Renderer (com.boostworthy.animation.rendering.Renderer) package com.boostworthy.animation.rendering { import flash.display.*; import flash.events.*; import com.boostworthy.utils.logger.*; import com.boostworthy.core.*; import flash.utils.*; public class Renderer extends EventDispatcher implements IDisposable { protected var m_objStage:Stage; protected var m_fncOnTimer:Function; protected var m_objLog:ILog; protected var m_objTimer:Timer; protected var m_fncOnEnterFrame:Function; public function Renderer(fncOnEnterFrame:Function, fncOnTimer:Function, nRefreshRate:Number){ super(); if (fncOnEnterFrame != null){ m_fncOnEnterFrame = fncOnEnterFrame; m_objStage = Global.stage; }; if (fncOnTimer != null){ m_fncOnTimer = fncOnTimer; m_objTimer = new Timer(nRefreshRate, 0); m_objTimer.addEventListener(TimerEvent.TIMER, m_fncOnTimer); }; m_objLog = LogFactory.getInstance().getLog("Renderer"); } public function stop(nRenderMethod:Number):void{ if (nRenderMethod == RenderMethod.ENTER_FRAME){ stopEnterFrame(); } else { if (nRenderMethod == RenderMethod.TIMER){ stopTimer(); }; }; } protected function startTimer():void{ m_objTimer.start(); } protected function stopEnterFrame():void{ if (m_objStage){ m_objStage.removeEventListener(Event.ENTER_FRAME, m_fncOnEnterFrame); }; } protected function stopTimer():void{ m_objTimer.stop(); } public function startAll():void{ startEnterFrame(); startTimer(); } public function start(nRenderMethod:Number):void{ if (nRenderMethod == RenderMethod.ENTER_FRAME){ startEnterFrame(); } else { if (nRenderMethod == RenderMethod.TIMER){ startTimer(); }; }; } public function dispose():void{ if (((!((m_fncOnEnterFrame == null))) && (!((m_objStage == null))))){ m_objStage.removeEventListener(Event.ENTER_FRAME, m_fncOnEnterFrame); }; if (m_objTimer != null){ m_objTimer.removeEventListener(TimerEvent.TIMER, m_fncOnTimer); }; m_fncOnEnterFrame = null; m_objTimer = null; m_fncOnTimer = null; m_objStage = null; } protected function startEnterFrame():void{ if (!m_objStage){ m_objStage = Global.stage; }; if (m_objStage){ m_objStage.addEventListener(Event.ENTER_FRAME, m_fncOnEnterFrame); } else { m_objLog.warning("startEnterFrame :: Unable to add a listener to the enter frame event because a global stage reference does not exist."); }; } public function stopAll():void{ stopEnterFrame(); stopTimer(); } } }//package com.boostworthy.animation.rendering
Section 5
//RenderMethod (com.boostworthy.animation.rendering.RenderMethod) package com.boostworthy.animation.rendering { public final class RenderMethod { public static const TIMER:uint = 2; public static const ENTER_FRAME:uint = 1; public function RenderMethod(){ super(); } } }//package com.boostworthy.animation.rendering
Section 6
//Action (com.boostworthy.animation.sequence.tweens.Action) package com.boostworthy.animation.sequence.tweens { public class Action implements ITween { protected const PROPERTY:String = "action"; protected var m_aParamsForward:Array; protected var m_uPreviousFrame:uint; protected var m_uLastFrame:uint; protected var m_fncReverse:Function; protected var m_uFirstFrame:uint; protected var m_aParamsReverse:Array; protected var m_fncForward:Function; public function Action(fncForward:Function, aParamsForward:Array, fncReverse:Function, aParamsReverse:Array, uFrame:uint){ super(); m_fncForward = fncForward; m_aParamsForward = aParamsForward; m_fncReverse = fncReverse; m_aParamsReverse = aParamsReverse; m_uFirstFrame = uFrame; m_uLastFrame = uFrame; m_uPreviousFrame = 1; } public function get lastFrame():uint{ return (m_uLastFrame); } public function get target():Object{ return (null); } public function get property():String{ return (PROPERTY); } public function get firstFrame():uint{ return (m_uFirstFrame); } public function clone():ITween{ return (new Action(m_fncForward, m_aParamsForward, m_fncReverse, m_aParamsReverse, m_uFirstFrame)); } public function renderFrame(uFrame:uint):void{ if (uFrame == m_uFirstFrame){ if (m_uPreviousFrame > uFrame){ m_fncReverse.apply(null, m_aParamsReverse); } else { m_fncForward.apply(null, m_aParamsForward); }; }; m_uPreviousFrame = uFrame; } } }//package com.boostworthy.animation.sequence.tweens
Section 7
//FilterTween (com.boostworthy.animation.sequence.tweens.FilterTween) package com.boostworthy.animation.sequence.tweens { import flash.display.*; import flash.filters.*; import com.boostworthy.animation.easing.*; public class FilterTween implements ITween { protected const DEFAULT_TRANSITION:String = "linear"; protected var m_objToTween:DisplayObject; protected var m_strTransition:String; protected var m_bIsDirty:Boolean; protected var m_strProperty:String; protected var m_uFirstFrame:uint; protected var m_uLastFrame:uint; protected var m_nTargetValue:Number; protected var m_nChangeValue:Number; protected var m_nStartValue:Number; protected var m_objFilter:Class; protected var m_fncTransition:Function; public function FilterTween(objToTween:DisplayObject, objFilter:Class, strProperty:String, nTargetValue:Number, uFirstFrame:uint, uLastFrame:uint, strTransition:String="linear"){ super(); m_objToTween = objToTween; m_objFilter = objFilter; m_strProperty = strProperty; m_nTargetValue = nTargetValue; m_uFirstFrame = uFirstFrame; m_uLastFrame = uLastFrame; m_strTransition = strTransition; m_fncTransition = Transitions[m_strTransition]; } protected function getFilters():Array{ var aFilters:Array; var iLength:int; var i:int; aFilters = new Array(); iLength = m_objToTween.filters.length; i = 0; while (i < iLength) { if (!(m_objToTween.filters[i] is m_objFilter)){ aFilters.push(m_objToTween.filters[i]); }; i++; }; return (aFilters); } public function renderFrame(uFrame:uint):void{ var nTime:Number; var iLength:int; var i:int; if ((((uFrame < m_uFirstFrame)) && (!(isNaN(m_nStartValue))))){ updateTargetFilter(m_nStartValue); m_bIsDirty = true; } else { if ((((uFrame >= m_uFirstFrame)) && ((uFrame <= m_uLastFrame)))){ if (((isNaN(m_nStartValue)) && ((uFrame == m_uFirstFrame)))){ iLength = m_objToTween.filters.length; i = 0; while (i < iLength) { if ((m_objToTween.filters[i] is m_objFilter)){ m_nStartValue = m_objToTween.filters[i][m_strProperty]; }; i++; }; if (isNaN(m_nStartValue)){ throw (new Error("ERROR -> RenderFrame :: Constructor :: An invalid filter and/or filter property was specified.")); }; m_nChangeValue = (m_nTargetValue - m_nStartValue); }; nTime = ((uFrame - m_uFirstFrame) / (m_uLastFrame - m_uFirstFrame)); updateTargetFilter(m_fncTransition(nTime, m_nStartValue, m_nChangeValue, 1)); m_bIsDirty = true; } else { if ((((uFrame > m_uLastFrame)) && (m_bIsDirty))){ updateTargetFilter(m_nTargetValue); m_bIsDirty = false; }; }; }; } public function get target():Object{ return (m_objToTween); } protected function updateTargetFilter(nValue:Number):void{ var aFilters:Array; var objFilter:BitmapFilter; aFilters = getFilters(); objFilter = getTargetFilter(); objFilter[m_strProperty] = nValue; aFilters.push(objFilter); m_objToTween.filters = aFilters; } public function get property():String{ return (m_strProperty); } public function get lastFrame():uint{ return (m_uLastFrame); } protected function getTargetFilter():BitmapFilter{ var iLength:int; var i:int; iLength = m_objToTween.filters.length; i = 0; while (i < iLength) { if ((m_objToTween.filters[i] is m_objFilter)){ return (m_objToTween.filters[i]); }; i++; }; return (null); } public function clone():ITween{ return (new FilterTween(m_objToTween, m_objFilter, m_strProperty, m_nTargetValue, m_uFirstFrame, m_uLastFrame, m_strTransition)); } public function get firstFrame():uint{ return (m_uFirstFrame); } } }//package com.boostworthy.animation.sequence.tweens
Section 8
//ITween (com.boostworthy.animation.sequence.tweens.ITween) package com.boostworthy.animation.sequence.tweens { public interface ITween { function clone():ITween; function get property():String; function get lastFrame():uint; function renderFrame(E:\Work\GameFrameworkAS3.0_working_copy;com\boostworthy\animation\sequence\tweens;ITween.as:uint):void; function get target():Object; function get firstFrame():uint; } }//package com.boostworthy.animation.sequence.tweens
Section 9
//Tween (com.boostworthy.animation.sequence.tweens.Tween) package com.boostworthy.animation.sequence.tweens { import com.boostworthy.animation.easing.*; public class Tween implements ITween { protected const DEFAULT_TRANSITION:String = "linear"; protected var m_objToTween:Object; protected var m_strTransition:String; protected var m_bIsDirty:Boolean; protected var m_strProperty:String; protected var m_uFirstFrame:uint; protected var m_uLastFrame:uint; protected var m_nTargetValue:Number; protected var m_nChangeValue:Number; protected var m_nStartValue:Number; protected var m_fncTransition:Function; public function Tween(objToTween:Object, strProperty:String, nTargetValue:Number, uFirstFrame:uint, uLastFrame:uint, strTransition:String="linear"){ super(); m_objToTween = objToTween; m_strProperty = strProperty; m_nTargetValue = nTargetValue; m_uFirstFrame = uFirstFrame; m_uLastFrame = uLastFrame; m_strTransition = strTransition; m_fncTransition = Transitions[m_strTransition]; } public function renderFrame(uFrame:uint):void{ var nTime:Number; if ((((uFrame < m_uFirstFrame)) && (!(isNaN(m_nStartValue))))){ m_objToTween[m_strProperty] = m_nStartValue; m_bIsDirty = true; } else { if ((((uFrame >= m_uFirstFrame)) && ((uFrame <= m_uLastFrame)))){ nTime = ((uFrame - m_uFirstFrame) / (m_uLastFrame - m_uFirstFrame)); if (((isNaN(m_nStartValue)) && ((uFrame == m_uFirstFrame)))){ m_nStartValue = m_objToTween[m_strProperty]; m_nChangeValue = (m_nTargetValue - m_nStartValue); }; m_objToTween[m_strProperty] = m_fncTransition(nTime, m_nStartValue, m_nChangeValue, 1); m_bIsDirty = true; } else { if ((((uFrame > m_uLastFrame)) && (m_bIsDirty))){ m_objToTween[m_strProperty] = m_nTargetValue; m_bIsDirty = false; }; }; }; } public function get target():Object{ return (m_objToTween); } public function get property():String{ return (m_strProperty); } public function clone():ITween{ return (new Tween(m_objToTween, m_strProperty, m_nTargetValue, m_uFirstFrame, m_uLastFrame, m_strTransition)); } public function get lastFrame():uint{ return (m_uLastFrame); } public function get firstFrame():uint{ return (m_uFirstFrame); } } }//package com.boostworthy.animation.sequence.tweens
Section 10
//Timeline (com.boostworthy.animation.sequence.Timeline) package com.boostworthy.animation.sequence { import com.boostworthy.animation.sequence.tweens.*; import flash.events.*; import com.boostworthy.collections.iterators.*; import com.boostworthy.events.*; import com.boostworthy.animation.rendering.*; import com.boostworthy.core.*; import com.boostworthy.animation.*; public class Timeline extends EventDispatcher implements IDisposable { protected const DEFAULT_LOOP:Boolean = false; protected const DEFAULT_RENDER_METHOD:uint = 2; protected const DEFAULT_FRAME_RATE:Number = 60; protected var m_uFrameRate:uint; protected var m_uFrame:uint; protected var m_objRendererNext:Renderer; protected var m_nRefreshRate:Number; protected var m_uRenderMethod:uint; protected var m_objRendererPrev:Renderer; protected var m_objTweenStack:TweenStack; protected var m_bLoop:Boolean; protected var m_uLength:uint; public function Timeline(uRenderMethod:uint=2, nFrameRate:Number=60){ super(); init(uRenderMethod, nFrameRate); } public function stop():void{ m_objRendererPrev.stop(m_uRenderMethod); m_objRendererNext.stop(m_uRenderMethod); dispatchEvent(new AnimationEvent(AnimationEvent.STOP)); } public function playReverse():void{ stop(); dispatchEvent(new AnimationEvent(AnimationEvent.START)); m_objRendererPrev.start(m_uRenderMethod); } protected function init(uRenderMethod:uint, nFrameRate:Number):void{ BoostworthyAnimation.log(); setFrameRate(nFrameRate); m_uRenderMethod = uRenderMethod; m_objRendererPrev = new Renderer(onPrevFrameEF, onPrevFrameT, m_nRefreshRate); m_objRendererNext = new Renderer(onNextFrameEF, onNextFrameT, m_nRefreshRate); m_objTweenStack = new TweenStack(); m_uFrame = (m_uLength = 1); loop = DEFAULT_LOOP; } public function prevFrame():void{ setFrame((m_uFrame - 1)); } public function gotoAndStop(uFrame:uint):void{ stop(); setFrame(uFrame); } protected function onNextFrameT(objEvent:TimerEvent):void{ nextFrame(); objEvent.updateAfterEvent(); } protected function render(bIsReverse:Boolean=false):void{ var objIterator:IIterator; objIterator = m_objTweenStack.getIterator((bIsReverse) ? IteratorType.ARRAY_REVERSE : IteratorType.ARRAY_FORWARD); while (objIterator.hasNext()) { objIterator.next().renderFrame(m_uFrame); }; } public function get loop():Boolean{ return (m_bLoop); } public function dispose():void{ stop(); m_objRendererPrev.dispose(); m_objRendererNext.dispose(); m_objTweenStack.dispose(); m_uRenderMethod = NaN; m_uFrameRate = NaN; m_nRefreshRate = NaN; m_uFrame = NaN; m_uLength = NaN; m_bLoop = false; } public function setFrameRate(nFrameRate:Number):void{ m_uFrameRate = ((nFrameRate)>0) ? nFrameRate : DEFAULT_FRAME_RATE; m_nRefreshRate = Math.floor((1000 / m_uFrameRate)); } protected function setFrame(uFrame:Number):void{ var bIsReverse:Boolean; var bIsFinished:Boolean; bIsReverse = false; bIsFinished = false; if (uFrame > m_uLength){ if (m_bLoop){ uFrame = 1; } else { bIsFinished = true; }; }; if (uFrame < 1){ if (m_bLoop){ uFrame = m_uLength; bIsReverse = true; } else { bIsFinished = true; }; }; m_uFrame = Math.min(Math.max(1, uFrame), m_uLength); if (!bIsFinished){ render(bIsReverse); }; dispatchEvent(new AnimationEvent(AnimationEvent.CHANGE)); if (bIsFinished){ stop(); dispatchEvent(new AnimationEvent(AnimationEvent.FINISH)); }; } public function nextFrame():void{ setFrame((m_uFrame + 1)); } public function play():void{ stop(); dispatchEvent(new AnimationEvent(AnimationEvent.START)); m_objRendererNext.start(m_uRenderMethod); } protected function onPrevFrameEF(objEvent:Event):void{ prevFrame(); } public function gotoAndPlay(uFrame:uint):void{ stop(); setFrame(uFrame); play(); } public function set loop(bLoop:Boolean):void{ m_bLoop = bLoop; } public function addTween(objTween:ITween):void{ var objNewTween:ITween; objNewTween = objTween.clone(); m_uLength = ((objNewTween.lastFrame)>m_uLength) ? objNewTween.lastFrame : m_uLength; m_objTweenStack.addElement(objNewTween); computeFrameData(objNewTween.firstFrame, objNewTween.lastFrame); } protected function computeFrameData(uFirstFrame:uint, uLastFrame:uint):void{ var objTweenIterator:IIterator; var i:int; var objTween:ITween; objTweenIterator = m_objTweenStack.getIterator(IteratorType.ARRAY_REVERSE); i = uFirstFrame; while (i <= uLastFrame) { while (objTweenIterator.hasNext()) { objTween = (objTweenIterator.next() as ITween); if (!(objTween is Action)){ objTween.renderFrame(i); }; }; objTweenIterator.reset(); i++; }; render(); } public function get length():Number{ return (m_uLength); } protected function onPrevFrameT(objEvent:TimerEvent):void{ prevFrame(); objEvent.updateAfterEvent(); } public function gotoAndPlayReverse(uFrame:uint):void{ stop(); setFrame(uFrame); playReverse(); } protected function onNextFrameEF(objEvent:Event):void{ nextFrame(); } } }//package com.boostworthy.animation.sequence
Section 11
//TweenStack (com.boostworthy.animation.sequence.TweenStack) package com.boostworthy.animation.sequence { import com.boostworthy.animation.sequence.tweens.*; import com.boostworthy.collections.iterators.*; import com.boostworthy.collections.*; public class TweenStack extends Stack { public function TweenStack(){ super(); } override public function addElement(objElement:Object):void{ var objNewTween:ITween; var aTweens:Array; var objIterator:IIterator; var iLength:int; var i:int; var objTween:ITween; objNewTween = (objElement as ITween); aTweens = new Array(); objIterator = getIterator(); while (objIterator.hasNext()) { objTween = (objIterator.next() as ITween); if ((((objTween.target == objNewTween.target)) && ((objTween.property == objNewTween.property)))){ if (objTween.firstFrame > objNewTween.firstFrame){ aTweens.push(objTween.clone()); removeElement(objTween); }; }; }; super.addElement(objNewTween); iLength = aTweens.length; i = 0; while (i < iLength) { super.addElement(aTweens[i]); i++; }; } } }//package com.boostworthy.animation.sequence
Section 12
//BoostworthyAnimation (com.boostworthy.animation.BoostworthyAnimation) package com.boostworthy.animation { import com.boostworthy.utils.logger.*; public final class BoostworthyAnimation { public static const VERSION:String = "2.1"; public static const AUTHOR:String = "Copyright (c) 2007 Ryan Taylor | http://www.boostworthy.com"; public static const NAME:String = "Boostworthy Animation System"; public static const DATE:String = "06.07.2007"; private static var c_bIsLogged:Boolean; public function BoostworthyAnimation(){ super(); } public static function log():void{ if (!c_bIsLogged){ LogFactory.getInstance().getLog(NAME).info(((("Version " + VERSION) + " :: ") + AUTHOR)); c_bIsLogged = true; }; } } }//package com.boostworthy.animation
Section 13
//ForwardArrayIterator (com.boostworthy.collections.iterators.ForwardArrayIterator) package com.boostworthy.collections.iterators { public class ForwardArrayIterator implements IIterator { private var m_uIndex:uint; private var m_aData:Array; public function ForwardArrayIterator(aData:Array){ super(); m_aData = aData; reset(); } public function reset():void{ m_uIndex = 0; } public function hasNext():Boolean{ return ((m_uIndex < m_aData.length)); } public function next():Object{ return (m_aData[m_uIndex++]); } } }//package com.boostworthy.collections.iterators
Section 14
//IIterator (com.boostworthy.collections.iterators.IIterator) package com.boostworthy.collections.iterators { public interface IIterator { function next():Object; function hasNext():Boolean; function reset():void; } }//package com.boostworthy.collections.iterators
Section 15
//IteratorType (com.boostworthy.collections.iterators.IteratorType) package com.boostworthy.collections.iterators { public final class IteratorType { public static const NULL:uint = 1; public static const ARRAY_REVERSE:uint = 4; public static const ARRAY_FORWARD:uint = 2; public function IteratorType(){ super(); } } }//package com.boostworthy.collections.iterators
Section 16
//ReverseArrayIterator (com.boostworthy.collections.iterators.ReverseArrayIterator) package com.boostworthy.collections.iterators { public class ReverseArrayIterator implements IIterator { private var m_uIndex:uint; private var m_aData:Array; public function ReverseArrayIterator(aData:Array){ super(); m_aData = aData; reset(); } public function reset():void{ m_uIndex = m_aData.length; } public function hasNext():Boolean{ return ((m_uIndex > 0)); } public function next():Object{ return (m_aData[--m_uIndex]); } } }//package com.boostworthy.collections.iterators
Section 17
//HashMap (com.boostworthy.collections.HashMap) package com.boostworthy.collections { import com.boostworthy.collections.iterators.*; import com.boostworthy.core.*; public class HashMap implements ICollection, IDisposable { protected var m_aKeys:Array; protected var m_aValues:Array; public function HashMap(objMap:Object=null){ super(); init(objMap); } public function containsKey(objKey:Object):Boolean{ return (!((searchForKey(objKey) == Global.NULL_INDEX))); } public function remove(objKey:Object):void{ var iKeyIndex:int; iKeyIndex = searchForKey(objKey); if (iKeyIndex != Global.NULL_INDEX){ m_aKeys.splice(iKeyIndex, 1); m_aValues.splice(iKeyIndex, 1); }; } protected function searchForKey(objKey:Object):int{ var nLength:int; var i:int; nLength = m_aKeys.length; i = 0; while (i < nLength) { if (m_aKeys[i] === objKey){ return (i); }; i++; }; return (Global.NULL_INDEX); } public function getValueIterator(uIterator:uint=2):IIterator{ if (uIterator == IteratorType.ARRAY_FORWARD){ return (new ForwardArrayIterator(m_aValues.concat())); }; if (uIterator == IteratorType.ARRAY_REVERSE){ return (new ReverseArrayIterator(m_aValues.concat())); }; return (new ForwardArrayIterator(m_aValues.concat())); } public function getIterator(uIterator:uint=2):IIterator{ return (getValueIterator(uIterator)); } public function putMap(objMap:Object):void{ var strKey:String; for (strKey in objMap) { put(strKey, objMap[strKey]); }; } public function put(objKey:Object, objValue:Object):void{ remove(objKey); m_aKeys.push(objKey); m_aValues.push(objValue); } protected function init(objMap:Object):void{ dispose(); if (objMap != null){ putMap(objMap); }; } public function get length():uint{ return (m_aKeys.length); } public function get(objKey:Object):Object{ var iKeyIndex:int; iKeyIndex = searchForKey(objKey); if (iKeyIndex != Global.NULL_INDEX){ return (m_aValues[iKeyIndex]); }; return (null); } public function getKeyIterator(uIterator:uint=2):IIterator{ if (uIterator == IteratorType.ARRAY_FORWARD){ return (new ForwardArrayIterator(m_aKeys.concat())); }; if (uIterator == IteratorType.ARRAY_REVERSE){ return (new ReverseArrayIterator(m_aKeys.concat())); }; return (new ForwardArrayIterator(m_aKeys.concat())); } public function clone():HashMap{ var objHashMap:HashMap; var nLength:int; var i:int; objHashMap = new HashMap(); nLength = m_aKeys.length; i = 0; while (i < nLength) { objHashMap.put(m_aKeys[i], m_aValues[i]); i++; }; return (objHashMap); } public function dispose():void{ m_aKeys = new Array(); m_aValues = new Array(); } } }//package com.boostworthy.collections
Section 18
//ICollection (com.boostworthy.collections.ICollection) package com.boostworthy.collections { import com.boostworthy.collections.iterators.*; public interface ICollection { function getIterator(:uint=2):IIterator; } }//package com.boostworthy.collections
Section 19
//Stack (com.boostworthy.collections.Stack) package com.boostworthy.collections { import com.boostworthy.collections.iterators.*; import com.boostworthy.core.*; public class Stack implements ICollection, IDisposable { protected var m_aData:Array; public function Stack(){ super(); dispose(); } public function getIterator(uIterator:uint=2):IIterator{ if (uIterator == IteratorType.ARRAY_FORWARD){ return (new ForwardArrayIterator(m_aData.concat())); }; if (uIterator == IteratorType.ARRAY_REVERSE){ return (new ReverseArrayIterator(m_aData.concat())); }; return (new ForwardArrayIterator(m_aData.concat())); } public function get length():uint{ return (m_aData.length); } private function getElementIndex(objElement:Object):int{ var i:int; i = 0; while (i < m_aData.length) { if (m_aData[i] === objElement){ return (i); }; i++; }; return (Global.NULL_INDEX); } public function removeElement(objElement:Object):void{ var iIndex:int; iIndex = getElementIndex(objElement); if (iIndex != Global.NULL_INDEX){ m_aData.splice(iIndex, 1); }; } public function addElement(objElement:Object):void{ m_aData.unshift(objElement); } public function dispose():void{ m_aData = new Array(); } } }//package com.boostworthy.collections
Section 20
//Global (com.boostworthy.core.Global) package com.boostworthy.core { import flash.display.*; public final class Global { private static var c_objStage:Stage; public static var NULL_INDEX:int = -1; public function Global(){ super(); throw (new Error("ERROR -> Global :: Constructor :: The 'Global' class is not meant to be instantiated.")); } public static function set stage(objStage:Stage):void{ c_objStage = objStage; } public static function get stage():Stage{ return (c_objStage); } } }//package com.boostworthy.core
Section 21
//IDisposable (com.boostworthy.core.IDisposable) package com.boostworthy.core { public interface IDisposable { function dispose():void; } }//package com.boostworthy.core
Section 22
//AnimationEvent (com.boostworthy.events.AnimationEvent) package com.boostworthy.events { import flash.events.*; public class AnimationEvent extends Event { protected var m_objTarget:Object; protected var m_strProperty:String; public static const CHANGE:String = "animationChange"; public static const STOP:String = "animationStop"; public static const START:String = "animationStart"; public static const FINISH:String = "animationFinish"; public function AnimationEvent(strType:String, objTarget:Object=null, strProperty:String=""){ super(strType); m_objTarget = objTarget; m_strProperty = strProperty; } public function get animTarget():Object{ return (m_objTarget); } public function get animProperty():String{ return (m_strProperty); } } }//package com.boostworthy.events
Section 23
//ILog (com.boostworthy.utils.logger.ILog) package com.boostworthy.utils.logger { public interface ILog { function getName():String; function setLevel(com.boostworthy.utils.logger:ILog/com.boostworthy.utils.logger:ILog:getName:uint):void; function debug(com.boostworthy.utils.logger:ILog/com.boostworthy.utils.logger:ILog:getName:String):void; function severe(com.boostworthy.utils.logger:ILog/com.boostworthy.utils.logger:ILog:getName:String):void; function info(com.boostworthy.utils.logger:ILog/com.boostworthy.utils.logger:ILog:getName:String):void; function warning(com.boostworthy.utils.logger:ILog/com.boostworthy.utils.logger:ILog:getName:String):void; function getLevel():uint; } }//package com.boostworthy.utils.logger
Section 24
//Log (com.boostworthy.utils.logger.Log) package com.boostworthy.utils.logger { public class Log implements ILog { protected var m_strName:String; protected var m_uLevel:uint; public function Log(strName:String, uLevel:uint){ super(); init(strName, uLevel); } public function getName():String{ return (m_strName); } protected function output(strMessage:String, uLevel:uint):void{ if (((!((m_uLevel & LogLevel.OFF))) && ((m_uLevel >= uLevel)))){ trace(createOutputMessage(strMessage, uLevel)); }; } public function setLevel(uLevel:uint):void{ m_uLevel = uLevel; } public function getLevel():uint{ return (m_uLevel); } protected function init(strName:String, uLevel:uint):void{ m_strName = strName; m_uLevel = uLevel; } public function debug(strMessage:String):void{ output(strMessage, LogLevel.DEBUG); } public function warning(strMessage:String):void{ output(strMessage, LogLevel.WARNING); } protected function createOutputMessage(strMessage:String, uLevel:uint):String{ return ((((((m_strName + " (") + getLevelName(uLevel)) + ") :: ") + strMessage) + "\n")); } public function info(strMessage:String):void{ output(strMessage, LogLevel.INFO); } protected function getLevelName(uLevel:uint):String{ switch (uLevel){ case LogLevel.OFF: return ("OFF"); case LogLevel.SEVERE: return ("SEVERE"); case LogLevel.WARNING: return ("WARNING"); case LogLevel.INFO: return ("INFO"); case LogLevel.DEBUG: return ("DEBUG"); default: return (""); }; } public function severe(strMessage:String):void{ output(strMessage, LogLevel.SEVERE); } } }//package com.boostworthy.utils.logger
Section 25
//LogFactory (com.boostworthy.utils.logger.LogFactory) package com.boostworthy.utils.logger { import com.boostworthy.collections.iterators.*; import com.boostworthy.collections.*; import com.boostworthy.core.*; public class LogFactory implements IDisposable { private var m_uLevel:uint; private var m_objLogHash:HashMap; private static var c_objInstance:LogFactory; public function LogFactory(objEnforcer:SingletonEnforcer){ super(); init(); } public function setLevel(uLevel:uint):void{ var objIterator:IIterator; m_uLevel = uLevel; objIterator = m_objLogHash.getValueIterator(); while (objIterator.hasNext()) { objIterator.next().setLevel(m_uLevel); }; } public function getLog(strLogName:String):ILog{ if (m_objLogHash.containsKey(strLogName)){ return ((m_objLogHash.get(strLogName) as ILog)); }; m_objLogHash.put(strLogName, new Log(strLogName, m_uLevel)); return ((m_objLogHash.get(strLogName) as ILog)); } protected function init():void{ m_uLevel = LogSettings.DEFAULT_LOG_LEVEL; m_objLogHash = new HashMap(); } public function getLevel():uint{ return (m_uLevel); } public function dispose():void{ m_objLogHash.dispose(); } public static function getInstance():LogFactory{ if (c_objInstance == null){ c_objInstance = new LogFactory(new SingletonEnforcer()); }; return (c_objInstance); } } }//package com.boostworthy.utils.logger class SingletonEnforcer { private function SingletonEnforcer(){ super(); } }
Section 26
//LogLevel (com.boostworthy.utils.logger.LogLevel) package com.boostworthy.utils.logger { public final class LogLevel { public static const SEVERE:uint = 2; public static const INFO:uint = 8; public static const DEBUG:uint = 16; public static const WARNING:uint = 4; public static const OFF:uint = 1; public function LogLevel(){ super(); } } }//package com.boostworthy.utils.logger
Section 27
//LogSettings (com.boostworthy.utils.logger.LogSettings) package com.boostworthy.utils.logger { public final class LogSettings { public static const DEFAULT_LOG_LEVEL:uint = LogLevel.DEBUG; public function LogSettings(){ super(); } } }//package com.boostworthy.utils.logger
Section 28
//Color (fl.motion.Color) package fl.motion { import flash.display.*; import flash.geom.*; public class Color extends ColorTransform { private var _tintMultiplier:Number;// = 0 private var _tintColor:Number;// = 0 public function Color(redMultiplier:Number=1, greenMultiplier:Number=1, blueMultiplier:Number=1, alphaMultiplier:Number=1, redOffset:Number=0, greenOffset:Number=0, blueOffset:Number=0, alphaOffset:Number=0){ _tintColor = 0; _tintMultiplier = 0; super(redMultiplier, greenMultiplier, blueMultiplier, alphaMultiplier, redOffset, greenOffset, blueOffset, alphaOffset); } public function setTint(tintColor:uint, tintMultiplier:Number):void{ var r:uint; var g:uint; var b:uint; this._tintColor = tintColor; this._tintMultiplier = tintMultiplier; this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = (1 - tintMultiplier))); r = ((tintColor >> 16) & 0xFF); g = ((tintColor >> 8) & 0xFF); b = (tintColor & 0xFF); this.redOffset = Math.round((r * tintMultiplier)); this.greenOffset = Math.round((g * tintMultiplier)); this.blueOffset = Math.round((b * tintMultiplier)); } public function set tintColor(value:uint):void{ this.setTint(value, this.tintMultiplier); } public function get brightness():Number{ return ((this.redOffset) ? (1 - this.redMultiplier) : (this.redMultiplier - 1)); } private function deriveTintColor():uint{ var ratio:Number; var r:uint; var g:uint; var b:uint; var colorNum:uint; ratio = (1 / this.tintMultiplier); r = Math.round((this.redOffset * ratio)); g = Math.round((this.greenOffset * ratio)); b = Math.round((this.blueOffset * ratio)); colorNum = (((r << 16) | (g << 8)) | b); return (colorNum); } public function get tintMultiplier():Number{ return (this._tintMultiplier); } public function get tintColor():uint{ return (this._tintColor); } public function set brightness(value:Number):void{ var percent:Number; var offset:Number; if (value > 1){ value = 1; } else { if (value < -1){ value = -1; }; }; percent = (1 - Math.abs(value)); offset = 0; if (value > 0){ offset = (value * 0xFF); }; this.redMultiplier = (this.greenMultiplier = (this.blueMultiplier = percent)); this.redOffset = (this.greenOffset = (this.blueOffset = offset)); } public function set tintMultiplier(value:Number):void{ this.setTint(this.tintColor, value); } private function parseXML(xml:XML=null):Color{ var firstChild:XML; var att:XML; var name:String; var tintColorNumber:uint; if (!xml){ return (this); }; firstChild = xml.elements()[0]; if (!firstChild){ return (this); }; for each (att in firstChild.attributes()) { name = att.localName(); if (name == "tintColor"){ tintColorNumber = (Number(att.toString()) as uint); this.tintColor = tintColorNumber; } else { this[name] = Number(att.toString()); }; }; return (this); } public static function interpolateColor(fromColor:uint, toColor:uint, progress:Number):uint{ var q:Number; var fromA:uint; var fromR:uint; var fromG:uint; var fromB:uint; var toA:uint; var toR:uint; var toG:uint; var toB:uint; var resultA:uint; var resultR:uint; var resultG:uint; var resultB:uint; var resultColor:uint; q = (1 - progress); fromA = ((fromColor >> 24) & 0xFF); fromR = ((fromColor >> 16) & 0xFF); fromG = ((fromColor >> 8) & 0xFF); fromB = (fromColor & 0xFF); toA = ((toColor >> 24) & 0xFF); toR = ((toColor >> 16) & 0xFF); toG = ((toColor >> 8) & 0xFF); toB = (toColor & 0xFF); resultA = ((fromA * q) + (toA * progress)); resultR = ((fromR * q) + (toR * progress)); resultG = ((fromG * q) + (toG * progress)); resultB = ((fromB * q) + (toB * progress)); resultColor = ((((resultA << 24) | (resultR << 16)) | (resultG << 8)) | resultB); return (resultColor); } public static function interpolateTransform(fromColor:ColorTransform, toColor:ColorTransform, progress:Number):ColorTransform{ var q:Number; var resultColor:ColorTransform; q = (1 - progress); resultColor = new ColorTransform(((fromColor.redMultiplier * q) + (toColor.redMultiplier * progress)), ((fromColor.greenMultiplier * q) + (toColor.greenMultiplier * progress)), ((fromColor.blueMultiplier * q) + (toColor.blueMultiplier * progress)), ((fromColor.alphaMultiplier * q) + (toColor.alphaMultiplier * progress)), ((fromColor.redOffset * q) + (toColor.redOffset * progress)), ((fromColor.greenOffset * q) + (toColor.greenOffset * progress)), ((fromColor.blueOffset * q) + (toColor.blueOffset * progress)), ((fromColor.alphaOffset * q) + (toColor.alphaOffset * progress))); return (resultColor); } public static function fromXML(xml:XML):Color{ return (Color(new (Color).parseXML(xml))); } } }//package fl.motion
Section 29
//Application (gamework.application.Application) package gamework.application { import flash.display.*; import flash.events.*; import gamework.preloaders.*; import gamework.events.*; import flash.system.*; public class Application extends MovieClip { private var mainView:DisplayObject; private var cursorHolderSprite:Sprite; private var backgroundShape:Shape; private var appMaskSprite:Sprite; public function Application(){ super(); stop(); if (((root) && (root.loaderInfo))){ root.loaderInfo.addEventListener(Event.INIT, onRootInitHandler); }; } protected function createMask(color:uint=0):void{ var graphics:Graphics; var appWidth:int; var appHeight:int; var dw:int; var dh:int; if (appMaskSprite){ return; }; appMaskSprite = new Sprite(); graphics = appMaskSprite.graphics; graphics.lineStyle(); graphics.beginFill(color, 1); appWidth = ApplicationGlobals._width; appHeight = ApplicationGlobals._height; graphics.moveTo(0, 0); graphics.lineTo(appWidth, 0); graphics.lineTo(appWidth, appHeight); graphics.lineTo(0, appHeight); graphics.lineTo(0, 0); dw = ((Capabilities.screenResolutionX - ApplicationGlobals.WIDTH) / 2); dh = ((Capabilities.screenResolutionY - ApplicationGlobals.HEIGHT) / 2); graphics.moveTo(-(dw), -(dh)); graphics.lineTo((appWidth + dw), -(dh)); graphics.lineTo((appWidth + dw), (appHeight + dh)); graphics.lineTo(-(dw), (appHeight + dh)); graphics.lineTo(-(dw), -(dh)); graphics.endFill(); addChild(appMaskSprite); sortChildren(); } protected function createMainView(className:String):void{ var mainViewClass:Class; if (mainView){ return; }; mainViewClass = (getDefinitionByName(className) as Class); mainView = new (mainViewClass); addChild(mainView); sortChildren(); } public function getDefinitionByName(name:String):Object{ var domain:ApplicationDomain; domain = loaderInfo.applicationDomain; if (domain.hasDefinition(name)){ return (domain.getDefinition(name)); }; return (null); } protected function startPreloading(preloader:AbstractPreloader=null):void{ if (preloader == null){ preloader = new EmptyPreloader(); addChild(preloader); }; if (preloader.completed){ if ((preloader is EmptyPreloader)){ removeChild(preloader); }; completePreloading(); } else { preloader.addEventListener(PreloaderEvent.COMPLETE, preloadingCompleteHandler); }; } private function onAddedToStageHandler(event:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onAddedToStageHandler); initialize(); } private function preloadingCompleteHandler(event:PreloaderEvent):void{ var preloader:AbstractPreloader; preloader = (event.target as AbstractPreloader); preloader.removeEventListener(PreloaderEvent.COMPLETE, preloadingCompleteHandler); if ((preloader is EmptyPreloader)){ removeChild(preloader); }; completePreloading(); } protected function completePreloading():void{ gotoAndStop("start"); } protected function setGlobals(id:String, version:String, sharedObjectName:String, sharedObjectPath:String=null):void{ ApplicationGlobals._id = id; ApplicationGlobals._version = version; ApplicationGlobals._sharedObjectName = sharedObjectName; ApplicationGlobals._sharedObjectPath = sharedObjectPath; } protected function createBackground(color:uint=0):void{ var graphics:Graphics; if (backgroundShape){ return; }; backgroundShape = new Shape(); graphics = backgroundShape.graphics; graphics.lineStyle(); graphics.beginFill(color, 1); graphics.drawRect(0, 0, ApplicationGlobals._width, ApplicationGlobals._height); graphics.endFill(); addChild(backgroundShape); sortChildren(); } protected function initialize():void{ ApplicationGlobals._application = this; ApplicationGlobals._stage = stage; ApplicationGlobals._width = root.loaderInfo.width; ApplicationGlobals._height = root.loaderInfo.height; stage.scaleMode = StageScaleMode.NO_SCALE; } protected function removeMask():void{ if (appMaskSprite){ removeChild(appMaskSprite); appMaskSprite = null; }; } public function get cursorHolder():Sprite{ if (!cursorHolderSprite){ cursorHolderSprite = new Sprite(); cursorHolderSprite.mouseEnabled = false; cursorHolderSprite.mouseChildren = false; addChild(cursorHolderSprite); sortChildren(); }; return (cursorHolderSprite); } private function sortChildren():void{ var children:Array; var numChildren:int; var i:int; children = []; if (backgroundShape){ children.push(backgroundShape); }; if (mainView){ children.push(mainView); }; if (appMaskSprite){ children.push(appMaskSprite); }; if (cursorHolderSprite){ children.push(cursorHolderSprite); }; numChildren = children.length; i = 0; while (i < numChildren) { setChildIndex(children[i], i); i++; }; } public function getURLVariable(name:String, caseSensitive:Boolean=false):String{ var parameters:Object; var nameLowerCase:String; var varName:String; parameters = loaderInfo.parameters; if (caseSensitive){ return (parameters[name]); }; nameLowerCase = name.toLowerCase(); for (varName in parameters) { if (varName.toLowerCase() == nameLowerCase){ return (parameters[varName]); }; }; return (null); } protected function removeBackground():void{ if (backgroundShape){ removeChild(backgroundShape); backgroundShape = null; }; } private function onRootInitHandler(event:Event):void{ root.loaderInfo.removeEventListener(Event.INIT, onRootInitHandler); if (stage){ initialize(); } else { addEventListener(Event.ADDED_TO_STAGE, onAddedToStageHandler); }; } } }//package gamework.application
Section 30
//ApplicationGlobals (gamework.application.ApplicationGlobals) package gamework.application { import flash.display.*; public class ApplicationGlobals { static var _height:int; static var _width:int; static var _application:Application; static var _sharedObjectName:String; static var _version:String; static var _sharedObjectPath:String; static var _id:String; static var _stage:Stage; public function ApplicationGlobals(){ super(); } public static function get SHARED_OBJECT_PATH():String{ return (_sharedObjectPath); } public static function get ID():String{ return (_id); } public static function get STAGE():Stage{ return (_stage); } public static function get WIDTH():int{ return (_width); } public static function get HEIGHT():int{ return (_height); } public static function get APPLICATION():Application{ return (_application); } public static function get SHARED_OBJECT_NAME():String{ return (_sharedObjectName); } public static function get VERSION():String{ return (_version); } } }//package gamework.application
Section 31
//IDisposable (gamework.core.IDisposable) package gamework.core { public interface IDisposable { function dispose():void; } }//package gamework.core
Section 32
//IUpdatable (gamework.core.IUpdatable) package gamework.core { public interface IUpdatable { function update():void; } }//package gamework.core
Section 33
//EnhancedSprite (gamework.display.EnhancedSprite) package gamework.display { import flash.display.*; import gamework.events.*; public class EnhancedSprite extends Sprite { private var listenersList:Array; public function EnhancedSprite(){ listenersList = new Array(); super(); } override public function removeEventListener(type:String, listener:Function, useCapture:Boolean=false):void{ var numListeners:int; var i:int; var tracker:EventListenerRecord; numListeners = listenersList.length; i = 0; while (i < numListeners) { tracker = listenersList[i]; if ((((((tracker.type == type)) && ((tracker.listener == listener)))) && ((tracker.useCapture == useCapture)))){ listenersList.splice(i, 1); super.removeEventListener(type, listener, useCapture); break; }; i++; }; } override public function addEventListener(type:String, listener:Function, useCapture:Boolean=false, priority:int=0, useWeakReference:Boolean=false):void{ var tracker:EventListenerRecord; for each (tracker in listenersList) { if ((((((tracker.type == type)) && ((tracker.listener == listener)))) && ((tracker.useCapture == useCapture)))){ return; }; }; listenersList.push(new EventListenerRecord(type, listener, useCapture)); super.addEventListener(type, listener, useCapture, priority, useWeakReference); } final public function removeAllEventListeners(type:String=null):void{ var tracker:EventListenerRecord; var numListeners:int; var i:int; if (!type){ for each (tracker in listenersList) { super.removeEventListener(tracker.type, tracker.listener, tracker.useCapture); }; listenersList = new Array(); } else { numListeners = listenersList.length; i = 0; while (i < numListeners) { tracker = listenersList[i]; if (tracker.type == type){ super.removeEventListener(type, tracker.listener, tracker.useCapture); listenersList.splice(i, 1); }; i++; }; }; } } }//package gamework.display
Section 34
//FilterDecoration (gamework.display.FilterDecoration) package gamework.display { import flash.display.*; import flash.filters.*; public class FilterDecoration implements IDecoration { private var _filters:Array; public function FilterDecoration(... _args){ var len:int; var i:int; _filters = []; super(); len = _args.length; i = 0; while (i < len) { _filters.push(BitmapFilter(_args[i]).clone()); i++; }; } public function apply(target:DisplayObject):void{ var len:int; var targetFilters:Array; var i:int; len = _filters.length; targetFilters = []; i = 0; while (i < len) { targetFilters.push(_filters[i].clone()); i++; }; target.filters = targetFilters; } } }//package gamework.display
Section 35
//IDecoration (gamework.display.IDecoration) package gamework.display { import flash.display.*; public interface IDecoration { function apply(:DisplayObject):void; } }//package gamework.display
Section 36
//BlackoutTransition (gamework.effects.BlackoutTransition) package gamework.effects { import com.boostworthy.animation.sequence.tweens.*; import flash.events.*; import gamework.events.*; import gamework.core.*; import gamework.display.*; import com.boostworthy.animation.rendering.*; import com.boostworthy.animation.sequence.*; import flash.errors.*; import gamework.application.*; public class BlackoutTransition extends EnhancedSprite implements IDisposable { private var timeline:Timeline; private var _color:uint; private var _halfDuration:uint; private static var started:Boolean = false; public function BlackoutTransition(halfDuration:uint=8, color:uint=0){ super(); if (started){ throw (new IllegalOperationError("BlackoutTransition::Transition is playing already")); }; _halfDuration = halfDuration; _color = color; addEventListener(Event.ADDED_TO_STAGE, start); addEventListener(MouseEvent.CLICK, onMouseEventHandler); addEventListener(MouseEvent.MOUSE_DOWN, onMouseEventHandler); addEventListener(MouseEvent.MOUSE_DOWN, onMouseEventHandler); } public function dispose():void{ graphics.clear(); timeline.dispose(); timeline = null; started = false; parent.removeChild(this); removeAllEventListeners(); } private function onComplete():void{ dispatchEvent(new BlackoutTransitionEvent(BlackoutTransitionEvent.COMPLETE)); dispose(); } private function start(event:Event):void{ var w:uint; var h:uint; removeEventListener(Event.ADDED_TO_STAGE, start); started = true; alpha = 0; w = ApplicationGlobals.WIDTH; h = ApplicationGlobals.HEIGHT; graphics.beginFill(_color, 1); graphics.moveTo(0, 0); graphics.lineTo(w, 0); graphics.lineTo(w, h); graphics.lineTo(0, h); graphics.lineTo(0, 0); graphics.endFill(); timeline = new Timeline(RenderMethod.ENTER_FRAME); timeline.addTween(new Tween(this, "alpha", 1, 1, _halfDuration)); timeline.addTween(new Action(onPeak, [], null, [], (_halfDuration + 1))); timeline.addTween(new Tween(this, "alpha", 0, (_halfDuration + 2), ((_halfDuration * 2) + 1))); timeline.addTween(new Action(onComplete, [], null, [], ((_halfDuration * 2) + 2))); timeline.play(); } private function onMouseEventHandler(event:MouseEvent):void{ event.stopImmediatePropagation(); } private function onPeak():void{ dispatchEvent(new BlackoutTransitionEvent(BlackoutTransitionEvent.PEAK)); } } }//package gamework.effects
Section 37
//BrightnessBeacon (gamework.effects.BrightnessBeacon) package gamework.effects { import flash.display.*; import flash.events.*; import fl.motion.*; public class BrightnessBeacon implements IBeacon { private var _brightnessMin:Number; private var _brightnessCenter:Number; private var _color:Color; private var _frameCounter:Number;// = 0 private var _target:DisplayObject; private var _brightnessMax:Number; private var _dFrameCounter:Number; public function BrightnessBeacon(brightnessMin:Number=0, brightnessMax:Number=0.75, period:uint=30){ _frameCounter = 0; _color = new Color(); super(); _brightnessMin = brightnessMin; _brightnessMax = brightnessMax; _brightnessCenter = (_brightnessMin + ((_brightnessMin + brightnessMax) / 2)); _dFrameCounter = ((2 * Math.PI) / period); } public function start(target:DisplayObject):void{ _target = target; _target.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler); } private function onEnterFrameHandler(event:Event):void{ _color.brightness = (_brightnessCenter + (((_brightnessMax - _brightnessMin) / 2) * Math.sin(_frameCounter))); _target.transform.colorTransform = _color; _frameCounter = (_frameCounter + _dFrameCounter); if (_frameCounter >= (2 * Math.PI)){ _frameCounter = 0; }; } public function dispose():void{ _target.removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler); _target = null; _color = null; } } }//package gamework.effects
Section 38
//GlowBeacon (gamework.effects.GlowBeacon) package gamework.effects { import flash.display.*; import com.boostworthy.animation.sequence.tweens.*; import flash.filters.*; import com.boostworthy.animation.rendering.*; import com.boostworthy.animation.sequence.*; public class GlowBeacon implements IBeacon { private var _timeline:Timeline; private var _blurMin:Number; private var _target:DisplayObject; private var _glow:GlowFilter; private var _halfPeriod:int; private var _blurMax:Number; public function GlowBeacon(color:uint=0xFFFFFF, blurMin:Number=2, blurMax:Number=6, period:uint=30, alpha:Number=1, strength:Number=2, quality:int=2){ super(); _blurMin = blurMin; _blurMax = blurMax; _halfPeriod = Math.floor((period / 2)); _glow = new GlowFilter(color, alpha, blurMin, blurMin, strength, quality); } public function start(target:DisplayObject):void{ _target = target; _target.filters = [_glow]; _timeline = new Timeline(RenderMethod.ENTER_FRAME); _timeline.addTween(new FilterTween(_target, GlowFilter, "blurX", _blurMax, 1, _halfPeriod)); _timeline.addTween(new FilterTween(_target, GlowFilter, "blurX", _blurMin, (_halfPeriod + 1), (_halfPeriod * 2))); _timeline.addTween(new FilterTween(_target, GlowFilter, "blurY", _blurMax, 1, _halfPeriod)); _timeline.addTween(new FilterTween(_target, GlowFilter, "blurY", _blurMin, (_halfPeriod + 1), (_halfPeriod * 2))); _timeline.loop = true; _timeline.play(); } public function dispose():void{ _timeline.dispose(); _timeline = null; _target.filters = []; _glow = null; _target = null; } } }//package gamework.effects
Section 39
//IBeacon (gamework.effects.IBeacon) package gamework.effects { import flash.display.*; import gamework.core.*; public interface IBeacon extends IDisposable { function start(:DisplayObject):void; } }//package gamework.effects
Section 40
//BlackoutTransitionEvent (gamework.events.BlackoutTransitionEvent) package gamework.events { import flash.events.*; public class BlackoutTransitionEvent extends Event { public static const COMPLETE:String = "complete"; public static const PEAK:String = "peak"; public function BlackoutTransitionEvent(type:String){ super(type); } } }//package gamework.events
Section 41
//CountdownEvent (gamework.events.CountdownEvent) package gamework.events { import flash.events.*; public class CountdownEvent extends Event { private var _ticksLeft:int; public static const TIMEOUT:String = "timeout"; public static const TICK:String = "tick"; public function CountdownEvent(type:String, ticksLeft:int=0){ super(type); _ticksLeft = ticksLeft; } override public function toString():String{ return (formatToString("CountdownEvent", "type", "ticksLeft")); } public function get ticksLeft():int{ return (_ticksLeft); } } }//package gamework.events
Section 42
//EventListenerRecord (gamework.events.EventListenerRecord) package gamework.events { public class EventListenerRecord { private var _listener:Function; private var _type:String; private var _useCapture:Boolean; public function EventListenerRecord(type:String, listener:Function, useCapture:Boolean=false){ super(); _type = type; _listener = listener; _useCapture = useCapture; } public function get listener():Function{ return (_listener); } public function get type():String{ return (_type); } public function get useCapture():Boolean{ return (_useCapture); } } }//package gamework.events
Section 43
//PreloaderEvent (gamework.events.PreloaderEvent) package gamework.events { import flash.events.*; public class PreloaderEvent extends Event { private var _url:String; public static const ITEM_COMPLETE:String = "itemComplete"; public static const ERROR:String = "error"; public static const COMPLETE:String = "complete"; public static const PROGRESS:String = "progress"; public function PreloaderEvent(type:String, url:String=null){ super(type); _url = url; } override public function toString():String{ return (formatToString("PreloaderEvent", "type", "target", "url")); } public function get url():String{ return (_url); } } }//package gamework.events
Section 44
//SOManager (gamework.net.SOManager) package gamework.net { import flash.net.*; import gamework.utils.*; import flash.errors.*; import gamework.application.*; public class SOManager { private var so:SharedObject; private static var singletonAccessor:Boolean = false; private static var instance:SOManager; public function SOManager(){ super(); if (!singletonAccessor){ throw (new IllegalOperationError("Use getInstance() method to get instance of singleton")); }; so = SharedObject.getLocal(ApplicationGlobals.SHARED_OBJECT_NAME, ApplicationGlobals.SHARED_OBJECT_PATH); } public function setValue(name:String, value):void{ so.data[name] = value; so.flush(); } public function get dataEmpty():Boolean{ var hasProperties:Boolean; hasProperties = ObjectUtil.hasProperties(so.data); return (!(hasProperties)); } public function getValue(name:String){ if (!so.data.hasOwnProperty(name)){ return (null); }; return (so.data[name]); } public function clear():void{ so.clear(); so.flush(); } public static function getInstance():SOManager{ if (instance == null){ singletonAccessor = true; instance = new (SOManager); singletonAccessor = false; }; return (instance); } } }//package gamework.net
Section 45
//URLCaller (gamework.net.URLCaller) package gamework.net { import gamework.application.*; import com.adobe.crypto.*; import flash.net.*; public class URLCaller { public function URLCaller(){ super(); } public static function submitScore(score:Number):void{ var hashKey:String; hashKey = MD5.hash((((("gameid=" + ApplicationGlobals.ID) + "&hiscore=") + score) + "2DPlay.com/")); getURL(((((("http://www.2DPlay.com/highscores.php?gameid=" + ApplicationGlobals.ID) + "&hiscore=") + score) + "&hash=") + hashKey)); } public static function mainLink():void{ getURL(("http://www.2DPlay.com/index.php?gameid=" + ApplicationGlobals.ID)); } public static function viewScores():void{ getURL(("http://www.2Dplay.com/showscores.php?gameid=" + ApplicationGlobals.ID)); } public static function playMoreGames():void{ getURL(("http://www.2DPlay.com/index.php?gameid=" + ApplicationGlobals.ID)); } public static function getURL(url:String, window:String="_blank"):void{ navigateToURL(new URLRequest(url), window); } public static function downloadGame():void{ getURL(("http://www.2DPlay.com/downloadgame.php?gameid=" + ApplicationGlobals.ID)); } public static function getGameForSite():void{ getURL("http://www.2DPlay.com/freecontent.htm"); } } }//package gamework.net
Section 46
//AbstractPreloader (gamework.preloaders.AbstractPreloader) package gamework.preloaders { import flash.display.*; public class AbstractPreloader extends Sprite { protected var _completed:Boolean;// = false public function AbstractPreloader(){ _completed = false; super(); } public function get completed():Boolean{ return (_completed); } public function get percentLoaded():Number{ var bytesLoaded:uint; var bytesTotal:uint; if (!root){ return (0); }; bytesLoaded = root.loaderInfo.bytesLoaded; bytesTotal = root.loaderInfo.bytesTotal; if (bytesTotal == 0){ return (((bytesLoaded > 0)) ? 1 : 0); }; return ((bytesLoaded / bytesTotal)); } } }//package gamework.preloaders
Section 47
//EmptyPreloader (gamework.preloaders.EmptyPreloader) package gamework.preloaders { import flash.events.*; import gamework.events.*; import flash.utils.*; public class EmptyPreloader extends AbstractPreloader { private var timer:Timer; public function EmptyPreloader(){ super(); timer = new Timer(100); timer.addEventListener(TimerEvent.TIMER, onTimerEventHandler); timer.start(); } private function onTimerEventHandler(event:TimerEvent):void{ if (percentLoaded == 1){ timer.stop(); timer.removeEventListener(TimerEvent.TIMER, onTimerEventHandler); timer = null; dispatchEvent(new PreloaderEvent(PreloaderEvent.COMPLETE)); _completed = true; }; } } }//package gamework.preloaders
Section 48
//TwoDPlayPreloader (gamework.preloaders.TwoDPlayPreloader) package gamework.preloaders { import flash.display.*; import flash.events.*; import gamework.events.*; import gamework.net.*; import flash.utils.*; public class TwoDPlayPreloader extends AbstractPreloader { private var logoAnimationCompleted:Boolean;// = false private var timer:Timer; private var barCompleted:Boolean;// = false public var _progressBarMask:MovieClip; public var _animatedLogo:MovieClip; public var _progressBar:MovieClip; public function TwoDPlayPreloader(){ logoAnimationCompleted = false; barCompleted = false; super(); _animatedLogo.stop(); _animatedLogo.mouseChildren = false; _animatedLogo.buttonMode = true; _animatedLogo.addEventListener(MouseEvent.CLICK, onLogoClickHandler); _progressBarMask = _progressBar.progress_bar_mask; _progressBar.alpha = 0; timer = new Timer(33); timer.addEventListener(TimerEvent.TIMER, onTimerEventHandler); timer.start(); } private function onLogoClickHandler(event:MouseEvent):void{ URLCaller.mainLink(); } private function onTimerEventHandler(event:TimerEvent):void{ var percent:Number; percent = percentLoaded; _progressBarMask.scaleX = percent; if (!logoAnimationCompleted){ if (_animatedLogo.currentFrame == _animatedLogo.totalFrames){ logoAnimationCompleted = true; } else { _animatedLogo.nextFrame(); }; } else { if (!barCompleted){ if (percent == 1){ barCompleted = true; } else { _progressBar.alpha = (_progressBar.alpha + 0.1); if (_progressBar.alpha >= 1){ barCompleted = true; _progressBar.alpha = 1; }; }; } else { if (percent == 1){ timer.stop(); timer.removeEventListener(TimerEvent.TIMER, onTimerEventHandler); timer = null; _animatedLogo.removeEventListener(MouseEvent.CLICK, onLogoClickHandler); dispatchEvent(new PreloaderEvent(PreloaderEvent.COMPLETE)); _completed = true; }; }; }; event.updateAfterEvent(); } } }//package gamework.preloaders
Section 49
//ReplayChannel (gamework.sound.ReplayChannel) package gamework.sound { public class ReplayChannel { private var _name:String; private var soundRecords:Object; private var _volume:Number;// = 1 private var _pan:Number;// = 0 public function ReplayChannel(name:String){ soundRecords = new Object(); _volume = 1; _pan = 0; super(); _name = name; } public function stop():void{ var record:SoundRecord; for each (record in soundRecords) { record.stop(); }; } public function playNextSound(soundID:String, fadeOutDuration:int, fadeInDuration:int):void{ } public function set pan(value:Number):void{ var record:SoundRecord; _pan = value; if (_pan < -1){ _pan = -1; } else { if (_pan > 1){ _pan = 1; }; }; for each (record in soundRecords) { record.channelPan = _pan; }; } public function get name():String{ return (_name); } public function registerSound(soundID:String, record:SoundRecord):void{ if (!soundRecords[soundID]){ record.channelVolume = _volume; record.channelPan = _pan; soundRecords[soundID] = record; }; } public function set volume(value:Number):void{ var record:SoundRecord; _volume = value; if (_volume < 0){ _volume = 0; } else { if (_volume > 1){ _volume = 1; }; }; for each (record in soundRecords) { record.channelVolume = _volume; }; } } }//package gamework.sound
Section 50
//SoundManager (gamework.sound.SoundManager) package gamework.sound { import flash.errors.*; public class SoundManager { private var soundRecords:Object; private var replayChannels:Object; private static var instance:SoundManager = null; private static var singletonAccessor:Boolean = true; private static var replayChannelUID:int = 0; public function SoundManager(){ replayChannels = new Object(); soundRecords = new Object(); super(); if (!singletonAccessor){ throw (new IllegalOperationError("Use getInstance() method to get instance of singleton")); }; } public function setChannelVolume(channelName:String, volume:Number):void{ var replayChannel:ReplayChannel; replayChannel = replayChannels[channelName]; replayChannel.volume = volume; } public function playNextSound(channelName:String, soundID:String, fadeOutDuration:int=0, fadeInDuration:int=0):void{ } public function isSoundPlaying(soundID:String):Boolean{ var record:SoundRecord; record = soundRecords[soundID]; return (record.playing); } public function setChannelsVolume(volume:Number):void{ var replayChannel:ReplayChannel; for each (replayChannel in replayChannels) { replayChannel.volume = volume; }; } public function stopSound(soundID:String):void{ var record:SoundRecord; record = soundRecords[soundID]; record.stop(); } public function stopChannel(channelName:String):void{ var replayChannel:ReplayChannel; replayChannel = replayChannels[channelName]; replayChannel.stop(); } public function setSoundPan(soundID:String, pan:Number):void{ var record:SoundRecord; record = soundRecords[soundID]; record.pan = pan; } public function setSoundVolume(soundID:String, volume:Number):void{ var record:SoundRecord; record = soundRecords[soundID]; record.volume = volume; } public function playSound(soundID:String, loops:int=1):void{ var record:SoundRecord; record = soundRecords[soundID]; record.play(loops); } public function setChannelPan(channelName:String, pan:Number):void{ var replayChannel:ReplayChannel; replayChannel = replayChannels[channelName]; replayChannel.pan = pan; } public function registerSoundRecord(soundID:String, soundClass:Class, ... _args):void{ var channelName:String; var record:SoundRecord; var name:String; var channel:ReplayChannel; if (soundRecords[soundID]){ throw (new ArgumentError("SoundRecord with provided identifier already exists.")); }; if (_args.length == 0){ channelName = ("internal::replay_channel_" + String(replayChannelUID++)); registerSoundRecord(soundID, soundClass, channelName); } else { record = new SoundRecord(new (soundClass)); soundRecords[soundID] = record; for each (name in _args) { channel = replayChannels[name]; if (!channel){ channel = new ReplayChannel(name); replayChannels[name] = channel; }; channel.registerSound(soundID, record); }; }; } public function stopAll():void{ var record:SoundRecord; for each (record in soundRecords) { record.stop(); }; } public static function getInstance():SoundManager{ if (instance == null){ singletonAccessor = true; instance = new (SoundManager); singletonAccessor = false; }; return (instance); } } }//package gamework.sound
Section 51
//SoundRecord (gamework.sound.SoundRecord) package gamework.sound { import flash.media.*; import flash.events.*; public class SoundRecord { private var _volume:Number;// = 1 private var _channelPan:Number;// = 0 private var sound:Sound; private var _pan:Number;// = 0 private var transform:SoundTransform; private var _playing:Boolean;// = false private var soundChannel:SoundChannel; private var _channelVolume:Number;// = 1 public function SoundRecord(sound:Sound){ transform = new SoundTransform(); _playing = false; _volume = 1; _channelVolume = 1; _pan = 0; _channelPan = 0; super(); this.sound = sound; } public function stop():void{ if (_playing){ soundChannel.stop(); soundChannel.removeEventListener(Event.SOUND_COMPLETE, onCompleteHandler); _playing = false; }; } public function play(loops:int):void{ stop(); soundChannel = sound.play(0, loops, transform); soundChannel.addEventListener(Event.SOUND_COMPLETE, onCompleteHandler); _playing = true; } public function set pan(value:Number):void{ _pan = value; if (_pan < -1){ _pan = -1; } else { if (_pan > 1){ _pan = 1; }; }; setResultTransform(); } private function onCompleteHandler(event:Event):void{ soundChannel.removeEventListener(Event.SOUND_COMPLETE, onCompleteHandler); _playing = false; } public function set channelPan(value:Number):void{ _channelPan = value; setResultTransform(); } private function setResultTransform():void{ var resultPan:Number; resultPan = (_pan + _channelPan); if (resultPan < -1){ resultPan = -1; } else { if (resultPan > 1){ resultPan = 1; }; }; transform.pan = resultPan; transform.volume = (_volume * _channelVolume); if (_playing){ soundChannel.soundTransform = transform; }; } public function get playing():Boolean{ return (_playing); } public function set channelVolume(value:Number):void{ _channelVolume = value; setResultTransform(); } public function set volume(value:Number):void{ _volume = value; if (_volume < 0){ _volume = 0; } else { if (_volume > 1){ _volume = 1; }; }; setResultTransform(); } } }//package gamework.sound
Section 52
//HSMError (gamework.statemachine.hsm.errors.HSMError) package gamework.statemachine.hsm.errors { public class HSMError extends Error { public function HSMError(message:String=""){ super(message); } } }//package gamework.statemachine.hsm.errors
Section 53
//HSMEvent (gamework.statemachine.hsm.events.HSMEvent) package gamework.statemachine.hsm.events { import flash.events.*; public class HSMEvent extends Event { private var _eventName:String; private var _stateName:String; public static const CHANGE_STATE:String = "change_state"; public static const START:String = "start"; public static const SIGNAL_EVENT:String = "signal_event"; public static const TIME_EVENT:String = "time_event"; public function HSMEvent(type:String, stateName:String=null, eventName:String=null){ super(type); _stateName = stateName; _eventName = eventName; } public function get eventName():String{ return (_eventName); } override public function toString():String{ return (formatToString("StateEvent", "type", "stateName", "eventName")); } public function get stateName():String{ return (_stateName); } } }//package gamework.statemachine.hsm.events
Section 54
//StateEvent (gamework.statemachine.hsm.events.StateEvent) package gamework.statemachine.hsm.events { import flash.events.*; public class StateEvent extends Event { private var _stateMachineEvent:String; public static const CONCURRENT_COMPLETE:String = "concurrent_complete"; public static const TIME:String = "time"; public function StateEvent(type:String, stateMachineEvent:String){ super(type); _stateMachineEvent = stateMachineEvent; } public function get stateMachineEvent():String{ return (_stateMachineEvent); } override public function toString():String{ return (formatToString("StateEvent", "type", "stateMachineEvent")); } } }//package gamework.statemachine.hsm.events
Section 55
//AbstractEvent (gamework.statemachine.hsm.AbstractEvent) package gamework.statemachine.hsm { import gamework.utils.*; public class AbstractEvent { protected var _name:String; public function AbstractEvent(name:String=null){ super(); _name = name; } public function get name():String{ return (_name); } public function toString():String{ return (ObjectUtil.formatToString(this, "name")); } function setName(value:String):void{ _name = value; } } }//package gamework.statemachine.hsm
Section 56
//AbstractState (gamework.statemachine.hsm.AbstractState) package gamework.statemachine.hsm { import flash.events.*; import gamework.statemachine.hsm.events.*; import gamework.core.*; import gamework.utils.*; import gamework.statemachine.hsm.errors.*; import flash.utils.*; public class AbstractState extends EventDispatcher implements IDisposable { protected var _entryAction:Function;// = null protected var _transitions:Array; protected var _exitAction:Function;// = null protected var _doAction:Function;// = null protected var _timersHash:Object; protected var _active:Boolean;// = false protected var _transitionLevelsCache:Object; protected var _parent:CompositeState;// = null private var _name:String; var _parentName:String; public function AbstractState(name:String, parent:String, entryAction:Function=null, doAction:Function=null, exitAction:Function=null){ _active = false; _entryAction = null; _doAction = null; _exitAction = null; _timersHash = new Object(); _parent = null; _transitions = new Array(); _transitionLevelsCache = new Object(); super(); _name = name; _parentName = parent; _entryAction = entryAction; _doAction = doAction; _exitAction = exitAction; } public function hasSubstate(state:String):Boolean{ return (false); } public function addSubstate(state:AbstractState):void{ throw (new HSMError((("Method addSubstate is not supported in " + NameUtil.getClassName(this)) + " class"))); } public function hasAncestor(state:AbstractState):Boolean{ var tempParent:AbstractState; tempParent = _parent; while (tempParent) { if (tempParent === state){ return (true); }; tempParent = tempParent.parent; }; return (false); } public function get active():Boolean{ return (_active); } public function hasTransition(transition:Transition):Boolean{ var numTransitions:int; var i:int; var t:Transition; numTransitions = _transitions.length; i = 0; while (i < numTransitions) { t = _transitions[i]; if ((((t.targetState == transition.targetState)) && ((t.event.name == transition.event.name)))){ return (true); }; i++; }; return (false); } public function get name():String{ return (_name); } public function dispose():void{ var timer:Timer; var transition:IDisposable; if (_timersHash){ for each (timer in _timersHash) { timer.reset(); timer.removeEventListener(TimerEvent.TIMER, onTimerHandler); }; _timersHash = null; }; if (_transitions){ for each (transition in _transitions) { transition.dispose(); }; _transitions = null; }; _entryAction = null; _doAction = null; _exitAction = null; _transitionLevelsCache = null; } public function invokeExitAction():void{ if (_exitAction != null){ _exitAction(); }; } public function get parent():CompositeState{ return (_parent); } function setParent(parent:CompositeState):void{ _parent = parent; } public function invokeEntryAction():void{ if (_entryAction != null){ _entryAction(); }; } public function hasDescendant(state:AbstractState):Boolean{ return (false); } public function get initialChild():AbstractState{ return (null); } public function invokeDoAction():void{ if (_doAction != null){ _doAction(); }; } function get transitions():Array{ return (_transitions); } private function onTimerHandler(event:TimerEvent):void{ var name:String; if (!_active){ return; }; for (name in _timersHash) { if (_timersHash[name] == event.target){ dispatchEvent(new StateEvent(StateEvent.TIME, name)); }; }; } public function getTransition(eventName:String):Transition{ var numTransitions:int; var i:int; var event:AbstractEvent; numTransitions = _transitions.length; i = 0; while (i < numTransitions) { event = _transitions[i].event; if (event.name == eventName){ return (_transitions[i]); }; i++; }; return (null); } function registerTransition(transition:Transition):void{ var timeEvent:TimeEvent; var timer:Timer; if ((transition.event is TimeEvent)){ timeEvent = (transition.event as TimeEvent); timer = new Timer(timeEvent.delay, 1); _timersHash[timeEvent.name] = timer; timer.addEventListener(TimerEvent.TIMER, onTimerHandler); } else { if (hasTransition(transition)){ throw (new HSMError((("Transition " + transition.toString()) + " exists already"))); }; }; _transitions.push(transition); } public function calculateTransitionLevel(targetState:AbstractState):String{ var level:String; level = _transitionLevelsCache[targetState]; if (level){ return (level); }; if (this == targetState){ level = TransitionLevel.TO_SELF; } else { if (hasAncestor(targetState)){ level = TransitionLevel.TO_ANCESTOR; } else { if (hasDescendant(targetState)){ level = TransitionLevel.TO_DESCENDANT; } else { if ((((targetState.parent == parent)) && ((targetState.initialChild == null)))){ level = TransitionLevel.TO_SIBLING; } else { level = TransitionLevel.TO_IRRELATIVE; }; }; }; }; _transitionLevelsCache[targetState] = level; return (level); } override public function toString():String{ return (ObjectUtil.formatToString(this, "name", "parent", "active")); } function activate():void{ var timer:Timer; for each (timer in _timersHash) { timer.start(); }; _active = true; } function deactivate():void{ var timer:Timer; _active = false; for each (timer in _timersHash) { timer.reset(); }; } public function get children():Object{ return (new Object()); } } }//package gamework.statemachine.hsm
Section 57
//ChoicePointState (gamework.statemachine.hsm.ChoicePointState) package gamework.statemachine.hsm { import gamework.statemachine.hsm.errors.*; public class ChoicePointState extends AbstractState { public function ChoicePointState(name:String, parent:String){ super(name, parent); } override public function getTransition(eventName:String):Transition{ var numTransitions:int; var i:int; var transition:Transition; numTransitions = _transitions.length; i = 0; while (i < numTransitions) { transition = _transitions[i]; if (transition.checkGuardCondition()){ return (transition); }; i++; }; return (null); } override function registerTransition(transition:Transition):void{ if ((transition.event is TimeEvent)){ throw (new HSMError("Event must be SignalEvent")); }; _transitions.push(transition); } } }//package gamework.statemachine.hsm
Section 58
//CompositeState (gamework.statemachine.hsm.CompositeState) package gamework.statemachine.hsm { import gamework.core.*; import gamework.statemachine.hsm.errors.*; public class CompositeState extends AbstractState { protected var _initialChild:AbstractState;// = null protected var _children:Object; public function CompositeState(name:String, parent:String, entryAction:Function=null, doAction:Function=null, exitAction:Function=null){ _children = new Object(); _initialChild = null; super(name, parent, entryAction, doAction, exitAction); } override public function hasSubstate(state:String):Boolean{ return (!((_children[state] == null))); } override public function get children():Object{ return (_children); } override public function dispose():void{ var child:IDisposable; super.dispose(); if (_children){ for each (child in _children) { child.dispose(); }; _children = null; }; if (_initialChild){ _initialChild.dispose(); _initialChild = null; }; } override public function addSubstate(state:AbstractState):void{ if (hasSubstate(state.name)){ throw (new HSMError((((("Substate \"" + state.name) + "\" in \"") + name) + "\" already exists"))); }; if ((state is InitialState)){ if (_initialChild){ throw (new HSMError((((("State \"" + name) + "\" already has initial substate \"") + _initialChild.name) + "\""))); }; _initialChild = state; }; _children[state.name] = state; } override public function hasDescendant(state:AbstractState):Boolean{ return (state.hasAncestor(this)); } override public function get initialChild():AbstractState{ return (_initialChild); } } }//package gamework.statemachine.hsm
Section 59
//FinalState (gamework.statemachine.hsm.FinalState) package gamework.statemachine.hsm { public class FinalState extends AbstractState { public function FinalState(name:String, parent:String, entryAction:Function=null, doAction:Function=null, exitAction:Function=null){ super(name, parent, entryAction, doAction, exitAction); } } }//package gamework.statemachine.hsm
Section 60
//ForkState (gamework.statemachine.hsm.ForkState) package gamework.statemachine.hsm { import gamework.statemachine.hsm.errors.*; public class ForkState extends AbstractState { private var _activeConcurrentStates:Object; private var _concurrentStates:Object; public function ForkState(name:String, parent:String){ _concurrentStates = new Object(); _activeConcurrentStates = new Object(); super(name, parent); } function deactivateConcurrentState(state:AbstractState):void{ delete _activeConcurrentStates[state.name]; } public function hasConcurrentState(state:String):Boolean{ return (!((_concurrentStates[state] == null))); } override function deactivate():void{ var child:AbstractState; for each (child in _concurrentStates) { child.deactivate(); }; } public function get activeConcurrentStates():Object{ return (_activeConcurrentStates); } public function addConcurrentState(state:AbstractState):void{ if (hasConcurrentState(state.name)){ throw (new HSMError((((("Concurrent state \"" + state.name) + "\" in \"") + name) + "\" already exists"))); }; _concurrentStates[state.name] = state; } override function activate():void{ var child:AbstractState; _activeConcurrentStates = {}; for each (child in _concurrentStates) { child.activate(); _activeConcurrentStates[child.name] = child; }; } } }//package gamework.statemachine.hsm
Section 61
//HSM (gamework.statemachine.hsm.HSM) package gamework.statemachine.hsm { import flash.display.*; import flash.events.*; import gamework.statemachine.hsm.events.*; import gamework.core.*; import gamework.statemachine.hsm.errors.*; import flash.utils.*; import gamework.application.*; public class HSM extends EventDispatcher implements IDisposable, IUpdatable { private var _initialState:AbstractState;// = null private var _transitionInProgress:Boolean;// = false private var _activeStateList:Array; private var _updateMode:String; private var _started:Boolean;// = false private var _statesHash:Object; private var _name:String; private var _currentState:AbstractState;// = null private var updateTimer:Timer; public function HSM(name:String){ _statesHash = new Object(); _initialState = null; _currentState = null; _activeStateList = new Array(); _started = false; _transitionInProgress = false; super(); _name = name; } public function get name():String{ return (_name); } private function findExitStateChain(sourceState:AbstractState, targetState:AbstractState):Array{ var chain:Array; var level:String; var _local5:int; var _local6:AbstractState; var _local7:AbstractState; level = sourceState.calculateTransitionLevel(targetState); switch (level){ case TransitionLevel.TO_SELF: case TransitionLevel.TO_SIBLING: chain = [sourceState]; break; case TransitionLevel.TO_ANCESTOR: _local5 = _activeStateList.indexOf(targetState); chain = _activeStateList.slice(0, _local5); break; case TransitionLevel.TO_DESCENDANT: chain = []; break; default: _local6 = _activeStateList[(_activeStateList.length - 1)]; _local7 = sourceState; chain = [_currentState]; while (((_local7.parent) && (!((_local6 == _local7))))) { chain.push(_local7.parent); _local7 = _local7.parent; }; break; }; return (chain); } public function hasState(stateName:String):Boolean{ return (!((_statesHash[stateName] == null))); } public function dispose():void{ var dState:AbstractState; var state:IDisposable; var _local3:Stage; switch (_updateMode){ case HSMUpdateMode.TIMER: updateTimer.stop(); updateTimer.removeEventListener(TimerEvent.TIMER, onUpdateTimerHandler); updateTimer = null; break; case HSMUpdateMode.ENTER_FRAME: _local3 = ApplicationGlobals.STAGE; _local3.removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler); break; }; _started = false; for each (dState in _activeStateList) { dState.deactivate(); }; _activeStateList = null; for each (state in _statesHash) { state.dispose(); }; _statesHash = null; } public function get currentState():AbstractState{ return (_currentState); } public function sendSignalEvent(eventName:String):Boolean{ var exitStateChain:Array; var entryStateChain:Array; var numActiveStates:int; var i:int; var activeState:AbstractState; var forkState:ForkState; var concurrentStatesHash:Object; var child:AbstractState; var concurrentTransition:Transition; var joinState:JoinState; var transition:Transition; if (!_started){ throw (new HSMError("State machine is not initialized")); }; dispatchEvent(new HSMEvent(HSMEvent.SIGNAL_EVENT, _currentState.name, eventName)); if (((!(_currentState.parent)) && ((_currentState is FinalState)))){ return (false); }; numActiveStates = _activeStateList.length; i = 0; while (i < numActiveStates) { activeState = _activeStateList[i]; if ((activeState is ForkState)){ forkState = (activeState as ForkState); concurrentStatesHash = forkState.activeConcurrentStates; for each (child in concurrentStatesHash) { concurrentTransition = child.getTransition(eventName); if (concurrentTransition){ forkState.deactivateConcurrentState(child); exitStateChain = findExitStateChain(child, concurrentTransition.targetState); entryStateChain = findEntryStateChain(child, concurrentTransition.targetState); startTransition(exitStateChain, entryStateChain, concurrentTransition, false); joinState = (concurrentTransition.targetState as JoinState); joinState.numActiveConcurrentStates--; if (joinState.numActiveConcurrentStates == 0){ joinState.resetNumActiveConcurrentStates(); exitStateChain = findExitStateChain(child, concurrentTransition.targetState); entryStateChain = findEntryStateChain(child, concurrentTransition.targetState); startTransition([], [concurrentTransition.targetState], concurrentTransition); }; return (true); }; }; return (false); } else { transition = activeState.getTransition(eventName); if (((transition) && (transition.checkGuardCondition()))){ exitStateChain = findExitStateChain(_currentState, transition.targetState); entryStateChain = findEntryStateChain(_currentState, transition.targetState); startTransition(exitStateChain, entryStateChain, transition); return (true); }; }; i++; }; return (false); } private function findEntryStateChain(sourceState:AbstractState, targetState:AbstractState):Array{ var chain:Array; var level:String; var _local5:AbstractState; var _local6:AbstractState; var _local7:AbstractState; var _local8:AbstractState; level = sourceState.calculateTransitionLevel(targetState); switch (level){ case TransitionLevel.TO_SELF: case TransitionLevel.TO_SIBLING: chain = [targetState]; break; case TransitionLevel.TO_ANCESTOR: chain = []; _local5 = sourceState; while (_local5 != targetState) { chain.push(_local5); _local5 = _local5.parent; }; break; case TransitionLevel.TO_DESCENDANT: chain = []; _local6 = targetState; while (_local6 != sourceState) { chain.push(_local6); _local6 = _local6.parent; }; break; default: _local7 = _activeStateList[(_activeStateList.length - 1)]; _local8 = targetState; while (_local8.initialChild) { _local8 = _local8.initialChild; if ((_local8 is InitialState)){ break; }; }; chain = [_local8]; while (((_local8.parent) && (!((_local7 == _local8))))) { chain.push(_local8.parent); _local8 = _local8.parent; }; break; }; return (chain); } public function update():void{ if (((_currentState) && (!(_transitionInProgress)))){ _currentState.invokeDoAction(); }; } public function addTransition(sourceStateName:String, targetStateName:String, event:AbstractEvent=null, effect:Function=null, guardCondition:Function=null):void{ var sState:AbstractState; var tState:AbstractState; var transition:Transition; var concurrentTransition:Transition; if (!hasState(sourceStateName)){ throw (new HSMError((("State \"" + sourceStateName) + "\" doesn't exist"))); }; if (!hasState(targetStateName)){ throw (new HSMError((("State \"" + targetStateName) + "\" doesn't exist"))); }; sState = _statesHash[sourceStateName]; tState = _statesHash[targetStateName]; if (!event){ event = new SignalEvent(SignalEvent.ON_STATE_COMPLETE); }; if ((sState is ForkState)){ ForkState(sState).addConcurrentState(tState); return; }; if ((tState is JoinState)){ JoinState(tState).addConcurrentState(sState); concurrentTransition = new Transition(tState, event, effect, guardCondition); sState.registerTransition(concurrentTransition); return; }; if ((event is TimeEvent)){ event.setName(((targetStateName + "@") + TimeEvent(event).delay)); if (!sState.hasEventListener(StateEvent.TIME)){ sState.addEventListener(StateEvent.TIME, onStateTimeHandler); }; }; transition = new Transition(tState, event, effect, guardCondition); sState.registerTransition(transition); } private function startTransition(exitStateChain:Array, entryStateChain:Array, transition:Transition=null, changeCurrentState:Boolean=true):void{ var dState:AbstractState; var numExitStates:int; var i:int; var numEntryStates:int; var j:int; var tempState:AbstractState; var aState:AbstractState; var choiceTransition:Transition; if (_transitionInProgress){ return; }; _transitionInProgress = true; for each (dState in _activeStateList) { dState.deactivate(); }; numExitStates = exitStateChain.length; i = 0; while (i < numExitStates) { AbstractState(exitStateChain[i]).invokeExitAction(); i++; }; if (transition){ transition.invokeEffect(); }; numEntryStates = entryStateChain.length; j = (numEntryStates - 1); while (j >= 0) { AbstractState(entryStateChain[j]).invokeEntryAction(); j--; }; if (changeCurrentState){ tempState = entryStateChain[0]; _activeStateList = [tempState]; while (tempState.parent) { _activeStateList.push(tempState.parent); tempState = tempState.parent; }; _currentState = _activeStateList[0]; if ((_currentState is ChoicePointState)){ choiceTransition = _currentState.getTransition(null); if (choiceTransition){ exitStateChain = findExitStateChain(_currentState, choiceTransition.targetState); entryStateChain = findEntryStateChain(_currentState, choiceTransition.targetState); _transitionInProgress = false; startTransition(exitStateChain, entryStateChain, choiceTransition); }; }; for each (aState in _activeStateList) { aState.activate(); }; }; _transitionInProgress = false; dispatchEvent(new HSMEvent(HSMEvent.CHANGE_STATE, _currentState.name)); sendSignalEvent(SignalEvent.ON_STATE_COMPLETE); } public function start(updateMode:String="disabled", delay:int=40, initialStateName:String=null):void{ var initialState:AbstractState; var _local5:Stage; if (_started){ return; }; initialState = ((initialStateName == null)) ? _initialState : _statesHash[initialStateName]; if (!initialState){ throw (new HSMError("Initial state doesn't exist")); }; _activeStateList.push(initialState); _updateMode = updateMode; switch (updateMode){ case HSMUpdateMode.TIMER: updateTimer = new Timer(delay); updateTimer.addEventListener(TimerEvent.TIMER, onUpdateTimerHandler); updateTimer.start(); break; case HSMUpdateMode.ENTER_FRAME: _local5 = ApplicationGlobals.STAGE; _local5.addEventListener(Event.ENTER_FRAME, onEnterFrameHandler); break; }; _started = true; dispatchEvent(new HSMEvent(HSMEvent.START, initialState.name)); startTransition([], [initialState]); } private function onStateTimeHandler(event:StateEvent):void{ dispatchEvent(new HSMEvent(HSMEvent.TIME_EVENT, _currentState.name, event.stateMachineEvent)); sendSignalEvent(event.stateMachineEvent); } public function getConfiguration():XML{ var config:XML; var states:XML; var transitions:XML; var statesList:Array; var s:AbstractState; var i:int; var state:AbstractState; var parent:XMLList; config = new XML((("<stateMachine name=\"" + ??esc_xattr ) + "\"/>")); states = <states/> ; transitions = <transitions/> ; statesList = new Array(); for each (s in _statesHash) { statesList.push(s); }; while (statesList.length > 0) { i = 0; for (;i < statesList.length;(i = (i + 1))) { state = statesList[i]; if (!state.parent){ states.appendChild(new XML((((("<state type=\"" + ??esc_xattr ) + "\" name=\"") + ??esc_xattr ) + "\"/>"))); addTransitionConfiguration(transitions, state); statesList.splice(i, 1); continue; } else { if (states..state.(@name == state.parent.name).length() > 0){ parent = states..state.(@name == state.parent.name); parent.appendChild(new XML((((("<state type=\"" + ??esc_xattr ) + "\" name=\"") + ??esc_xattr ) + "\"/>"))); addTransitionConfiguration(transitions, state); statesList.splice(i, 1); continue; }; }; }; }; config.appendChild(states); config.appendChild(transitions); return (config); } public function addState(state:AbstractState):void{ if (hasState(state.name)){ throw (new HSMError((("State \"" + state.name) + "\" already exists"))); }; if (state._parentName){ if (hasState(state._parentName)){ state.setParent(_statesHash[state._parentName]); _statesHash[state.name] = state; state.parent.addSubstate(state); } else { throw (new HSMError((("Parent \"" + state._parentName) + "\" doesn't exist"))); }; } else { if ((state is InitialState)){ if (_initialState){ throw (new HSMError((("Initial state \"" + state) + "\" exists already"))); }; _initialState = state; }; _statesHash[state.name] = state; }; } private function onUpdateTimerHandler(event:TimerEvent):void{ update(); } private function onEnterFrameHandler(event:Event):void{ update(); } private function addTransitionConfiguration(transitionXML:XML, state:AbstractState):void{ var transitionsList:Array; var transition:Transition; var eventName:String; transitionsList = state.transitions; for each (transition in transitionsList) { if ((transition.event is TimeEvent)){ eventName = ((transition.event as TimeEvent).delay + " ms"); transitionXML.appendChild(new XML((((((("<transition source=\"" + ??esc_xattr ) + "\" target=\"") + ??esc_xattr ) + "\" timeEvent=\"") + ??esc_xattr ) + "\"/>"))); } else { eventName = transition.event.name; transitionXML.appendChild(new XML((((((("<transition source=\"" + ??esc_xattr ) + "\" target=\"") + ??esc_xattr ) + "\" signalEvent=\"") + ??esc_xattr ) + "\"/>"))); }; }; } } }//package gamework.statemachine.hsm
Section 62
//HSMUpdateMode (gamework.statemachine.hsm.HSMUpdateMode) package gamework.statemachine.hsm { public class HSMUpdateMode { public static const TIMER:String = "timer"; public static const ENTER_FRAME:String = "enter_frame"; public static const DISABLED:String = "disabled"; public function HSMUpdateMode(){ super(); } } }//package gamework.statemachine.hsm
Section 63
//InitialState (gamework.statemachine.hsm.InitialState) package gamework.statemachine.hsm { public class InitialState extends AbstractState { public function InitialState(name:String, parent:String, entryAction:Function=null, doAction:Function=null, exitAction:Function=null){ super(name, parent, entryAction, doAction, exitAction); } } }//package gamework.statemachine.hsm
Section 64
//JoinState (gamework.statemachine.hsm.JoinState) package gamework.statemachine.hsm { import gamework.statemachine.hsm.errors.*; public class JoinState extends AbstractState { private var _numConcurrentStates:int;// = 0 var numActiveConcurrentStates:int;// = 0 private var _concurrentStates:Object; public function JoinState(name:String, parent:String){ numActiveConcurrentStates = 0; _numConcurrentStates = 0; _concurrentStates = new Object(); super(name, parent); } public function hasConcurrentState(state:String):Boolean{ return (!((_concurrentStates[state] == null))); } public function addConcurrentState(state:AbstractState):void{ if (hasConcurrentState(state.name)){ throw (new HSMError((((("Concurrent state \"" + state.name) + "\" in \"") + name) + "\" already exists"))); }; _concurrentStates[state.name] = state; _numConcurrentStates++; numActiveConcurrentStates = _numConcurrentStates; } function resetNumActiveConcurrentStates():void{ numActiveConcurrentStates = _numConcurrentStates; } } }//package gamework.statemachine.hsm
Section 65
//SignalEvent (gamework.statemachine.hsm.SignalEvent) package gamework.statemachine.hsm { public class SignalEvent extends AbstractEvent { public static const ON_CONCURRENT:String = "internal::on_concurrent"; public static const ON_STATE_COMPLETE:String = "internal::on_state_complete"; public function SignalEvent(name:String){ super(name); } } }//package gamework.statemachine.hsm
Section 66
//TimeEvent (gamework.statemachine.hsm.TimeEvent) package gamework.statemachine.hsm { public class TimeEvent extends AbstractEvent { private var _delay:int; public function TimeEvent(delay:Number){ super(); _delay = delay; } public function get delay():int{ return (_delay); } } }//package gamework.statemachine.hsm
Section 67
//Transition (gamework.statemachine.hsm.Transition) package gamework.statemachine.hsm { import gamework.core.*; import gamework.utils.*; public class Transition implements IDisposable { private var _targetState:AbstractState; private var _effect:Function; private var _guardCondition:Function; private var _event:AbstractEvent; public function Transition(targetState:AbstractState, event:AbstractEvent, effect:Function, guardCondition:Function):void{ super(); _event = event; _targetState = targetState; _effect = effect; _guardCondition = guardCondition; } public function invokeEffect():void{ if (_effect != null){ _effect(); }; } public function toString():String{ return (ObjectUtil.formatToString(this, "targetState", "event")); } public function get targetState():AbstractState{ return (_targetState); } public function get event():AbstractEvent{ return (_event); } public function checkGuardCondition():Boolean{ if (_guardCondition == null){ return (true); }; return (_guardCondition()); } public function dispose():void{ _event = null; _targetState = null; _guardCondition = null; _effect = null; } } }//package gamework.statemachine.hsm
Section 68
//TransitionLevel (gamework.statemachine.hsm.TransitionLevel) package gamework.statemachine.hsm { public class TransitionLevel { public static const TO_SELF:String = "to_self"; public static const TO_DESCENDANT:String = "to_descendant"; public static const TO_ANCESTOR:String = "to_ancestor"; public static const TO_IRRELATIVE:String = "to_irrelative"; public static const TO_SIBLING:String = "to_sibling"; public function TransitionLevel(){ super(); } } }//package gamework.statemachine.hsm
Section 69
//AbstractButtonStyle (gamework.ui.styles.AbstractButtonStyle) package gamework.ui.styles { public class AbstractButtonStyle { public static const ROLL_OVER_HANDLER:String = "rollOverHandler"; public static const ROLL_OUT_HANDLER:String = "rollOutHandler"; public static const MOUSE_DOWN_HANDLER:String = "mouseDownHandler"; public function AbstractButtonStyle(){ super(); } } }//package gamework.ui.styles
Section 70
//AbstractWidgetStyle (gamework.ui.styles.AbstractWidgetStyle) package gamework.ui.styles { public class AbstractWidgetStyle { public static const DECORATION:String = "decoration"; public static const TEXT_FORMAT:String = "textFormat"; public static const DISABLED_ALPHA:String = "disabledAlpha"; public static const EMBED_FONTS:String = "embedFonts"; public function AbstractWidgetStyle(){ super(); } } }//package gamework.ui.styles
Section 71
//IconicButtonStyle (gamework.ui.styles.IconicButtonStyle) package gamework.ui.styles { public class IconicButtonStyle { public static const OVER_TINT_AMOUNT:String = "overTintAmount"; public static const OVER_TINT:String = "overTint"; public static const DOWN_TINT:String = "downTint"; public static const DOWN_TINT_AMOUNT:String = "downTintAmount"; public function IconicButtonStyle(){ super(); } } }//package gamework.ui.styles
Section 72
//IconicFramedButtonStyle (gamework.ui.styles.IconicFramedButtonStyle) package gamework.ui.styles { public class IconicFramedButtonStyle { public static const DOWN_FRAME:String = "downFrame"; public static const UP_FRAME:String = "upFrame"; public static const OVER_FRAME:String = "overFrame"; public function IconicFramedButtonStyle(){ super(); } } }//package gamework.ui.styles
Section 73
//TextButtonStyle (gamework.ui.styles.TextButtonStyle) package gamework.ui.styles { public class TextButtonStyle { public static const UP_STATE_COLOR:String = "upStateColor"; public static const DOWN_STATE_COLOR:String = "downStateColor"; public static const OVER_STATE_COLOR:String = "overStateColor"; public function TextButtonStyle(){ super(); } } }//package gamework.ui.styles
Section 74
//AbstractButtonWidget (gamework.ui.AbstractButtonWidget) package gamework.ui { import flash.display.*; import flash.events.*; import gamework.effects.*; import gamework.ui.styles.*; public class AbstractButtonWidget extends AbstractWidget { protected var _beacon:IBeacon; protected var _state:String;// = "up" public function AbstractButtonWidget(){ _state = ButtonWidgetState.UP; super(); buttonMode = true; mouseChildren = false; tabEnabled = false; addEventListener(MouseEvent.MOUSE_UP, onMouseEventHandler); addEventListener(MouseEvent.MOUSE_DOWN, onMouseEventHandler); addEventListener(MouseEvent.ROLL_OVER, onMouseEventHandler); addEventListener(MouseEvent.ROLL_OUT, onMouseEventHandler); } protected function get beaconTarget():DisplayObject{ return (this); } override public function dispose():void{ stopBeacon(); super.dispose(); } override public function set enabled(value:Boolean):void{ super.enabled = value; _state = ButtonWidgetState.UP; invalidate(InvalidationType.STATE); } private function onMouseEventHandler(event:MouseEvent):void{ var _local2:Function; var _local3:Function; var _local4:Function; switch (event.type){ case MouseEvent.ROLL_OUT: _local2 = (getStyle(AbstractButtonStyle.ROLL_OUT_HANDLER) as Function); if (_local2 != null){ _local2(this); }; _state = ButtonWidgetState.UP; break; case MouseEvent.MOUSE_DOWN: _local3 = (getStyle(AbstractButtonStyle.MOUSE_DOWN_HANDLER) as Function); if (_local3 != null){ _local3(this); }; _state = ButtonWidgetState.DOWN; break; case MouseEvent.MOUSE_UP: if (_state == ButtonWidgetState.DOWN){ _state = ButtonWidgetState.OVER; } else { return; }; break; case MouseEvent.ROLL_OVER: _local4 = (getStyle(AbstractButtonStyle.ROLL_OVER_HANDLER) as Function); if (_local4 != null){ _local4(this); }; _state = ButtonWidgetState.OVER; break; }; invalidate(InvalidationType.STATE); } public function startBeacon(beacon:IBeacon):void{ _beacon = beacon; _beacon.start(beaconTarget); } public function stopBeacon():void{ if (_beacon){ _beacon.dispose(); _beacon = null; }; } public static function get defaultStyles():Object{ var styles:Object; styles = {rollOverHandler:null, rollOutHandler:null, mouseDownHandler:null}; return (styles); } } }//package gamework.ui
Section 75
//AbstractWidget (gamework.ui.AbstractWidget) package gamework.ui { import flash.text.*; import flash.events.*; import gamework.display.*; import gamework.ui.styles.*; import gamework.utils.*; public class AbstractWidget extends EnhancedSprite { protected var _enabled:Boolean;// = true protected var _sharedStyles:Object; protected var invalidHash:Object; protected var _instanceStyles:Object; public function AbstractWidget(){ _instanceStyles = new Object(); _sharedStyles = new Object(); invalidHash = new Object(); _enabled = true; super(); StyleManager.registerWidget(this); WidgetManager.registerWidget(this); invalidate(); } private function onEnterFrameHandler(event:Event):void{ removeEventListener(Event.ENTER_FRAME, onEnterFrameHandler, false); draw(); } public function setScale(scale:Number):void{ scaleX = (scaleY = scale); } public function validate():void{ invalidHash = {}; } public function getStyle(style:String):Object{ var styleValue:Object; styleValue = ((_instanceStyles[style])==null) ? _sharedStyles[style] : _instanceStyles[style]; if ((styleValue is TextFormat)){ return (TextFormatUtils.clone((styleValue as TextFormat))); }; return (styleValue); } protected function setupMouse():void{ mouseEnabled = _enabled; } protected function invalidate(property:String="all"):void{ invalidHash[property] = true; addEventListener(Event.ENTER_FRAME, onEnterFrameHandler, false, 50); } public function get enabled():Boolean{ return (_enabled); } protected function draw():void{ var decoration:IDecoration; if (isInvalid(InvalidationType.STYLES)){ drawStyles(); decoration = (getStyle(AbstractWidgetStyle.DECORATION) as IDecoration); if (decoration){ decoration.apply(this); }; }; if (isInvalid(InvalidationType.STATE)){ drawState(); }; validate(); } public function dispose():void{ removeAllEventListeners(); WidgetManager.unregisterWidget(this); _instanceStyles = null; _sharedStyles = null; } public function setStyle(style:String, value:Object):void{ if (value === null){ delete _instanceStyles[style]; }; _instanceStyles[style] = value; invalidate(InvalidationType.ALL); } protected function isInvalid(property:String):Boolean{ if (((invalidHash[property]) || (invalidHash[InvalidationType.ALL]))){ return (true); }; return (false); } protected function drawStyles():void{ } public function set enabled(value:Boolean):void{ _enabled = value; setupMouse(); invalidate(InvalidationType.STATE); } public function setSharedStyle(style:String, value:Object):void{ _sharedStyles[style] = value; invalidate(InvalidationType.ALL); } protected function drawState():void{ alpha = (_enabled) ? 1 : (getStyle(AbstractWidgetStyle.DISABLED_ALPHA) as Number); } public static function get defaultStyles():Object{ var styles:Object; styles = {textFormat:new TextFormat(), embedFonts:true, disabledAlpha:0.5, decoration:null}; return (styles); } } }//package gamework.ui
Section 76
//ApplicationContextMenu (gamework.ui.ApplicationContextMenu) package gamework.ui { import flash.events.*; import flash.ui.*; import gamework.net.*; public class ApplicationContextMenu { private static var moreGamesItem:ContextMenuItem = new ContextMenuItem("Play more games"); private static var getGameItem:ContextMenuItem = new ContextMenuItem("Get game for your site"); private static var scoresItem:ContextMenuItem = new ContextMenuItem("High scores"); private static var downloadItem:ContextMenuItem = new ContextMenuItem("Download this game"); private static var menu:ContextMenu; public function ApplicationContextMenu(){ super(); } private static function onMenuItemSelect(event:ContextMenuEvent):void{ switch (event.target){ case scoresItem: URLCaller.viewScores(); break; case moreGamesItem: URLCaller.playMoreGames(); break; case getGameItem: URLCaller.getGameForSite(); break; case downloadItem: URLCaller.downloadGame(); break; }; } public static function getEmptyMenu():ContextMenu{ var emptyMenu:ContextMenu; emptyMenu = new ContextMenu(); emptyMenu.hideBuiltInItems(); return (emptyMenu); } public static function getMenu():ContextMenu{ if (!menu){ menu = getEmptyMenu(); scoresItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onMenuItemSelect); moreGamesItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onMenuItemSelect); getGameItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onMenuItemSelect); downloadItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, onMenuItemSelect); menu.customItems.push(scoresItem); menu.customItems.push(moreGamesItem); menu.customItems.push(getGameItem); menu.customItems.push(downloadItem); }; return (menu); } } }//package gamework.ui
Section 77
//ButtonWidgetState (gamework.ui.ButtonWidgetState) package gamework.ui { public class ButtonWidgetState { public static const DOWN:String = "down"; public static const OVER:String = "over"; public static const UP:String = "up"; public function ButtonWidgetState(){ super(); } } }//package gamework.ui
Section 78
//IconicButtonWidget (gamework.ui.IconicButtonWidget) package gamework.ui { import flash.display.*; import fl.motion.*; import flash.geom.*; import gamework.ui.styles.*; public class IconicButtonWidget extends AbstractButtonWidget { public var _icon:Sprite; public function IconicButtonWidget(){ super(); } override protected function drawState():void{ var _local1:Color; var _local2:Color; switch (_state){ case ButtonWidgetState.UP: _icon.transform.colorTransform = new ColorTransform(); break; case ButtonWidgetState.OVER: _local1 = new Color(); _local1.tintColor = (getStyle(IconicButtonStyle.OVER_TINT) as uint); _local1.tintMultiplier = (getStyle(IconicButtonStyle.OVER_TINT_AMOUNT) as Number); _icon.transform.colorTransform = _local1; break; case ButtonWidgetState.DOWN: _local2 = new Color(); _local2.tintColor = (getStyle(IconicButtonStyle.DOWN_TINT) as uint); _local2.tintMultiplier = (getStyle(IconicButtonStyle.DOWN_TINT_AMOUNT) as Number); _icon.transform.colorTransform = _local2; break; }; super.drawState(); } public static function get defaultStyles():Object{ var styles:Object; styles = {overTint:0xFFFFFF, overTintAmount:0.3, downTint:0xFFFFFF, downTintAmount:0.15}; return (styles); } } }//package gamework.ui
Section 79
//IconicFramedButtonWidget (gamework.ui.IconicFramedButtonWidget) package gamework.ui { import flash.display.*; import gamework.ui.styles.*; public class IconicFramedButtonWidget extends AbstractButtonWidget { public var _icon:MovieClip; public function IconicFramedButtonWidget(){ super(); } override protected function drawState():void{ switch (_state){ case ButtonWidgetState.UP: _icon.gotoAndStop((getStyle(IconicFramedButtonStyle.UP_FRAME) as int)); break; case ButtonWidgetState.OVER: _icon.gotoAndStop((getStyle(IconicFramedButtonStyle.OVER_FRAME) as int)); break; case ButtonWidgetState.DOWN: _icon.gotoAndStop((getStyle(IconicFramedButtonStyle.DOWN_FRAME) as int)); break; }; super.drawState(); } public static function get defaultStyles():Object{ var styles:Object; styles = {upFrame:1, overFrame:2, downFrame:3}; return (styles); } } }//package gamework.ui
Section 80
//InvalidationType (gamework.ui.InvalidationType) package gamework.ui { public class InvalidationType { public static const STATE:String = "state"; public static const ALL:String = "all"; public static const STYLES:String = "styles"; public function InvalidationType(){ super(); } } }//package gamework.ui
Section 81
//StyleManager (gamework.ui.StyleManager) package gamework.ui { import flash.utils.*; public class StyleManager { private static var sharedStylesHash:Dictionary = new Dictionary(); private static var cachedStylesHash:Dictionary = new Dictionary(); public function StyleManager(){ super(); } private static function getMergedSharedStyles(widget:AbstractWidget):Object{ var widgetClass:Class; var sharedStyles:Object; var mergedStyles:Object; var prop:String; var tempWidgetClass:Class; var tempStyles:Object; var name:String; widgetClass = (getDefinitionByName(getQualifiedClassName(widget)) as Class); if (cachedStylesHash[widgetClass]){ return (cachedStylesHash[widgetClass]); }; sharedStyles = getSharedStyle(widgetClass); mergedStyles = {}; for (prop in sharedStyles) { mergedStyles[prop] = sharedStyles[prop]; }; tempWidgetClass = (getDefinitionByName(getQualifiedClassName(widget)) as Class); while (true) { tempStyles = getSharedStyle(tempWidgetClass); for (name in tempStyles) { if (mergedStyles[name] === undefined){ mergedStyles[name] = tempStyles[name]; }; }; if (getQualifiedClassName(tempWidgetClass) == "gamework.ui::AbstractWidget"){ break; } else { tempWidgetClass = (getDefinitionByName(getQualifiedSuperclassName(tempWidgetClass)) as Class); }; }; cachedStylesHash[widgetClass] = mergedStyles; return (mergedStyles); } public static function setSharedStyle(widgetClass:Class, style:String, value:Object):void{ var sharedStyles:Object; sharedStyles = getSharedStyle(widgetClass); sharedStyles[style] = value; cachedStylesHash = new Dictionary(); invalidateSharedStyles(widgetClass); } private static function getSharedStyle(widgetClass:Class):Object{ var defaultStyles:Object; if (!sharedStylesHash[widgetClass]){ defaultStyles = widgetClass["defaultStyles"]; sharedStylesHash[widgetClass] = ((defaultStyles) || (new Object())); }; return (sharedStylesHash[widgetClass]); } static function registerWidget(widget:AbstractWidget):void{ var styles:Object; var style:String; styles = getMergedSharedStyles(widget); for (style in styles) { widget.setSharedStyle(style, styles[style]); }; } private static function invalidateSharedStyles(widgetClass:Class):void{ var list:Array; var widget:AbstractWidget; var styles:Object; var style:String; list = WidgetManager.getWidgetsList(); for each (widget in list) { if ((widget is widgetClass)){ styles = getMergedSharedStyles(widget); for (style in styles) { widget.setSharedStyle(style, styles[style]); }; }; }; } } }//package gamework.ui
Section 82
//TextButtonWidget (gamework.ui.TextButtonWidget) package gamework.ui { import flash.display.*; import flash.text.*; import gamework.ui.styles.*; public class TextButtonWidget extends AbstractButtonWidget { public var _labelField:TextField; protected var _align:String;// = "center" protected var _label:String;// = "Label" public function TextButtonWidget(){ _label = "Label"; _align = TextFieldAutoSize.CENTER; super(); } override protected function drawStyles():void{ var textFormat:TextFormat; _labelField.autoSize = _align; _labelField.embedFonts = (getStyle(AbstractWidgetStyle.EMBED_FONTS) as Boolean); textFormat = (getStyle(AbstractWidgetStyle.TEXT_FORMAT) as TextFormat); if (textFormat){ _labelField.setTextFormat(textFormat); _labelField.defaultTextFormat = textFormat; }; } override protected function drawState():void{ switch (_state){ case ButtonWidgetState.UP: _labelField.textColor = (getStyle(TextButtonStyle.UP_STATE_COLOR) as uint); break; case ButtonWidgetState.OVER: _labelField.textColor = (getStyle(TextButtonStyle.OVER_STATE_COLOR) as uint); break; case ButtonWidgetState.DOWN: _labelField.textColor = (getStyle(TextButtonStyle.DOWN_STATE_COLOR) as uint); break; }; super.drawState(); } public function set alignment(value:String):void{ if (_align != value){ _align = value; invalidate(InvalidationType.STYLES); }; } public function set label(value:String):void{ if (_label != value){ _labelField.text = (_label = value); }; } override protected function get beaconTarget():DisplayObject{ return (_labelField); } public static function get defaultStyles():Object{ var styles:Object; styles = {upStateColor:0xFFFFFF, overStateColor:0xFF0000, downStateColor:0x880000}; return (styles); } } }//package gamework.ui
Section 83
//WidgetContainer (gamework.ui.WidgetContainer) package gamework.ui { import flash.display.*; public class WidgetContainer extends AbstractWidget { protected var childWidgets:Array; public function WidgetContainer(){ childWidgets = new Array(); super(); } override public function dispose():void{ var numChildWidgets:int; var i:int; numChildWidgets = childWidgets.length; i = 0; while (i < numChildWidgets) { childWidgets[i].dispose(); i++; }; childWidgets = null; super.dispose(); } override public function removeChildAt(index:int):DisplayObject{ var child:DisplayObject; child = getChildAt(index); if ((child is AbstractWidget)){ index = childWidgets.indexOf(child); if (index != -1){ childWidgets.splice(index, 1); }; }; return (super.removeChildAt(index)); } override public function addChild(child:DisplayObject):DisplayObject{ var index:int; if ((child is AbstractWidget)){ index = childWidgets.indexOf(child); if (index == -1){ childWidgets.push(child); }; }; return (super.addChild(child)); } override public function set enabled(value:Boolean):void{ var numChildWidgets:int; var i:int; super.enabled = value; numChildWidgets = childWidgets.length; i = 0; while (i < numChildWidgets) { childWidgets[i].enabled = value; i++; }; } override public function addChildAt(child:DisplayObject, index:int):DisplayObject{ if ((child is AbstractWidget)){ index = childWidgets.indexOf(child); if (index == -1){ childWidgets.push(child); }; }; return (super.addChildAt(child, index)); } public function addChildren(... _args):void{ var numChildren:int; var i:int; numChildren = _args.length; i = 0; while (i < numChildren) { addChild(_args[i]); i++; }; } override public function removeChild(child:DisplayObject):DisplayObject{ var index:int; if ((child is AbstractWidget)){ index = childWidgets.indexOf(child); if (index != -1){ childWidgets.splice(index, 1); }; }; return (super.removeChild(child)); } } }//package gamework.ui
Section 84
//WidgetManager (gamework.ui.WidgetManager) package gamework.ui { import gamework.utils.*; import flash.utils.*; public class WidgetManager { private static var _widgets:Dictionary = new Dictionary(); public function WidgetManager(){ super(); } public static function dump():Array{ var list:Array; var w:Object; list = new Array(); for (w in _widgets) { list.push((((NameUtil.getClassName(w) + " [") + NameUtil.objectToDisplayObjectString(w)) + "]")); }; return (list); } static function getWidgetsList():Array{ var list:Array; var w:Object; list = []; for (w in _widgets) { list.push(w); }; return (list); } static function registerWidget(widget:AbstractWidget):void{ if (!_widgets[widget]){ _widgets[widget] = true; }; } static function unregisterWidget(widget:AbstractWidget):void{ if (_widgets[widget]){ delete _widgets[widget]; }; } } }//package gamework.ui
Section 85
//Countdown (gamework.utils.Countdown) package gamework.utils { import flash.events.*; import gamework.events.*; import gamework.core.*; import flash.utils.*; public class Countdown extends EventDispatcher implements IDisposable { private var _delay:int; private var lastGetTimer:int; private var timeoutID:uint; private var timer:Timer; private var state:String;// = "state_stopped" private var resumeDelay:int; private var _ticksLeft:int; private var _numTicks:int; public static const EVENT_PAUSE:String = "event_pause"; public static const STATE_COMPLETED:String = "state_completed"; public static const STATE_STOPPED:String = "state_stopped"; public static const EVENT_STOP:String = "event_stop"; public static const STATE_RUNNING:String = "state_running"; public static const EVENT_RESUME:String = "event_resume"; public static const STATE_RESUMING:String = "state_resuming"; public static const STATE_PAUSED:String = "state_paused"; public static const EVENT_START:String = "event_start"; public function Countdown(numTicks:int, delay:Number=1){ state = STATE_STOPPED; super(); _delay = (delay * 1000); _numTicks = numTicks; timer = new Timer(_delay); timer.addEventListener(TimerEvent.TIMER, onTimerHandler); } private function onTimeout():void{ lastGetTimer = getTimer(); resumeDelay = 0; clearTimeout(timeoutID); _ticksLeft--; if (_ticksLeft == 0){ dispatchEvent(new CountdownEvent(CountdownEvent.TIMEOUT)); privateStop(); } else { dispatchEvent(new CountdownEvent(CountdownEvent.TICK, _ticksLeft)); timer.start(); state = STATE_RUNNING; }; } public function stop():void{ reciveEvent(EVENT_STOP); } private function privateResume():void{ var timerPosition:int; lastGetTimer = getTimer(); timerPosition = (_delay - resumeDelay); if (timerPosition < 0){ timerPosition = 0; } else { if (timerPosition > _delay){ timerPosition = _delay; }; }; timeoutID = setTimeout(onTimeout, timerPosition); state = STATE_RESUMING; } private function onTimerHandler(event:TimerEvent=null):void{ lastGetTimer = getTimer(); resumeDelay = 0; _ticksLeft--; if (_ticksLeft == 0){ privateStop(); state = STATE_COMPLETED; dispatchEvent(new CountdownEvent(CountdownEvent.TICK)); dispatchEvent(new CountdownEvent(CountdownEvent.TIMEOUT)); } else { dispatchEvent(new CountdownEvent(CountdownEvent.TICK, _ticksLeft)); }; } public function get numTicks():int{ return (_numTicks); } public function addTicks(ticks:int):void{ _ticksLeft = (_ticksLeft + ticks); } public function get ticksLeft():int{ return (_ticksLeft); } private function privateStart():void{ lastGetTimer = getTimer(); resumeDelay = 0; _ticksLeft = _numTicks; timer.start(); state = STATE_RUNNING; } private function privatePause():void{ resumeDelay = (resumeDelay + (getTimer() - lastGetTimer)); timer.stop(); state = STATE_PAUSED; } public function dispose():void{ privateStop(); timer.removeEventListener(TimerEvent.TIMER, onTimerHandler); timer = null; } public function reset():void{ privateStop(); } public function start():void{ reciveEvent(EVENT_START); } private function reciveEvent(event:String):void{ switch (state){ case STATE_STOPPED: if (event == EVENT_START){ privateStart(); }; break; case STATE_RUNNING: if (event == EVENT_STOP){ privateStop(); } else { if (event == EVENT_PAUSE){ privatePause(); }; }; break; case STATE_PAUSED: if (event == EVENT_START){ privateResume(); } else { if (event == EVENT_STOP){ privateStop(); }; }; break; case STATE_RESUMING: if (event == EVENT_STOP){ clearTimeout(timeoutID); privateStop(); } else { if (event == EVENT_PAUSE){ clearTimeout(timeoutID); privatePause(); }; }; break; }; } public function pause():void{ reciveEvent(EVENT_PAUSE); } private function privateStop():void{ timer.stop(); state = STATE_STOPPED; } } }//package gamework.utils
Section 86
//NameUtil (gamework.utils.NameUtil) package gamework.utils { import flash.display.*; import flash.utils.*; public class NameUtil { public function NameUtil(){ super(); } public static function objectToDisplayObjectString(object:Object):String{ var result:String; var o:DisplayObject; var s:String; if ((object is DisplayObject)){ o = (object as DisplayObject); while (o != null) { if (((((o.parent) && (o.stage))) && ((o.parent == o.stage)))){ break; }; s = o.name; result = ((result == null)) ? s : ((s + ".") + result); o = o.parent; }; } else { result = "Not a DisplayObject"; }; return (result); } public static function getClassName(object):String{ var name:String; var index:int; name = getQualifiedClassName(object); index = name.indexOf("::"); if (index != -1){ name = name.substr((index + 2)); }; return (name); } } }//package gamework.utils
Section 87
//ObjectUtil (gamework.utils.ObjectUtil) package gamework.utils { public class ObjectUtil { public function ObjectUtil(){ super(); } public static function formatToString(object, ... _args):String{ var out:String; var numArgs:int; var i:int; var arg:String; out = ("[" + NameUtil.getClassName(object)); numArgs = _args.length; i = 0; while (i < numArgs) { arg = _args[i]; if (object.hasOwnProperty(arg)){ out = (out + (((" " + arg) + "=") + object[arg])); }; i++; }; return ((out + "]")); } public static function hasProperties(object:Object):Boolean{ var p:String; for (p in object) { return (true); }; return (false); } } }//package gamework.utils
Section 88
//StringUtil (gamework.utils.StringUtil) package gamework.utils { public class StringUtil { public function StringUtil(){ super(); } public static function secondsToElectronicTimerString(seconds:int, delimiter:String=":"):String{ var secondStr:String; var minuteStr:String; secondStr = String((seconds % 60)); secondStr = ((secondStr.length == 1)) ? ("0" + secondStr) : secondStr; minuteStr = String(Math.floor((seconds / 60))); minuteStr = ((minuteStr.length == 1)) ? ("0" + minuteStr) : minuteStr; return (((minuteStr + delimiter) + secondStr)); } public static function substitute(str:String, ... _args):String{ var len:uint; var args:Array; var i:int; if (str == null){ return (""); }; len = _args.length; if ((((len == 1)) && ((_args[0] is Array)))){ args = (_args[0] as Array); len = args.length; } else { args = _args; }; i = 0; while (i < len) { str = str.replace(new RegExp((("\\{" + i) + "\\}"), "g"), args[i]); i++; }; return (str); } public static function formatCurrency(value:int, currencySymbol:String="$", thousandSeparator:String=","):String{ var str:String; var ar:Array; var count:int; str = ""; ar = String(value).split(""); count = 0; while (ar.length > 0) { str = (ar.pop() + str); ++count; if ((((count == 3)) && (!((ar.length == 0))))){ str = (thousandSeparator + str); count = 0; }; }; return ((currencySymbol + str)); } } }//package gamework.utils
Section 89
//TextFormatUtils (gamework.utils.TextFormatUtils) package gamework.utils { import flash.text.*; public class TextFormatUtils { public function TextFormatUtils(){ super(); } public static function clone(textFormat:TextFormat):TextFormat{ return (new TextFormat(textFormat.font, textFormat.size, textFormat.color, textFormat.bold, textFormat.italic, textFormat.underline, textFormat.url, textFormat.target, textFormat.align, textFormat.leftMargin, textFormat.rightMargin, textFormat.indent, textFormat.leading)); } } }//package gamework.utils
Section 90
//exported_movieclips_1 (under_fla.exported_movieclips_1) package under_fla { import flash.display.*; public dynamic class exported_movieclips_1 extends MovieClip { public function exported_movieclips_1(){ super(); addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package under_fla
Section 91
//exported_sounds_63 (under_fla.exported_sounds_63) package under_fla { import flash.display.*; public dynamic class exported_sounds_63 extends MovieClip { public function exported_sounds_63(){ super(); addFrameScript(0, frame1); } function frame1(){ stop(); } } }//package under_fla
Section 92
//HintPopupMovie_3 (under_fla.HintPopupMovie_3) package under_fla { import flash.display.*; public dynamic class HintPopupMovie_3 extends MovieClip { public var closeButtonPositioner:MovieClip; public function HintPopupMovie_3(){ super(); } } }//package under_fla
Section 93
//preloader_progress_bar_61 (under_fla.preloader_progress_bar_61) package under_fla { import flash.display.*; public dynamic class preloader_progress_bar_61 extends MovieClip { public var progress_bar_mask:MovieClip; public function preloader_progress_bar_61(){ super(); } } }//package under_fla
Section 94
//Constants (underConstruction.data.Constants) package underConstruction.data { public class Constants { public static const POWERUP_BONUS:int = 10; public static const FIELD_WIDTH:int = 16; public static const MAX_CUSTOM_LEVELS:int = 128; public static const TIME_BONUS:int = 5; public static const FIELD_TILE_SIZE:int = 30; public static const ADD_SINGLE_BRICK_POWERUP_COUNT:int = 3; public static const FIELD_NUM_TILES:int = 160; public static const PLACE_PIECE_SCORE:int = 10; public static const HOLE_PENALTY:int = 15; public static const FIELD_HEIGHT:int = 10; public static const DISPOSE_PENALTY:int = 2; public static const PIECE_SPEED_ON_CONVEYOR:Number = 1.5; public static const REMOVE_SINGLE_BRICK_POWERUP_COUNT:int = 3; public static const COLOR_MATCH_BONUS:int = 5; public static const MAX_CUSTOM_FLOORS:int = 32; public function Constants(){ super(); } } }//package underConstruction.data
Section 95
//GameInfo (underConstruction.data.GameInfo) package underConstruction.data { import underConstruction.views.playField.*; public class GameInfo { private static var _level:int; private static var _levelScore:int; private static var _numFloors:int; private static var _soundOn:Boolean = true; private static var _completedFloors:Array; private static var _floor:int; private static var _numHolesOnLevel:int; private static var _score:int; private static var _time:int; private static var _powerups:Object = new Object(); public function GameInfo(){ super(); } public static function initializeNewGame(startLevel:int, score:int):void{ _level = startLevel; _floor = 0; _score = score; } public static function get level():int{ return (_level); } public static function set level(value:int):void{ _level = value; } public static function addCompletedFloor(data:Array, numHoles:int):void{ _completedFloors.push(data.slice()); _numHolesOnLevel = (_numHolesOnLevel + numHoles); } public static function get floor():int{ return (_floor); } public static function get score():int{ return (_score); } public static function get soundOn():Boolean{ return (_soundOn); } public static function powerupCount(type:String):int{ if (!_powerups[type]){ return (0); }; return (_powerups[type]); } public static function powerupCountSummary():int{ var sum:int; var name:String; sum = 0; for (name in _powerups) { sum = (sum + _powerups[name]); }; return (sum); } public static function set floor(value:int):void{ _floor = value; } public static function usePowerup(type:String):void{ if (!_powerups[type]){ return; }; var _local2 = _powerups; var _local3 = type; var _local4 = (_local2[_local3] - 1); _local2[_local3] = _local4; } public static function set levelScore(value:int):void{ _levelScore = value; if (_levelScore < 0){ _levelScore = 0; }; } public static function get time():int{ return (_time); } public static function get numHolesOnLevel():int{ return (_numHolesOnLevel); } public static function set time(value:int):void{ _time = value; } public static function get completedFloors():Array{ return (_completedFloors); } public static function get levelScore():int{ return (_levelScore); } public static function get numFloors():int{ return (_numFloors); } public static function set score(value:int):void{ _score = value; if (_score < 0){ _score = 0; }; } public static function initializeNewLevel():void{ _floor = -1; _levelScore = 0; _numFloors = Levels.getNumFloors(_level); _time = Levels.getTime(_level); _numHolesOnLevel = 0; _completedFloors = new Array(); _powerups[PowerupType.ADD_SINGLE_BRICK] = (Constants.ADD_SINGLE_BRICK_POWERUP_COUNT + (_numFloors - 1)); _powerups[PowerupType.REMOVE_SINGLE_BRICK] = (Constants.REMOVE_SINGLE_BRICK_POWERUP_COUNT + (_numFloors - 1)); } public static function set soundOn(value:Boolean):void{ _soundOn = value; } } }//package underConstruction.data
Section 96
//Levels (underConstruction.data.Levels) package underConstruction.data { import gamework.net.*; public class Levels { private static var levelsProps:Array = [{name:"Beginner's Block", goal:"250", time:"90"}, {name:"Hyper Drive", goal:"400", time:"100"}, {name:"Pepperpot Place", goal:"600", time:"140"}, {name:"Power Tower", goal:"700", time:"140"}, {name:"Rocket Suites", goal:"850", time:"210"}, {name:"Nano Heights", goal:"950", time:"220"}, {name:"Robotica Ave.", goal:"1250", time:"270"}, {name:"Ultra Park", goal:"1450", time:"370"}, {name:"Gizmo Condo", goal:"1650", time:"350"}, {name:"Jupiter Towers", goal:"1850", time:"370"}, {name:"Geigeria Point", goal:"2250", time:"400"}, {name:"Cthulhu Place", goal:"3200", time:"570"}, {name:"Voyager Building", goal:"3300", time:"590"}, {name:"Workers' Square", goal:"3650", time:"630"}, {name:"Tower of Babble", goal:"4750", time:"750"}]; private static var levelsData:Array = [[[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1]], [[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1]], [[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1]], [[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [-1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1]], [[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1]], [[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1]], [[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1], [-1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, 0, 0, -1, -1, -1, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1]], [[-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [-1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1]], [[-1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1], [-1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1]], [[-1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1], [-1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1], [-1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1], [-1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, -1, -1, 0, -1, -1, 0, -1, -1, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1]], [[-1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1], [-1, -1, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, -1, -1, -1], [-1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1], [-1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1]], [[-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0], [-1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [-1, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [-1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, -1, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1]], [[-1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1], [-1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, -1, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, -1, 0, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1], [-1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, 0, -1, -1, 0, 0, 0, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1], [-1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, -1], [-1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1]], [[-1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0], [-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1], [-1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, -1, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1], [-1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [-1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1]], [[-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1], [-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [-1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1], [-1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, -1]]]; public function Levels(){ super(); } public static function getFloorData(level:int, floor:int):Array{ var l:Array; l = levelsData[level][floor]; return (l.slice()); } public static function getTime(level:int):int{ return (levelsProps[level].time); } public static function get lastEditedLevel():int{ var soManager:SOManager; soManager = SOManager.getInstance(); return ((soManager.getValue(SOValues.LAST_EDITED_LEVEL) as int)); } public static function getCustomNumFloors():int{ var levelsData:Array; levelsData = customLevelsData; return (levelsData[lastEditedLevel].length); } public static function getName(level:int):String{ return (levelsProps[level].name); } public static function getGoal(level:int):int{ return (levelsProps[level].goal); } public static function get customLevelsData():Array{ var soManager:SOManager; soManager = SOManager.getInstance(); return ((soManager.getValue(SOValues.CUSTOM_LEVELS_DATA) as Array)); } public static function get newLevelProps():Object{ var newLevelProps:Object; newLevelProps = {name:"Enter level's name here...", goal:1000, time:90}; return (newLevelProps); } public static function loadCustomLevels():void{ var soManager:SOManager; soManager = SOManager.getInstance(); if (soManager.getValue(SOValues.CUSTOM_LEVELS_DATA) == null){ soManager.setValue(SOValues.CUSTOM_LEVELS_DATA, new Array()); }; if (soManager.getValue(SOValues.CUSTOM_LEVELS_PROPS) == null){ soManager.setValue(SOValues.CUSTOM_LEVELS_PROPS, new Array()); }; if (soManager.getValue(SOValues.LAST_EDITED_FLOOR) == null){ soManager.setValue(SOValues.LAST_EDITED_FLOOR, -1); }; if (soManager.getValue(SOValues.LAST_EDITED_LEVEL) == null){ soManager.setValue(SOValues.LAST_EDITED_LEVEL, -1); }; } public static function getCustomFloorData(floor:int):Array{ var levelsData:Array; var floorData:Array; levelsData = customLevelsData; floorData = customLevelsData[lastEditedLevel][floor]; return (floorData.slice()); } public static function get customLevelsProps():Array{ var soManager:SOManager; soManager = SOManager.getInstance(); return ((soManager.getValue(SOValues.CUSTOM_LEVELS_PROPS) as Array)); } public static function get lastEditedFloor():int{ var soManager:SOManager; soManager = SOManager.getInstance(); return ((soManager.getValue(SOValues.LAST_EDITED_FLOOR) as int)); } public static function getNumFloors(level:int):int{ return (levelsData[level].length); } public static function get newEmptyFloorData():Array{ var a:Array; var i:int; a = new Array(); i = 0; while (i < Constants.FIELD_NUM_TILES) { a.push(-1); i++; }; return (a); } public static function saveCustomLevels(levelsData:Array, levelsNames:Array, level:int, floor:int):void{ var soManager:SOManager; soManager = SOManager.getInstance(); soManager.setValue(SOValues.CUSTOM_LEVELS_DATA, levelsData); soManager.setValue(SOValues.CUSTOM_LEVELS_PROPS, levelsNames); soManager.setValue(SOValues.LAST_EDITED_LEVEL, level); soManager.setValue(SOValues.LAST_EDITED_FLOOR, floor); } public static function getNumLevels():int{ return (levelsData.length); } } }//package underConstruction.data
Section 97
//SOValues (underConstruction.data.SOValues) package underConstruction.data { public class SOValues { public static const SCORE_REACHED:String = "score_reached"; public static const LAST_EDITED_LEVEL:String = "last_edited_level"; public static const CUSTOM_LEVELS_DATA:String = "custom_levels_data"; public static const CUSTOM_LEVELS_PROPS:String = "custom_levels_props"; public static const SHOW_HINTS:String = "show_hints"; public static const LEVEL_REACHED:String = "level_reached"; public static const LAST_EDITED_FLOOR:String = "last_edited_floor"; public function SOValues(){ super(); } } }//package underConstruction.data
Section 98
//PopupEvent (underConstruction.events.PopupEvent) package underConstruction.events { import flash.events.*; public class PopupEvent extends Event { private var _data; public static const CLOSE:String = "popup_close"; public static const ANIMATION_COMPLETE:String = "animation_complete"; public function PopupEvent(type:String, data=null){ _data = data; super(type); } public function get data(){ return (_data); } } }//package underConstruction.events
Section 99
//ViewEvent (underConstruction.events.ViewEvent) package underConstruction.events { import flash.events.*; public class ViewEvent extends Event { private var _data; public static const COMPLETE:String = "complete"; public function ViewEvent(type:String, data=null){ _data = data; super(type); } public function get data(){ return (_data); } } }//package underConstruction.events
Section 100
//HintManager (underConstruction.hints.HintManager) package underConstruction.hints { import gamework.net.*; import underConstruction.views.*; import underConstruction.data.*; import underConstruction.popups.*; public class HintManager { private static var hintsToShow:Array = [HintType.ACTIVATE_POWERUP]; public function HintManager(){ super(); } public static function disableHints():void{ hintsToShow = []; } public static function getHintPopup(props:Object):AbstractView{ var type:String; var popup:AbstractView; type = props.type; if (hintsToShow[(hintsToShow.length - 1)] != type){ return (null); }; popup = new HintPopup(type, props.x, props.y); hintsToShow.pop(); if (hintsToShow.length == 0){ SOManager.getInstance().setValue(SOValues.SHOW_HINTS, false); }; return (popup); } public static function reenableHints():void{ hintsToShow = [HintType.ACTIVATE_POWERUP]; } public static function pendingHintType():String{ if ((((hintsToShow.length == 0)) || (!((SOManager.getInstance().getValue(SOValues.SHOW_HINTS) === true))))){ return (null); }; return (hintsToShow[(hintsToShow.length - 1)]); } } }//package underConstruction.hints
Section 101
//HintType (underConstruction.hints.HintType) package underConstruction.hints { public class HintType { public static const CONNECT_COLORS:String = "connectColors"; public static const TRASH_PIECE:String = "trashPiece"; public static const POWERUP_USAGE:String = "powerupUsage"; public static const SELECT_PIECE:String = "selectPiece"; public static const ROTATE_PIECE:String = "rotatePiece"; public static const ACTIVATE_POWERUP:String = "activatePowerup"; public static const PLACE_PIECE:String = "placePiece"; public function HintType(){ super(); } } }//package underConstruction.hints
Section 102
//HintPopup (underConstruction.popups.HintPopup) package underConstruction.popups { import flash.display.*; import gamework.ui.*; import flash.events.*; import underConstruction.views.*; import flash.geom.*; import gamework.effects.*; import underConstruction.events.*; public class HintPopup extends AbstractView { public var _movieClip:MovieClip; public var _closeButton:TextButtonWidget; public function HintPopup(type:String, x:Number, y:Number){ var btnPosition:Point; super(); visible = false; _movieClip.mouseEnabled = false; _movieClip.gotoAndStop(type); _movieClip.x = x; _movieClip.y = y; _movieClip.closeButtonPositioner.visible = false; btnPosition = _movieClip.localToGlobal(new Point(_movieClip.closeButtonPositioner.x, _movieClip.closeButtonPositioner.y)); _closeButton.x = btnPosition.x; _closeButton.y = btnPosition.y; _closeButton.startBeacon(new BrightnessBeacon()); addChild(_closeButton); invalidate(); __setProp__closeButton_HintPopup_Layer1_1(); } override protected function draw():void{ visible = true; addEventListener(MouseEvent.CLICK, onMouseClickHandler); validate(); } function __setProp__closeButton_HintPopup_Layer1_1(){ _closeButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _closeButton.alignment = "center"; _closeButton.label = "Close"; _closeButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function onMouseClickHandler(event:MouseEvent):void{ if (event.target == _closeButton){ dispatchEvent(new PopupEvent(PopupEvent.CLOSE)); }; } } }//package underConstruction.popups
Section 103
//InstructionPopup (underConstruction.popups.InstructionPopup) package underConstruction.popups { import gamework.ui.*; import flash.events.*; import underConstruction.views.*; import gamework.effects.*; import underConstruction.events.*; public class InstructionPopup extends AbstractView { public var _continueButton:TextButtonWidget; public function InstructionPopup(){ super(); visible = false; addChildren(_continueButton); _continueButton.startBeacon(new BrightnessBeacon()); invalidate(); __setProp__continueButton_InstructionPopup_Layer1_1(); } override protected function draw():void{ addEventListener(MouseEvent.CLICK, onMouseClickHandler); visible = true; validate(); } function __setProp__continueButton_InstructionPopup_Layer1_1(){ _continueButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _continueButton.alignment = "left"; _continueButton.label = "Continue"; _continueButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function onMouseClickHandler(event:MouseEvent):void{ switch (event.target){ case _continueButton: dispatchEvent(new PopupEvent(PopupEvent.CLOSE, true)); break; }; } } }//package underConstruction.popups
Section 104
//LevelScorePopup (underConstruction.popups.LevelScorePopup) package underConstruction.popups { import gamework.sound.*; import flash.text.*; import com.boostworthy.animation.sequence.tweens.*; import underConstruction.views.*; import com.boostworthy.events.*; import underConstruction.events.*; import underConstruction.data.*; import underConstruction.sound.*; import com.boostworthy.animation.easing.*; import com.boostworthy.animation.rendering.*; import com.boostworthy.animation.sequence.*; public class LevelScorePopup extends AbstractView { private var profitLossValue:int; public var _valuesField:TextField; private var timeline:Timeline; public var _resultMessageField:TextField; public var _captionsField:TextField; private var soundMan:SoundManager; public function LevelScorePopup(){ super(); soundMan = SoundManager.getInstance(); mouseChildren = false; mouseEnabled = false; visible = false; _captionsField.text = (_valuesField.text = (_resultMessageField.text = "")); y = -430; invalidate(); } override public function dispose():void{ soundMan = null; timeline.stop(); timeline.dispose(); timeline = null; super.dispose(); } override protected function draw():void{ visible = true; timeline = new Timeline(RenderMethod.ENTER_FRAME); timeline.addTween(new Tween(this, "y", 0, 40, 90, Transitions.BOUNCE)); timeline.addTween(new Action(showGoal, [], null, [], 100)); timeline.addTween(new Action(showTimeBonus, [], null, [], 115)); timeline.addTween(new Action(showPowerupsBonus, [], null, [], 130)); timeline.addTween(new Action(showLevelScore, [], null, [], 145)); timeline.addTween(new Action(showTotalScore, [], null, [], 160)); timeline.addTween(new Action(showLevelResult, [], null, [], 175)); timeline.addEventListener(AnimationEvent.FINISH, onAnimationFinishHandler); timeline.play(); validate(); } private function showLevelScore():void{ profitLossValue = (GameInfo.levelScore - Levels.getGoal(GameInfo.level)); if (profitLossValue < 0){ _captionsField.htmlText = (_captionsField.htmlText + "<font color='#FF0000'>Level Score:</font><br>"); _valuesField.htmlText = (_valuesField.htmlText + (("<font color='#FF0000'>" + String(GameInfo.levelScore)) + "</font><br>")); soundMan.playSound(SoundID.PENALTY); } else { _captionsField.htmlText = (_captionsField.htmlText + "<font color='#00FF00'>Level Score:</font><br>"); _valuesField.htmlText = (_valuesField.htmlText + (("<font color='#00FF00'>" + String(GameInfo.levelScore)) + "</font><br>")); GameInfo.score = (GameInfo.score + GameInfo.levelScore); soundMan.playSound(SoundID.BONUS_POINT); }; } private function showLevelResult():void{ if (profitLossValue < 0){ _resultMessageField.text = "Try Again (restart level)"; _resultMessageField.textColor = 0xFF0000; soundMan.playSound(SoundID.PENALTY); } else { _resultMessageField.text = "Well Done!"; _resultMessageField.textColor = 0xFF00; soundMan.playSound(SoundID.BONUS_POINT); }; } private function showTotalScore():void{ _captionsField.htmlText = (_captionsField.htmlText + "<font color='#00EDF6' size='24'>Total Score:</font><br>"); _valuesField.htmlText = (_valuesField.htmlText + (("<font color='#00EDF6' size='24'>" + String(GameInfo.score)) + "</font><br>")); soundMan.playSound(SoundID.PLACEBRICK_1); } private function showGoal():void{ _captionsField.htmlText = (_captionsField.htmlText + "Goal:<br>"); _valuesField.htmlText = (_valuesField.htmlText + (String(Levels.getGoal(GameInfo.level)) + "<br>")); soundMan.playSound(SoundID.PLACEBRICK_1); } private function showPowerupsBonus():void{ var powerupsBonus:int; powerupsBonus = (GameInfo.powerupCountSummary() * Constants.POWERUP_BONUS); _captionsField.htmlText = (_captionsField.htmlText + "<font color='#00FF00'>+ </font>Unused Powerups:<br>"); _valuesField.htmlText = (_valuesField.htmlText + (((((String(GameInfo.powerupCountSummary()) + " x ") + String(Constants.POWERUP_BONUS)) + " = ") + String(powerupsBonus)) + "<br>")); GameInfo.levelScore = (GameInfo.levelScore + powerupsBonus); if (powerupsBonus > 0){ soundMan.playSound(SoundID.BONUS_POINT); } else { soundMan.playSound(SoundID.PLACEBRICK_1); }; } private function showTimeBonus():void{ var timeBonus:int; _captionsField.htmlText = (_captionsField.htmlText + "Bonus<br>"); _valuesField.htmlText = (_valuesField.htmlText + "<br>"); timeBonus = (GameInfo.time * Constants.TIME_BONUS); _captionsField.htmlText = (_captionsField.htmlText + "<font color='#00FF00'>+ </font>Time Remaining:<br>"); _valuesField.htmlText = (_valuesField.htmlText + (((((String(GameInfo.time) + " secs x ") + String(Constants.TIME_BONUS)) + " = ") + String(timeBonus)) + "<br>")); GameInfo.levelScore = (GameInfo.levelScore + timeBonus); if (timeBonus > 0){ soundMan.playSound(SoundID.BONUS_POINT); } else { soundMan.playSound(SoundID.PLACEBRICK_1); }; } private function onAnimationFinishHandler(event:AnimationEvent):void{ dispatchEvent(new PopupEvent(PopupEvent.ANIMATION_COMPLETE, (profitLossValue >= 0))); } } }//package underConstruction.popups
Section 105
//PausePopup (underConstruction.popups.PausePopup) package underConstruction.popups { import gamework.sound.*; import gamework.ui.*; import flash.events.*; import underConstruction.views.*; import gamework.effects.*; import underConstruction.events.*; import underConstruction.data.*; public class PausePopup extends AbstractView { public var _mainMenuButton:TextButtonWidget; public var _switchSoundButton:TextButtonWidget; public var _resumeButton:TextButtonWidget; public var _restartLevelButton:TextButtonWidget; public function PausePopup(){ super(); visible = false; addChildren(_resumeButton, _restartLevelButton, _mainMenuButton, _switchSoundButton); _resumeButton.startBeacon(new BrightnessBeacon()); invalidate(); __setProp__restartLevelButton_PausePopup_Layer2_1(); __setProp__switchSoundButton_PausePopup_Layer2_1(); __setProp__mainMenuButton_PausePopup_Layer2_1(); __setProp__resumeButton_PausePopup_Layer2_1(); } function __setProp__mainMenuButton_PausePopup_Layer2_1(){ _mainMenuButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _mainMenuButton.alignment = "center"; _mainMenuButton.label = "Main Menu"; _mainMenuButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } function __setProp__restartLevelButton_PausePopup_Layer2_1(){ _restartLevelButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _restartLevelButton.alignment = "center"; _restartLevelButton.label = "Restart Level"; _restartLevelButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } override protected function draw():void{ addEventListener(MouseEvent.CLICK, onMouseClickHandler); if (GameInfo.soundOn){ _switchSoundButton.label = "Switch Sound Off"; } else { _switchSoundButton.label = "Switch Sound On"; }; visible = true; validate(); } function __setProp__resumeButton_PausePopup_Layer2_1(){ _resumeButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _resumeButton.alignment = "center"; _resumeButton.label = "Resume Playing"; _resumeButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } function __setProp__switchSoundButton_PausePopup_Layer2_1(){ _switchSoundButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _switchSoundButton.alignment = "center"; _switchSoundButton.label = ""; _switchSoundButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function onMouseClickHandler(event:MouseEvent):void{ var _local2:SoundManager; switch (event.target){ case _resumeButton: dispatchEvent(new PopupEvent(PopupEvent.CLOSE, PausePopupSelectedOption.RESUME)); break; case _mainMenuButton: dispatchEvent(new PopupEvent(PopupEvent.CLOSE, PausePopupSelectedOption.MAIN_MENU)); break; case _restartLevelButton: dispatchEvent(new PopupEvent(PopupEvent.CLOSE, PausePopupSelectedOption.RESTART)); break; case _switchSoundButton: _local2 = SoundManager.getInstance(); GameInfo.soundOn = !(GameInfo.soundOn); if (GameInfo.soundOn){ _local2.setChannelsVolume(1); _switchSoundButton.label = "Switch Sound Off"; } else { _local2.setChannelsVolume(0); _switchSoundButton.label = "Switch Sound On"; }; break; }; } } }//package underConstruction.popups
Section 106
//PausePopupSelectedOption (underConstruction.popups.PausePopupSelectedOption) package underConstruction.popups { public class PausePopupSelectedOption { public static const MAIN_MENU:String = "main_menu"; public static const RESUME:String = "resume"; public static const RESTART:String = "restart"; public function PausePopupSelectedOption(){ super(); } } }//package underConstruction.popups
Section 107
//PopupType (underConstruction.popups.PopupType) package underConstruction.popups { public class PopupType { public static const START_LEVEL:String = "start_level"; public static const HINT:String = "hint"; public static const PROMPT_CONTINUE_GAME:String = "prompt_continue_game"; public function PopupType(){ super(); } } }//package underConstruction.popups
Section 108
//PromptGameContinuePopup (underConstruction.popups.PromptGameContinuePopup) package underConstruction.popups { import gamework.ui.*; import flash.events.*; import underConstruction.views.*; import gamework.effects.*; import underConstruction.events.*; public class PromptGameContinuePopup extends AbstractView { public var _continueButton:TextButtonWidget; public var _newGameButton:TextButtonWidget; public function PromptGameContinuePopup(){ super(); visible = false; addChildren(_continueButton, _newGameButton); _continueButton.startBeacon(new BrightnessBeacon()); addEventListener(MouseEvent.CLICK, onMouseClickHandler); invalidate(); __setProp__continueButton_PromptGameContinuePopup_Layer2_1(); __setProp__newGameButton_PromptGameContinuePopup_Layer2_1(); } function __setProp__continueButton_PromptGameContinuePopup_Layer2_1(){ _continueButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _continueButton.alignment = "center"; _continueButton.label = "Continue"; _continueButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } override protected function draw():void{ visible = true; validate(); } function __setProp__newGameButton_PromptGameContinuePopup_Layer2_1(){ _newGameButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _newGameButton.alignment = "center"; _newGameButton.label = "Start New Game"; _newGameButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function onMouseClickHandler(event:MouseEvent):void{ switch (event.target){ case _continueButton: dispatchEvent(new PopupEvent(PopupEvent.CLOSE, false)); break; case _newGameButton: dispatchEvent(new PopupEvent(PopupEvent.CLOSE, true)); break; }; } } }//package underConstruction.popups
Section 109
//StartLevelPopup (underConstruction.popups.StartLevelPopup) package underConstruction.popups { import flash.text.*; import com.boostworthy.animation.sequence.tweens.*; import underConstruction.views.*; import com.boostworthy.events.*; import underConstruction.events.*; import underConstruction.data.*; import com.boostworthy.animation.rendering.*; import com.boostworthy.animation.sequence.*; public class StartLevelPopup extends AbstractView { public var _levelNameField:TextField; private var timeline:Timeline; public var _goalField:TextField; public var _levelNumField:TextField; public function StartLevelPopup(){ super(); _levelNumField.text = ("Building #" + String((GameInfo.level + 1))); _levelNameField.text = Levels.getName(GameInfo.level); _goalField.text = String(Levels.getGoal(GameInfo.level)); timeline = new Timeline(RenderMethod.ENTER_FRAME); timeline.addTween(new Tween(this, "alpha", 0, 50, 70)); timeline.addEventListener(AnimationEvent.FINISH, onAnimationFinishHandler); timeline.play(); } private function onAnimationFinishHandler(event:AnimationEvent):void{ timeline.removeEventListener(AnimationEvent.FINISH, onAnimationFinishHandler); timeline.dispose(); timeline = null; dispatchEvent(new PopupEvent(PopupEvent.CLOSE)); } } }//package underConstruction.popups
Section 110
//ChannelName (underConstruction.sound.ChannelName) package underConstruction.sound { public class ChannelName { public static const SFX:String = "sfx"; public static const MUSIC:String = "music"; public function ChannelName(){ super(); } } }//package underConstruction.sound
Section 111
//SoundID (underConstruction.sound.SoundID) package underConstruction.sound { public class SoundID { public static const PLACEBRICK_1:String = "placebrick_1"; public static const PLACEBRICK_2:String = "placebrick_2"; public static const PLACEBRICK_3:String = "placebrick_3"; public static const PLACEBRICK_4:String = "placebrick_4"; public static const IN_GAME_MUSIC:String = "in_game_music"; public static const ROTATE:String = "rotate"; public static const SELECT_BRICK:String = "select_brick"; public static const UI_BUTTON_PRESS:String = "ui_button_press"; public static const ADD_BRICK:String = "add_brick"; public static const SMASH_BRICK:String = "smash_brick"; public static const BRICK_DISPOSE:String = "brick_dispose"; public static const PENALTY:String = "penalty"; public static const BONUS_POINT:String = "bonus_point"; public function SoundID(){ super(); } } }//package underConstruction.sound
Section 112
//GameWonView (underConstruction.views.gameWon.GameWonView) package underConstruction.views.gameWon { import gamework.net.*; import gamework.ui.*; import flash.text.*; import flash.events.*; import underConstruction.views.*; import underConstruction.events.*; import underConstruction.data.*; import underConstruction.views.main.*; public class GameWonView extends AbstractView { public var _mainMenuButton:TextButtonWidget; public var _2DPlayButton:IconicButtonWidget; public var _finalScoreField:TextField; public var _submitScoreButton:TextButtonWidget; public function GameWonView(){ super(); addChildren(_mainMenuButton, _submitScoreButton, _2DPlayButton); _finalScoreField.text = ("Your Final Score: " + String(GameInfo.score)); addEventListener(MouseEvent.CLICK, onMouseEventHandler); __setProp__mainMenuButton_GameWonView_Layer2_1(); __setProp__submitScoreButton_GameWonView_Layer2_1(); } function __setProp__submitScoreButton_GameWonView_Layer2_1(){ _submitScoreButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _submitScoreButton.alignment = "left"; _submitScoreButton.label = "Submit Score"; _submitScoreButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } function __setProp__mainMenuButton_GameWonView_Layer2_1(){ _mainMenuButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _mainMenuButton.alignment = "right"; _mainMenuButton.label = "Main Menu"; _mainMenuButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function onMouseEventHandler(event:MouseEvent):void{ switch (event.target){ case _mainMenuButton: dispatchEvent(new ViewEvent(ViewEvent.COMPLETE, MainHSMEvent.GAME_QUIT)); break; case _submitScoreButton: URLCaller.submitScore(GameInfo.score); break; case _2DPlayButton: URLCaller.mainLink(); break; }; } } }//package underConstruction.views.gameWon
Section 113
//InstructionsView (underConstruction.views.instructions.InstructionsView) package underConstruction.views.instructions { import gamework.ui.*; import flash.events.*; import underConstruction.views.*; import gamework.effects.*; import underConstruction.events.*; import underConstruction.views.main.*; public class InstructionsView extends AbstractView { public var _mainMenuButton:TextButtonWidget; public function InstructionsView(){ super(); addChildren(_mainMenuButton); _mainMenuButton.startBeacon(new BrightnessBeacon()); addEventListener(MouseEvent.CLICK, onMouseEventHandler); __setProp__mainMenuButton_InstructionsView_Layer1_1(); } function __setProp__mainMenuButton_InstructionsView_Layer1_1(){ _mainMenuButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _mainMenuButton.alignment = "left"; _mainMenuButton.label = "Main Menu"; _mainMenuButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function onMouseEventHandler(event:MouseEvent):void{ switch (event.target){ case _mainMenuButton: dispatchEvent(new ViewEvent(ViewEvent.COMPLETE, MainHSMEvent.VIEW_CLOSE)); break; }; } } }//package underConstruction.views.instructions
Section 114
//EditorModelEvent (underConstruction.views.levelEditor.events.EditorModelEvent) package underConstruction.views.levelEditor.events { import flash.events.*; public class EditorModelEvent extends Event { private var _data; public static const FLOOR_DATA_CHANGED:String = "floor_data_changed"; public static const LEVEL_FLOOR_COUNT_CHANGED:String = "level_floor_count_changed"; public static const FLOOR_CLEARED:String = "floor_cleared"; public static const IMPORT_ERROR:String = "import_error"; public function EditorModelEvent(type:String, data=null){ super(type); _data = data; } public function get data(){ return (_data); } override public function toString():String{ return (formatToString("EditorModelEvent", "type")); } } }//package underConstruction.views.levelEditor.events
Section 115
//EditorField (underConstruction.views.levelEditor.EditorField) package underConstruction.views.levelEditor { import underConstruction.views.playField.*; import flash.display.*; import underConstruction.data.*; public class EditorField extends Sprite { private var tilesHolder:Sprite; public static const GRAY_1:uint = 0x7B7B7B; public static const GRAY_2:uint = 0x666666; public function EditorField(){ var i:int; var j:int; var tile:Shape; super(); tilesHolder = new Sprite(); i = 0; while (i < Constants.FIELD_HEIGHT) { j = 0; while (j < Constants.FIELD_WIDTH) { tile = new Shape(); tile.x = (j * Constants.FIELD_TILE_SIZE); tile.y = (i * Constants.FIELD_TILE_SIZE); tile.name = ((("tile_" + i) + "_") + j); tilesHolder.addChild(tile); j++; }; i++; }; addChildAt(tilesHolder, 0); } public function drawTile(tile:TileData):void{ var tileShape:Shape; var tileSize:int; var color:uint; tileShape = (tilesHolder.getChildByName(((("tile_" + tile.row) + "_") + tile.col)) as Shape); if (tile.value == -1){ tileShape.graphics.clear(); } else { tileSize = Constants.FIELD_TILE_SIZE; color = ((((tile.row + tile.col) % 2) == 0)) ? GRAY_1 : GRAY_2; tileShape.graphics.lineStyle(); tileShape.graphics.beginFill(color); tileShape.graphics.drawRect(0, 0, tileSize, tileSize); tileShape.graphics.endFill(); }; } private function removeAllGraphics():void{ } public function draw(data:Array):void{ var i:int; var tileValue:int; var row:int; var col:int; i = 0; while (i < Constants.FIELD_NUM_TILES) { tileValue = data[i]; row = Math.floor((i / Constants.FIELD_WIDTH)); col = (i % Constants.FIELD_WIDTH); drawTile(new TileData(row, col, data[i])); i++; }; } } }//package underConstruction.views.levelEditor
Section 116
//EditorModel (underConstruction.views.levelEditor.EditorModel) package underConstruction.views.levelEditor { import underConstruction.views.playField.*; import flash.events.*; import underConstruction.views.levelEditor.events.*; import underConstruction.data.*; public class EditorModel extends EventDispatcher { private var levelProps:Array; private var _currentLevel:int; private var _currentFloor:int; private var levelsData:Array; private var _lastPressedTile:TileData; public function EditorModel(){ super(); Levels.loadCustomLevels(); _currentLevel = Levels.lastEditedLevel; _currentFloor = Levels.lastEditedFloor; levelsData = Levels.customLevelsData; levelProps = Levels.customLevelsProps; } public function get currentLevel():int{ return (_currentLevel); } public function setLevelProps(props:Object):void{ if (_currentLevel != -1){ levelProps[_currentLevel] = props; }; } public function saveLevels():void{ Levels.saveCustomLevels(levelsData, levelProps, _currentLevel, _currentFloor); } public function importLevels(code:String):void{ var level:XML; var xml:XML; var props:Object; var singleLevelData:Array; var floor:XML; var code = code; xml = XML(code); if (xml.name() != "levels"){ throw (new Error("Export string seems to be wrong.")); }; //unresolved jump var _slot1 = error; dispatchEvent(new EditorModelEvent(EditorModelEvent.IMPORT_ERROR, _slot1.message)); levelsData = new Array(); levelProps = new Array(); for each (level in xml.children()) { props = {name:String(level.@name), goal:int(level.@goal), time:int(level.@time)}; levelProps.push(props); singleLevelData = new Array(); for each (floor in level.children()) { singleLevelData.push(decodeFloor(floor.toString())); }; levelsData.push(singleLevelData); }; _currentLevel = 0; _currentFloor = 0; saveLevels(); dispatchEvent(new EditorModelEvent(EditorModelEvent.LEVEL_FLOOR_COUNT_CHANGED)); } public function deleteLevel():void{ if (_currentLevel != -1){ levelsData.splice(_currentLevel, 1); levelProps.splice(_currentLevel, 1); if (_currentLevel == numCustomLevels){ _currentLevel = (numCustomLevels - 1); }; if (_currentLevel == -1){ _currentFloor = -1; }; dispatchEvent(new EditorModelEvent(EditorModelEvent.LEVEL_FLOOR_COUNT_CHANGED)); }; } public function get currentFloor():int{ return (_currentFloor); } public function mouseDownMoved(mouseX:int, mouseY:int):void{ var col:Number; var row:Number; if (_currentLevel < 0){ return; }; col = Math.floor((mouseX / Constants.FIELD_TILE_SIZE)); row = Math.floor((mouseY / Constants.FIELD_TILE_SIZE)); if ((((((((col < 0)) || ((col > (Constants.FIELD_WIDTH - 1))))) || ((row < 0)))) || ((row > (Constants.FIELD_HEIGHT - 1))))){ return; }; if (((_lastPressedTile) && (((!((_lastPressedTile.row == row))) || (!((_lastPressedTile.col == col))))))){ toggleTileValue(row, col); }; } public function get currentFloorData():Array{ return (((levelsData.length > 0)) ? levelsData[_currentLevel][_currentFloor].slice() : null); } public function get numCustomFloors():int{ return (levelsData[_currentLevel].length); } public function deleteFloor():void{ var level:Array; if (((!((_currentLevel == -1))) && ((numCustomFloors > 1)))){ level = levelsData[_currentLevel]; level.splice(_currentFloor, 1); if (_currentFloor == level.length){ _currentFloor = (level.length - 1); }; dispatchEvent(new EditorModelEvent(EditorModelEvent.LEVEL_FLOOR_COUNT_CHANGED)); }; } public function addLevel():void{ if (numCustomLevels < Constants.MAX_CUSTOM_LEVELS){ levelsData.push([]); levelProps.push(Levels.newLevelProps); _currentLevel = (numCustomLevels - 1); _currentFloor = 0; addFloor(); dispatchEvent(new EditorModelEvent(EditorModelEvent.LEVEL_FLOOR_COUNT_CHANGED)); }; } public function get currentLevelProps():Object{ if (!levelProps[_currentLevel]){ levelProps[_currentLevel] = Levels.newLevelProps; }; return (levelProps[_currentLevel]); } public function get numCustomLevels():int{ return (levelsData.length); } public function mouseDown(mouseX:int, mouseY:int):void{ var col:Number; var row:Number; if (_currentLevel < 0){ return; }; col = Math.floor((mouseX / Constants.FIELD_TILE_SIZE)); row = Math.floor((mouseY / Constants.FIELD_TILE_SIZE)); if ((((((((col < 0)) || ((col > (Constants.FIELD_WIDTH - 1))))) || ((row < 0)))) || ((row > (Constants.FIELD_HEIGHT - 1))))){ return; }; toggleTileValue(row, col); } public function selectLevel(dIndex:int):void{ var nextLevelIndex:int; if (_currentLevel == -1){ return; }; nextLevelIndex = (_currentLevel + dIndex); if ((((nextLevelIndex >= 0)) && ((nextLevelIndex < numCustomLevels)))){ _currentLevel = (_currentLevel + dIndex); _currentFloor = 0; dispatchEvent(new EditorModelEvent(EditorModelEvent.LEVEL_FLOOR_COUNT_CHANGED)); }; } public function addFloor():void{ if (_currentLevel == -1){ addLevel(); } else { if (numCustomFloors < Constants.MAX_CUSTOM_FLOORS){ levelsData[_currentLevel].push(Levels.newEmptyFloorData); _currentFloor = (numCustomFloors - 1); dispatchEvent(new EditorModelEvent(EditorModelEvent.LEVEL_FLOOR_COUNT_CHANGED)); }; }; } public function getASCode():String{ var levelsDataString:String; var levelsPropsString:String; var i:int; var props:Object; var data:Array; var j:int; levelsDataString = "private static var levelsData:Array = ["; levelsPropsString = "private static var levelsProps:Array = ["; i = 0; while (i < levelsData.length) { props = levelProps[i]; data = levelsData[i]; levelsDataString = (levelsDataString + (("\n//Level: " + (i + 1)) + "\n[")); j = 0; while (j < data.length) { levelsDataString = (levelsDataString + (("[" + data[j].toString()) + "],\n")); j++; }; levelsDataString = (levelsDataString + "],\n"); levelsPropsString = (levelsPropsString + (((((("\n{name:\"" + props.name) + "\", goal:\"") + props.goal) + "\", time:\"") + props.time) + "\"},")); i++; }; return ((((levelsDataString + "];\n\n") + levelsPropsString) + "\n];\n")); } private function encodeFloor(floorData:Array):String{ var floorNumericData:Array; var numElements:int; var bitIndex:int; var n:int; var i:int; floorNumericData = new Array(); numElements = floorData.length; bitIndex = (Constants.FIELD_WIDTH - 1); n = 0; i = 0; while (i < numElements) { if (floorData[i] == 0){ n = (n + (1 << bitIndex)); }; --bitIndex; if (bitIndex < 0){ floorNumericData.push(n); n = 0; bitIndex = (Constants.FIELD_WIDTH - 1); }; i++; }; return (floorNumericData.toString()); } private function toggleTileValue(row:int, col:int):void{ var index:int; var value:int; index = ((row * Constants.FIELD_WIDTH) + col); value = ((levelsData[_currentLevel][_currentFloor][index] == 0)) ? -1 : 0; levelsData[_currentLevel][_currentFloor][index] = value; _lastPressedTile = new TileData(row, col, value); dispatchEvent(new EditorModelEvent(EditorModelEvent.FLOOR_DATA_CHANGED, _lastPressedTile.clone())); } public function selectFloor(dIndex:int):void{ var nextFloorIndex:int; if (_currentFloor == -1){ return; }; nextFloorIndex = (_currentFloor + dIndex); if ((((nextFloorIndex >= 0)) && ((nextFloorIndex < numCustomFloors)))){ _currentFloor = (_currentFloor + dIndex); dispatchEvent(new EditorModelEvent(EditorModelEvent.LEVEL_FLOOR_COUNT_CHANGED)); }; } public function getExportCode():String{ var xml:XML; var i:int; var props:Object; var data:Array; var levelXML:XML; var j:int; xml = <levels/> ; i = 0; while (i < levelsData.length) { props = levelProps[i]; data = levelsData[i]; levelXML = new XML((((((("<level name=\"" + ??esc_xattr ) + "\" goal=\"") + ??esc_xattr ) + "\" time=\"") + ??esc_xattr ) + "\"/>")); j = 0; while (j < data.length) { levelXML.appendChild(new XML((("<floor>" + ??esc_xelem ) + "</floor>"))); j++; }; xml.appendChild(levelXML); i++; }; return (xml.toXMLString()); } private function decodeFloor(floorString:String):Array{ var floorData:Array; var lines:Array; var rowsNum:int; var colsNum:int; var i:int; var n:int; var j:int; floorData = new Array(); lines = floorString.split(","); rowsNum = Constants.FIELD_HEIGHT; colsNum = Constants.FIELD_WIDTH; i = 0; while (i < rowsNum) { n = int(lines[i]); j = (colsNum - 1); while (j >= 0) { floorData.push(((((1 << j) & n) == 0)) ? -1 : 0); j--; }; i++; }; return (floorData); } public function clearFloor():void{ if (_currentLevel != -1){ levelsData[_currentLevel][_currentFloor] = Levels.newEmptyFloorData; dispatchEvent(new EditorModelEvent(EditorModelEvent.FLOOR_CLEARED)); }; } } }//package underConstruction.views.levelEditor
Section 117
//LevelEditorView (underConstruction.views.levelEditor.LevelEditorView) package underConstruction.views.levelEditor { import gamework.ui.*; import flash.text.*; import flash.events.*; import underConstruction.views.*; import underConstruction.views.levelEditor.events.*; import underConstruction.events.*; import underConstruction.views.main.*; public class LevelEditorView extends AbstractView { public var _levelCodeField:TextField; public var _mainMenuButton:TextButtonWidget; public var _clearFloorButton:TextButtonWidget; public var _levelNameField:TextField; private var fieldSprite:EditorField; public var _importLevelsButton:TextButtonWidget; public var _showCodeButton:TextButtonWidget; public var _levelLeftButton:IconicFramedButtonWidget; public var _addLevelButton:TextButtonWidget; public var _levelRightButton:IconicFramedButtonWidget; public var _levelGoalField:TextField; public var _deleteLevelButton:TextButtonWidget; public var _levelTextField:TextField; public var _floorLeftButton:IconicFramedButtonWidget; public var _addFloorButton:TextButtonWidget; private var model:EditorModel; public var _playButton:TextButtonWidget; public var _showASCodeButton:TextButtonWidget; public var _levelTimeField:TextField; public var _floorRightButton:IconicFramedButtonWidget; public var _deleteFloorButton:TextButtonWidget; public var _floorTextField:TextField; private var mousePressed:Boolean;// = false public static const FIELD_X:int = 20; public static const FIELD_Y:int = 60; public function LevelEditorView(){ mousePressed = false; super(); addChildren(_playButton, _mainMenuButton, _addLevelButton, _deleteLevelButton, _addFloorButton, _deleteFloorButton, _clearFloorButton, _levelLeftButton, _levelRightButton, _floorLeftButton, _floorRightButton); addEventListener(MouseEvent.CLICK, onMouseEventHandler); model = new EditorModel(); model.addEventListener(EditorModelEvent.LEVEL_FLOOR_COUNT_CHANGED, onModelEventHandler); model.addEventListener(EditorModelEvent.FLOOR_DATA_CHANGED, onModelEventHandler); model.addEventListener(EditorModelEvent.FLOOR_CLEARED, onModelEventHandler); model.addEventListener(EditorModelEvent.IMPORT_ERROR, onModelEventHandler); fieldSprite = new EditorField(); fieldSprite.x = FIELD_X; fieldSprite.y = FIELD_Y; addChild(fieldSprite); configureUI(); addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler); addEventListener(MouseEvent.MOUSE_UP, onMouseUpHandler); addEventListener(MouseEvent.MOUSE_MOVE, onMouseMoveHandler); addEventListener(Event.CHANGE, onChangeHandler); __setProp__deleteLevelButton_LevelEditorView_Layer1_1(); __setProp__addLevelButton_LevelEditorView_Layer1_1(); __setProp__playButton_LevelEditorView_Layer1_1(); __setProp__showASCodeButton_LevelEditorView_Layer1_1(); __setProp__deleteFloorButton_LevelEditorView_Layer1_1(); __setProp__mainMenuButton_LevelEditorView_Layer1_1(); __setProp__addFloorButton_LevelEditorView_Layer1_1(); __setProp__showCodeButton_LevelEditorView_Layer1_1(); __setProp__clearFloorButton_LevelEditorView_Layer1_1(); __setProp__importLevelsButton_LevelEditorView_Layer1_1(); } function __setProp__addLevelButton_LevelEditorView_Layer1_1(){ _addLevelButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _addLevelButton.alignment = "center"; _addLevelButton.label = "Add Level"; _addLevelButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } function __setProp__mainMenuButton_LevelEditorView_Layer1_1(){ _mainMenuButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _mainMenuButton.alignment = "center"; _mainMenuButton.label = "Main Menu"; _mainMenuButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function onMouseMoveHandler(event:MouseEvent):void{ if (mousePressed){ model.mouseDownMoved((event.stageX - FIELD_X), (event.stageY - FIELD_Y)); }; } function __setProp__importLevelsButton_LevelEditorView_Layer1_1(){ _importLevelsButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _importLevelsButton.alignment = "center"; _importLevelsButton.label = "Import levels"; _importLevelsButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function onMouseDownHandler(event:MouseEvent):void{ mousePressed = true; model.mouseDown((event.stageX - FIELD_X), (event.stageY - FIELD_Y)); } private function onMouseEventHandler(event:MouseEvent):void{ switch (event.target){ case _playButton: model.saveLevels(); dispatchEvent(new ViewEvent(ViewEvent.COMPLETE, MainHSMEvent.GAME_START)); break; case _mainMenuButton: model.saveLevels(); dispatchEvent(new ViewEvent(ViewEvent.COMPLETE, MainHSMEvent.GAME_QUIT)); break; case _addLevelButton: model.addLevel(); break; case _deleteLevelButton: model.deleteLevel(); break; case _addFloorButton: model.addFloor(); break; case _deleteFloorButton: model.deleteFloor(); break; case _clearFloorButton: model.clearFloor(); break; case _levelLeftButton: model.selectLevel(-1); break; case _levelRightButton: model.selectLevel(1); break; case _floorLeftButton: model.selectFloor(-1); break; case _floorRightButton: model.selectFloor(1); break; case _showCodeButton: _levelCodeField.text = model.getExportCode(); break; case _importLevelsButton: model.importLevels(_levelCodeField.text); break; case _showASCodeButton: _levelCodeField.text = model.getASCode(); break; }; } function __setProp__addFloorButton_LevelEditorView_Layer1_1(){ _addFloorButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _addFloorButton.alignment = "center"; _addFloorButton.label = "Add Floor"; _addFloorButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } function __setProp__deleteLevelButton_LevelEditorView_Layer1_1(){ _deleteLevelButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _deleteLevelButton.alignment = "center"; _deleteLevelButton.label = "Delete Level"; _deleteLevelButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function onMouseUpHandler(event:MouseEvent):void{ mousePressed = false; } private function onModelEventHandler(event:EditorModelEvent):void{ var _local2:Array; switch (event.type){ case EditorModelEvent.LEVEL_FLOOR_COUNT_CHANGED: configureUI(); break; case EditorModelEvent.FLOOR_DATA_CHANGED: fieldSprite.drawTile(event.data); break; case EditorModelEvent.FLOOR_CLEARED: _local2 = model.currentFloorData; if (_local2){ fieldSprite.draw(_local2); }; break; case EditorModelEvent.IMPORT_ERROR: _levelCodeField.text = (event.data as String); break; }; } function __setProp__showASCodeButton_LevelEditorView_Layer1_1(){ _showASCodeButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _showASCodeButton.alignment = "center"; _showASCodeButton.label = "Show AS code"; _showASCodeButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } function __setProp__deleteFloorButton_LevelEditorView_Layer1_1(){ _deleteFloorButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _deleteFloorButton.alignment = "center"; _deleteFloorButton.label = "Delete Floor"; _deleteFloorButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } function __setProp__clearFloorButton_LevelEditorView_Layer1_1(){ _clearFloorButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _clearFloorButton.alignment = "center"; _clearFloorButton.label = "Clear Floor"; _clearFloorButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } function __setProp__playButton_LevelEditorView_Layer1_1(){ _playButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _playButton.alignment = "center"; _playButton.label = "Play"; _playButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function onChangeHandler(event:Event):void{ var _local2:Object; switch (event.target){ case _levelNameField: case _levelGoalField: case _levelTimeField: _local2 = {name:_levelNameField.text, goal:int(_levelGoalField.text), time:int(_levelTimeField.text)}; model.setLevelProps(_local2); break; }; } function __setProp__showCodeButton_LevelEditorView_Layer1_1(){ _showCodeButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _showCodeButton.alignment = "center"; _showCodeButton.label = "Show export code"; _showCodeButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function configureUI():void{ var currentFloorData:Array; var levelProps:Object; if (model.numCustomLevels == 0){ _levelTextField.text = "No levels"; _floorTextField.text = "No floors"; _levelNameField.visible = false; _levelGoalField.visible = false; _levelTimeField.visible = false; } else { _levelTextField.text = ((("Level " + String((model.currentLevel + 1))) + "/") + model.numCustomLevels); _floorTextField.text = ((("Floor " + String((model.currentFloor + 1))) + "/") + model.numCustomFloors); _levelNameField.visible = true; _levelGoalField.visible = true; _levelTimeField.visible = true; levelProps = model.currentLevelProps; _levelNameField.text = levelProps.name; _levelGoalField.text = levelProps.goal; _levelTimeField.text = levelProps.time; }; currentFloorData = model.currentFloorData; if (currentFloorData){ fieldSprite.draw(currentFloorData); }; } } }//package underConstruction.views.levelEditor
Section 118
//Building (underConstruction.views.levelEnd.Building) package underConstruction.views.levelEnd { import flash.display.*; import flash.filters.*; import underConstruction.data.*; import flash.errors.*; public class Building extends Sprite { private var _rowsCount:int;// = 0 public static const BRICK_SIZE:int = 30; public function Building(){ _rowsCount = 0; super(); } override public function get height():Number{ return (((_rowsCount * BRICK_SIZE) * scaleY)); } public function drawFloors(data:Array):void{ var fieldWidth:int; var fieldHeight:int; var floor:Array; var i:int; var rowArray:Array; var rowEmpty:Boolean; var j:int; var tileValue:int; var brick:BuildingBrick; fieldWidth = Constants.FIELD_WIDTH; fieldHeight = Constants.FIELD_HEIGHT; while (data.length > 0) { floor = data.pop(); i = 0; while (i < fieldHeight) { rowArray = floor.slice((i * fieldWidth), ((i * fieldWidth) + fieldWidth)); rowEmpty = true; j = 0; while (j < fieldWidth) { if (rowArray[j] != -1){ rowEmpty = false; break; }; j++; }; if (!rowEmpty){ j = 0; while (j < fieldWidth) { tileValue = floor[((i * fieldWidth) + j)]; if (tileValue != -1){ brick = new BuildingBrick(); brick.gotoAndStop((tileValue + 1)); brick.x = (j * BRICK_SIZE); brick.y = (_rowsCount * BRICK_SIZE); addChild(brick); }; j++; }; _rowsCount++; }; i++; }; }; this.filters = [new GlowFilter(0, 1, 4, 4, 5), new DropShadowFilter(4, 45, 0, 1, 8, 8)]; } override public function set height(value:Number):void{ throw (new IllegalOperationError("Method not supported")); } override public function set width(value:Number):void{ throw (new IllegalOperationError("Method not supported")); } override public function get width():Number{ var w:Number; w = ((Constants.FIELD_WIDTH * BRICK_SIZE) * scaleX); return (w); } } }//package underConstruction.views.levelEnd
Section 119
//LevelEndView (underConstruction.views.levelEnd.LevelEndView) package underConstruction.views.levelEnd { import flash.display.*; import gamework.net.*; import gamework.ui.*; import flash.events.*; import underConstruction.views.*; import gamework.effects.*; import underConstruction.events.*; import underConstruction.data.*; import underConstruction.popups.*; import underConstruction.views.main.*; import gamework.application.*; public class LevelEndView extends AbstractView { public var _mainMenuButton:TextButtonWidget; public var _2DPlayButton:IconicButtonWidget; public var _continueGameButton:TextButtonWidget; private var buildingSprite:Building; public var _backgroundClip:MovieClip; public var _submitScoreButton:TextButtonWidget; public var _restartLevelButton:TextButtonWidget; public function LevelEndView(){ var _backgroundFrame:int; var buildingScale:Number; super(); _backgroundFrame = ((GameInfo.level % _backgroundClip.totalFrames) + 1); _backgroundClip.gotoAndStop(_backgroundFrame); addChildren(_mainMenuButton, _continueGameButton, _restartLevelButton, _submitScoreButton, _2DPlayButton); buildingSprite = new Building(); buildingSprite.drawFloors(GameInfo.completedFloors); buildingScale = (450 / buildingSprite.height); if (buildingScale < 1){ buildingSprite.scaleX = (buildingSprite.scaleY = buildingScale); }; buildingSprite.x = ((ApplicationGlobals.WIDTH - buildingSprite.width) / 2); buildingSprite.y = (480 - buildingSprite.height); addChildAt(buildingSprite, 1); _mainMenuButton.visible = (_continueGameButton.visible = (_restartLevelButton.visible = (_submitScoreButton.visible = (_2DPlayButton.visible = false)))); popup = new LevelScorePopup(); popup.addEventListener(PopupEvent.ANIMATION_COMPLETE, onPopupAnimationCompleteHandler); addChild(popup); addEventListener(MouseEvent.CLICK, onMouseEventHandler); __setProp__mainMenuButton_LevelEndView_Layer2_1(); __setProp__submitScoreButton_LevelEndView_Layer2_1(); __setProp__restartLevelButton_LevelEndView_Layer2_1(); __setProp__continueGameButton_LevelEndView_Layer3_1(); } function __setProp__mainMenuButton_LevelEndView_Layer2_1(){ _mainMenuButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _mainMenuButton.alignment = "right"; _mainMenuButton.label = "Main Menu"; _mainMenuButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } function __setProp__restartLevelButton_LevelEndView_Layer2_1(){ _restartLevelButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _restartLevelButton.alignment = "left"; _restartLevelButton.label = "Restart Level"; _restartLevelButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } override public function dispose():void{ removeChild(buildingSprite); buildingSprite = null; super.dispose(); } private function updateCurrentLevel():void{ var soMan:SOManager; GameInfo.level++; if (GameInfo.level == Levels.getNumLevels()){ GameInfo.level = 0; }; soMan = SOManager.getInstance(); soMan.setValue(SOValues.LEVEL_REACHED, GameInfo.level); soMan.setValue(SOValues.SCORE_REACHED, GameInfo.score); } function __setProp__submitScoreButton_LevelEndView_Layer2_1(){ _submitScoreButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _submitScoreButton.alignment = "center"; _submitScoreButton.label = "Submit Score"; _submitScoreButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } function __setProp__continueGameButton_LevelEndView_Layer3_1(){ _continueGameButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _continueGameButton.alignment = "left"; _continueGameButton.label = "Continue"; _continueGameButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function onMouseEventHandler(event:MouseEvent):void{ switch (event.target){ case _mainMenuButton: dispatchEvent(new ViewEvent(ViewEvent.COMPLETE, MainHSMEvent.GAME_QUIT)); break; case _continueGameButton: if (GameInfo.level == 0){ dispatchEvent(new ViewEvent(ViewEvent.COMPLETE, MainHSMEvent.GAME_COMPLETE)); } else { dispatchEvent(new ViewEvent(ViewEvent.COMPLETE, MainHSMEvent.GAME_START)); }; break; case _restartLevelButton: dispatchEvent(new ViewEvent(ViewEvent.COMPLETE, MainHSMEvent.GAME_START)); break; case _submitScoreButton: URLCaller.submitScore(GameInfo.score); break; case _2DPlayButton: URLCaller.mainLink(); break; }; } private function onPopupAnimationCompleteHandler(event:PopupEvent):void{ _submitScoreButton.visible = (_2DPlayButton.visible = true); if (event.data == false){ _restartLevelButton.startBeacon(new BrightnessBeacon()); _restartLevelButton.visible = true; _mainMenuButton.visible = true; } else { updateCurrentLevel(); _continueGameButton.startBeacon(new BrightnessBeacon()); _continueGameButton.visible = true; if (GameInfo.level != 0){ _mainMenuButton.visible = true; }; }; } } }//package underConstruction.views.levelEnd
Section 120
//MainHSMEvent (underConstruction.views.main.MainHSMEvent) package underConstruction.views.main { public class MainHSMEvent { public static const GAME_QUIT:String = "game_quit"; public static const GAME_COMPLETE:String = "game_complete"; public static const INSTRUCTIONS_START:String = "instructions_start"; public static const GAME_RESTART:String = "game_restart"; public static const LEVEL_EDITOR_START:String = "level_editor_start"; public static const INITIALIZE:String = "initialize"; public static const LEVEL_COMPLETE:String = "level_complete"; public static const GAME_START:String = "game_start"; public static const VIEW_CLOSE:String = "view_close"; public function MainHSMEvent(){ super(); } } }//package underConstruction.views.main
Section 121
//MainHSMState (underConstruction.views.main.MainHSMState) package underConstruction.views.main { public class MainHSMState { public static const LEVEL_END:String = "level_end"; public static const INSTRUCTIONS:String = "instructions"; public static const LEVEL_EDITOR:String = "level_editor"; public static const GAME_WON:String = "game_won"; public static const MAIN_MENU:String = "main_menu"; public static const PLAYING:String = "playing"; public static const GAME:String = "game"; public static const PLAYING_CUSTOM_LEVEL:String = "playing_custom_level"; public static const GAME_INITIAL:String = "game_initial"; public static const MAIN_INITIAL:String = "main_initial"; public function MainHSMState(){ super(); } } }//package underConstruction.views.main
Section 122
//MainView (underConstruction.views.main.MainView) package underConstruction.views.main { import underConstruction.views.playField.*; import gamework.sound.*; import gamework.net.*; import gamework.ui.*; import flash.events.*; import underConstruction.views.*; import gamework.statemachine.hsm.*; import com.boostworthy.utils.logger.*; import flash.filters.*; import gamework.events.*; import gamework.effects.*; import underConstruction.events.*; import gamework.display.*; import underConstruction.data.*; import gamework.ui.styles.*; import underConstruction.sound.*; import com.boostworthy.core.*; import underConstruction.views.levelEditor.*; import underConstruction.views.levelEnd.*; import underConstruction.views.gameWon.*; import underConstruction.views.instructions.*; import underConstruction.views.mainMenu.*; public class MainView extends AbstractView { private var stateMachine:HSM; private var pendingHSMEvent:String; private var blackoutTransition:BlackoutTransition; private var soundMan:SoundManager; public function MainView(){ super(); addEventListener(Event.ADDED_TO_STAGE, onAddedToStageHandler); } private function showMainMenuView():void{ removeSubview(); subview = new MainMenuView(); subview.addEventListener(ViewEvent.COMPLETE, onSubviewEventHandler); addChild(subview); } private function showInstructionsView():void{ removeSubview(); subview = new InstructionsView(); subview.addEventListener(ViewEvent.COMPLETE, onSubviewEventHandler); addChild(subview); } private function initializeManagers():void{ var soMan:SOManager; var textButtonDecoration:FilterDecoration; var iconicButtonDecoration:FilterDecoration; soMan = SOManager.getInstance(); if (soMan.dataEmpty){ soMan.setValue(SOValues.SHOW_HINTS, true); soMan.setValue(SOValues.LEVEL_REACHED, 0); soMan.setValue(SOValues.SCORE_REACHED, 0); }; soundMan = SoundManager.getInstance(); soundMan.registerSoundRecord(SoundID.IN_GAME_MUSIC, InGameMusic, ChannelName.MUSIC); soundMan.registerSoundRecord(SoundID.ADD_BRICK, AddBrick, ChannelName.SFX); soundMan.registerSoundRecord(SoundID.BONUS_POINT, BonusPoint, ChannelName.SFX); soundMan.registerSoundRecord(SoundID.PENALTY, Penalty, ChannelName.SFX); soundMan.registerSoundRecord(SoundID.PLACEBRICK_1, PlaceBrick_1, ChannelName.SFX); soundMan.registerSoundRecord(SoundID.PLACEBRICK_2, PlaceBrick_2, ChannelName.SFX); soundMan.registerSoundRecord(SoundID.PLACEBRICK_3, PlaceBrick_3, ChannelName.SFX); soundMan.registerSoundRecord(SoundID.PLACEBRICK_4, PlaceBrick_4, ChannelName.SFX); soundMan.registerSoundRecord(SoundID.ROTATE, Rotate, ChannelName.SFX); soundMan.registerSoundRecord(SoundID.SELECT_BRICK, SelectBrick, ChannelName.SFX); soundMan.registerSoundRecord(SoundID.SMASH_BRICK, SmashBrick, ChannelName.SFX); soundMan.registerSoundRecord(SoundID.UI_BUTTON_PRESS, UIButtonPress, ChannelName.SFX); soundMan.registerSoundRecord(SoundID.BRICK_DISPOSE, BrickDispose, ChannelName.SFX); StyleManager.setSharedStyle(TextButtonWidget, TextButtonStyle.UP_STATE_COLOR, 3118589); StyleManager.setSharedStyle(TextButtonWidget, TextButtonStyle.OVER_STATE_COLOR, 0xFFCC00); StyleManager.setSharedStyle(TextButtonWidget, TextButtonStyle.DOWN_STATE_COLOR, 0xCC9900); StyleManager.setSharedStyle(AbstractButtonWidget, AbstractButtonStyle.MOUSE_DOWN_HANDLER, onMouseDownGlobalHandler); StyleManager.setSharedStyle(AbstractWidget, AbstractWidgetStyle.DISABLED_ALPHA, 1); textButtonDecoration = new FilterDecoration(new GlowFilter(0, 1, 4, 4, 5), new DropShadowFilter(5, 45, 0, 1, 4, 4, 0.5)); StyleManager.setSharedStyle(TextButtonWidget, AbstractWidgetStyle.DECORATION, textButtonDecoration); iconicButtonDecoration = new FilterDecoration(new DropShadowFilter(5, 45, 0, 1, 4, 4, 0.5)); StyleManager.setSharedStyle(IconicButtonWidget, AbstractWidgetStyle.DECORATION, iconicButtonDecoration); soundMan.playSound(SoundID.IN_GAME_MUSIC, int.MAX_VALUE); } private function onTransitionPeakHandler(event:BlackoutTransitionEvent):void{ stateMachine.sendSignalEvent(pendingHSMEvent); } private function onMouseDownGlobalHandler(btn:AbstractButtonWidget):void{ soundMan.playSound(SoundID.UI_BUTTON_PRESS); } private function onAddedToStageHandler(event:Event):void{ removeEventListener(Event.ADDED_TO_STAGE, onAddedToStageHandler); Global.stage = stage; LogFactory.getInstance().getLog("Boostworthy Animation System").setLevel(0); stateMachine = new HSM("MainView HSM"); stateMachine.addState(new InitialState(MainHSMState.MAIN_INITIAL, null)); stateMachine.addState(new CompositeState(MainHSMState.MAIN_MENU, null, showMainMenuView)); stateMachine.addState(new CompositeState(MainHSMState.INSTRUCTIONS, null, showInstructionsView)); stateMachine.addState(new CompositeState(MainHSMState.GAME, null)); stateMachine.addState(new InitialState(MainHSMState.GAME_INITIAL, MainHSMState.GAME)); stateMachine.addState(new CompositeState(MainHSMState.PLAYING, MainHSMState.GAME, showPlayField)); stateMachine.addState(new CompositeState(MainHSMState.LEVEL_END, MainHSMState.GAME, showLevelEndView)); stateMachine.addState(new CompositeState(MainHSMState.GAME_WON, MainHSMState.GAME, showGameWonView)); stateMachine.addState(new CompositeState(MainHSMState.LEVEL_EDITOR, null, showLevelEditor)); stateMachine.addState(new CompositeState(MainHSMState.PLAYING_CUSTOM_LEVEL, null, showCustomLevelPlayField)); stateMachine.addTransition(MainHSMState.MAIN_INITIAL, MainHSMState.MAIN_MENU, null, initializeManagers); stateMachine.addTransition(MainHSMState.MAIN_MENU, MainHSMState.INSTRUCTIONS, new SignalEvent(MainHSMEvent.INSTRUCTIONS_START)); stateMachine.addTransition(MainHSMState.INSTRUCTIONS, MainHSMState.MAIN_MENU, new SignalEvent(MainHSMEvent.VIEW_CLOSE)); stateMachine.addTransition(MainHSMState.MAIN_MENU, MainHSMState.GAME, new SignalEvent(MainHSMEvent.GAME_START)); stateMachine.addTransition(MainHSMState.GAME, MainHSMState.MAIN_MENU, new SignalEvent(MainHSMEvent.GAME_QUIT)); stateMachine.addTransition(MainHSMState.MAIN_MENU, MainHSMState.LEVEL_EDITOR, new SignalEvent(MainHSMEvent.LEVEL_EDITOR_START)); stateMachine.addTransition(MainHSMState.LEVEL_EDITOR, MainHSMState.PLAYING_CUSTOM_LEVEL, new SignalEvent(MainHSMEvent.GAME_START)); stateMachine.addTransition(MainHSMState.PLAYING_CUSTOM_LEVEL, MainHSMState.LEVEL_EDITOR, new SignalEvent(MainHSMEvent.GAME_COMPLETE)); stateMachine.addTransition(MainHSMState.LEVEL_EDITOR, MainHSMState.MAIN_MENU, new SignalEvent(MainHSMEvent.GAME_QUIT)); stateMachine.addTransition(MainHSMState.GAME_INITIAL, MainHSMState.PLAYING); stateMachine.addTransition(MainHSMState.PLAYING, MainHSMState.LEVEL_END, new SignalEvent(MainHSMEvent.LEVEL_COMPLETE)); stateMachine.addTransition(MainHSMState.PLAYING, MainHSMState.PLAYING, new SignalEvent(MainHSMEvent.GAME_RESTART)); stateMachine.addTransition(MainHSMState.LEVEL_END, MainHSMState.PLAYING, new SignalEvent(MainHSMEvent.GAME_START)); stateMachine.addTransition(MainHSMState.LEVEL_END, MainHSMState.GAME_WON, new SignalEvent(MainHSMEvent.GAME_COMPLETE)); stateMachine.start(); } private function showCustomLevelPlayField():void{ removeSubview(); subview = new CustomGameView(); subview.addEventListener(ViewEvent.COMPLETE, onSubviewEventHandler); addChild(subview); } private function showLevelEndView():void{ removeSubview(); subview = new LevelEndView(); subview.addEventListener(ViewEvent.COMPLETE, onSubviewEventHandler); addChild(subview); } private function showPlayField():void{ removeSubview(); subview = new GameView(); subview.addEventListener(ViewEvent.COMPLETE, onSubviewEventHandler); addChild(subview); } private function showGameWonView():void{ removeSubview(); subview = new GameWonView(); subview.addEventListener(ViewEvent.COMPLETE, onSubviewEventHandler); addChild(subview); } private function showLevelEditor():void{ removeSubview(); subview = new LevelEditorView(); subview.addEventListener(ViewEvent.COMPLETE, onSubviewEventHandler); addChild(subview); } private function onSubviewEventHandler(event:ViewEvent):void{ switch (event.type){ case ViewEvent.COMPLETE: pendingHSMEvent = (event.data as String); blackoutTransition = new BlackoutTransition(); blackoutTransition.addEventListener(BlackoutTransitionEvent.PEAK, onTransitionPeakHandler); parent.addChild(blackoutTransition); break; }; } } }//package underConstruction.views.main
Section 123
//MainMenuView (underConstruction.views.mainMenu.MainMenuView) package underConstruction.views.mainMenu { import gamework.sound.*; import gamework.net.*; import gamework.ui.*; import flash.text.*; import flash.events.*; import underConstruction.views.*; import flash.filters.*; import underConstruction.events.*; import gamework.display.*; import underConstruction.data.*; import gamework.ui.styles.*; import underConstruction.sound.*; import underConstruction.popups.*; import underConstruction.views.main.*; public class MainMenuView extends AbstractView { public var _levelEditorButton:TextButtonWidget; public var _2DPlayButton:IconicButtonWidget; public var _2DPlayLinkButton:TextButtonWidget; public var _startGameButton:TextButtonWidget; public var _startLevelField:TextField; public var _highScoresButton:TextButtonWidget; public var _instructionsButton:TextButtonWidget; public function MainMenuView(){ super(); addChildren(_startGameButton, _highScoresButton, _instructionsButton, _levelEditorButton, _2DPlayButton, _2DPlayLinkButton); addEventListener(MouseEvent.CLICK, onMouseEventHandler); _2DPlayLinkButton.setStyle(AbstractWidgetStyle.EMBED_FONTS, false); _2DPlayLinkButton.setStyle(AbstractWidgetStyle.TEXT_FORMAT, new TextFormat("_sans")); _2DPlayLinkButton.setStyle(TextButtonStyle.UP_STATE_COLOR, 0xFFFFFF); _2DPlayLinkButton.setStyle(AbstractWidgetStyle.DECORATION, new FilterDecoration(new GlowFilter(0, 1, 4, 4, 5))); SoundManager.getInstance().setSoundVolume(SoundID.IN_GAME_MUSIC, 1); __setProp__startGameButton_MainMenuView_Layer2_1(); __setProp__instructionsButton_MainMenuView_Layer2_1(); __setProp__highScoresButton_MainMenuView_Layer2_1(); __setProp__2DPlayLinkButton_MainMenuView_Layer2_1(); __setProp__levelEditorButton_MainMenuView_Layer3_1(); } function __setProp__2DPlayLinkButton_MainMenuView_Layer2_1(){ _2DPlayLinkButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _2DPlayLinkButton.alignment = "right"; _2DPlayLinkButton.label = "© 2DPlay.com"; _2DPlayLinkButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } function __setProp__highScoresButton_MainMenuView_Layer2_1(){ _highScoresButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _highScoresButton.alignment = "center"; _highScoresButton.label = "High Scores"; _highScoresButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function onMouseEventHandler(event:MouseEvent):void{ switch (event.target){ case _startGameButton: if (SOManager.getInstance().getValue(SOValues.LEVEL_REACHED) == 0){ showInstructionPopup(); } else { showPromptGameContinuePopup(); }; break; case _levelEditorButton: break; case _instructionsButton: dispatchEvent(new ViewEvent(ViewEvent.COMPLETE, MainHSMEvent.INSTRUCTIONS_START)); break; case _highScoresButton: URLCaller.viewScores(); break; case _2DPlayButton: case _2DPlayLinkButton: URLCaller.mainLink(); break; }; } function __setProp__instructionsButton_MainMenuView_Layer2_1(){ _instructionsButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _instructionsButton.alignment = "center"; _instructionsButton.label = "Instructions"; _instructionsButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } function __setProp__startGameButton_MainMenuView_Layer2_1(){ _startGameButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _startGameButton.alignment = "center"; _startGameButton.label = "Start Game"; _startGameButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function showPromptGameContinuePopup():void{ enabled = false; popup = new PromptGameContinuePopup(); popup.addEventListener(PopupEvent.CLOSE, onPopupCloseHandler); addChild(popup); } function __setProp__levelEditorButton_MainMenuView_Layer3_1(){ _levelEditorButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _levelEditorButton.alignment = "right"; _levelEditorButton.label = "Level Editor"; _levelEditorButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } private function showInstructionPopup():void{ enabled = false; popup = new InstructionPopup(); popup.addEventListener(PopupEvent.CLOSE, onPopupCloseHandler); addChild(popup); } private function onPopupCloseHandler(event:PopupEvent):void{ var restartGame:Boolean; var soMan:SOManager; restartGame = (event.data as Boolean); soMan = SOManager.getInstance(); if (restartGame){ soMan.setValue(SOValues.LEVEL_REACHED, 0); soMan.setValue(SOValues.SCORE_REACHED, 0); }; GameInfo.initializeNewGame((soMan.getValue(SOValues.LEVEL_REACHED) as int), (soMan.getValue(SOValues.SCORE_REACHED) as int)); dispatchEvent(new ViewEvent(ViewEvent.COMPLETE, MainHSMEvent.GAME_START)); } } }//package underConstruction.views.mainMenu
Section 124
//AdjacentPiece (underConstruction.views.playField.adjacentPiecesFinder.AdjacentPiece) package underConstruction.views.playField.adjacentPiecesFinder { import underConstruction.views.playField.*; import underConstruction.views.playField.colorMatch.*; public class AdjacentPiece { private var _height:int; private var _width:int; private var _col:int; private var _colorValue:int; private var _pieceData:Array; private var _row:int; public function AdjacentPiece(pieceData:Array, colorValue:int, row:int, col:int){ super(); _pieceData = pieceData; _height = _pieceData.length; _width = _pieceData[0].length; _colorValue = colorValue; _row = row; _col = col; } public function get col():int{ return (_col); } public function get tilesList():Array{ var tiles:Array; var i:int; var row:Array; var j:int; tiles = []; i = 0; while (i < _height) { row = _pieceData[i]; j = 0; while (j < _width) { if (row[j] != 0){ tiles.push(new TileData((_row + i), (_col + j), _colorValue)); }; j++; }; i++; }; return (tiles); } public function get height():int{ return (_height); } public function get linearPieceData():Array{ var data:Array; var i:int; var row:Array; var j:int; data = []; i = 0; while (i < _height) { row = _pieceData[i]; j = 0; while (j < _width) { data.push(row[j]); j++; }; i++; }; return (data); } public function makeHole(row:int, col:int):Array{ var splittedPieces:Array; var colorMatchEngine:ColorMatchEngine; var splittedPiecesGroup:Array; var pieceTileDataArray:Array; var minRow:int; var maxRow:int; var minCol:int; var maxCol:int; var numTiles:int; var i:int; var newPieceData:Array; var newWidth:int; var newHeight:int; var ri:int; var n:int; var splitted:AdjacentPiece; var tile:TileData; var r:int; var c:int; var newRow:Array; var ci:int; var tile2:TileData; _pieceData[row][col] = 0; splittedPieces = []; colorMatchEngine = new ColorMatchEngine(linearPieceData, _height, _width); splittedPiecesGroup = colorMatchEngine.findMatches(1); colorMatchEngine.dispose(); if (splittedPiecesGroup.length > 1){ while (splittedPiecesGroup.length > 0) { pieceTileDataArray = splittedPiecesGroup.pop(); minRow = int.MAX_VALUE; maxRow = int.MIN_VALUE; minCol = int.MAX_VALUE; maxCol = int.MIN_VALUE; numTiles = pieceTileDataArray.length; i = 0; while (i < numTiles) { tile = pieceTileDataArray[i]; r = tile.row; c = tile.col; if (r < minRow){ minRow = r; }; if (r > maxRow){ maxRow = r; }; if (c < minCol){ minCol = c; }; if (c > maxCol){ maxCol = c; }; i++; }; newPieceData = []; newWidth = ((maxCol - minCol) + 1); newHeight = ((maxRow - minRow) + 1); ri = 0; while (ri < newHeight) { newRow = []; ci = 0; while (ci < newWidth) { newRow.push(0); ci++; }; newPieceData.push(newRow); ri++; }; n = 0; while (n < numTiles) { tile2 = pieceTileDataArray[n]; newPieceData[(tile2.row - minRow)][(tile2.col - minCol)] = tile2.value; n++; }; splitted = new AdjacentPiece(newPieceData, _colorValue, (minRow + _row), (minCol + _col)); splittedPieces.push(splitted); }; } else { splittedPieces.push(this); }; return (((tilesList.length)==0) ? null : splittedPieces); } public function get row():int{ return (_row); } public function get colorValue():int{ return (_colorValue); } public function get width():int{ return (_width); } } }//package underConstruction.views.playField.adjacentPiecesFinder
Section 125
//AdjacentPiecesFinder (underConstruction.views.playField.adjacentPiecesFinder.AdjacentPiecesFinder) package underConstruction.views.playField.adjacentPiecesFinder { import underConstruction.views.playField.*; import underConstruction.views.playField.colorMatch.*; import flash.utils.*; public class AdjacentPiecesFinder { private var _tilesToPiecesHash:Object; public function AdjacentPiecesFinder(){ super(); _tilesToPiecesHash = {}; } public function findAdjacentPieces(fieldData:Array):Array{ var groupTilesList:Array; var colorMatchEngine:ColorMatchEngine; var colorMatchGroups:Array; var colorGroup:Array; var colorGroupPiecesDict:Dictionary; var i:int; var numAdjacentPiecesInGroup:int; var name:Object; var tile:TileData; var piece:AdjacentPiece; groupTilesList = []; colorMatchEngine = new ColorMatchEngine(fieldData); colorMatchGroups = colorMatchEngine.findMatches(2); while (colorMatchGroups.length > 0) { colorGroup = colorMatchGroups.pop(); colorGroupPiecesDict = new Dictionary(); i = 0; while (i < colorGroup.length) { tile = colorGroup[i]; piece = _tilesToPiecesHash[((tile.row + "_") + tile.col)]; colorGroupPiecesDict[piece] = true; i++; }; numAdjacentPiecesInGroup = 0; for (name in colorGroupPiecesDict) { numAdjacentPiecesInGroup++; }; if (numAdjacentPiecesInGroup > 1){ groupTilesList.push(colorGroup); }; }; return (groupTilesList); } public function dispose():void{ _tilesToPiecesHash = {}; } public function addPiece(pieceData:Array, colorValue:int, row:int, col:int):void{ var cloneData:Array; var i:int; var piece:AdjacentPiece; var pieceTilesList:Array; var j:int; var tile:TileData; cloneData = []; i = 0; while (i < pieceData.length) { cloneData.push(pieceData[i].slice()); i++; }; piece = new AdjacentPiece(pieceData, colorValue, row, col); pieceTilesList = piece.tilesList; j = 0; while (j < pieceTilesList.length) { tile = pieceTilesList[j]; _tilesToPiecesHash[((tile.row + "_") + tile.col)] = piece; j++; }; } public function makeHole(row:int, col:int):Array{ var piece:AdjacentPiece; var splittedPieces:Array; var i:int; var pieceTilesList:Array; var j:int; var tile:TileData; piece = _tilesToPiecesHash[((row + "_") + col)]; splittedPieces = piece.makeHole((row - piece.row), (col - piece.col)); delete _tilesToPiecesHash[((row + "_") + col)]; if (((splittedPieces) && ((splittedPieces.length > 1)))){ i = 0; while (i < splittedPieces.length) { pieceTilesList = splittedPieces[i].tilesList; j = 0; while (j < pieceTilesList.length) { tile = pieceTilesList[j]; _tilesToPiecesHash[((tile.row + "_") + tile.col)] = splittedPieces[i]; j++; }; i++; }; }; return (splittedPieces); } } }//package underConstruction.views.playField.adjacentPiecesFinder
Section 126
//AnimationEffect (underConstruction.views.playField.animations.AnimationEffect) package underConstruction.views.playField.animations { import flash.display.*; import gamework.core.*; public class AnimationEffect extends Sprite implements IUpdatable { protected var _completed:Boolean;// = false public function AnimationEffect(){ _completed = false; super(); } public function get completed():Boolean{ return (_completed); } public function update():void{ } } }//package underConstruction.views.playField.animations
Section 127
//BrickDebris (underConstruction.views.playField.animations.BrickDebris) package underConstruction.views.playField.animations { import flash.filters.*; public class BrickDebris extends AnimationEffect { private var pieceSprites:Array; public function BrickDebris(color:int){ var i:int; var spr:Tile; pieceSprites = []; super(); i = 0; while (i < 4) { spr = new Tile(); spr.scaleX = (spr.scaleY = 0.5); spr.gotoAndStop((color + 1)); if ((((i == 0)) || ((i == 1)))){ spr.x = 0; spr.dx = -0.5; } else { spr.x = 15; spr.dx = 0.5; }; spr.y = ((((i == 0)) || ((i == 2)))) ? 0 : 15; spr.dy = (-7 + (Math.random() * 3)); addChild(spr); pieceSprites.push(spr); spr.filters = [new DropShadowFilter(6, 45, 0, 0.5, 4, 4)]; i++; }; } override public function update():void{ var i:int; var spr:Tile; if (_completed){ return; }; i = 0; while (i < pieceSprites.length) { spr = pieceSprites[i]; spr.x = (spr.x + spr.dx); spr.y = (spr.y + spr.dy); spr.dx = (spr.dx * 1.02); spr.dy = (spr.dy + 0.8); if ((spr.y + y) > 480){ pieceSprites.splice(i, 1); removeChild(spr); i--; }; i++; }; if (pieceSprites.length == 0){ _completed = true; }; } } }//package underConstruction.views.playField.animations
Section 128
//ScoreEffect (underConstruction.views.playField.animations.ScoreEffect) package underConstruction.views.playField.animations { import flash.text.*; public class ScoreEffect extends AnimationEffect { public var _labelField:TextField; private var dy:Number;// = -3 public function ScoreEffect(x:int, y:int, text:String, color:uint){ dy = -3; super(); visible = false; mouseChildren = false; mouseEnabled = false; _labelField.autoSize = TextFieldAutoSize.CENTER; _labelField.text = text; _labelField.textColor = color; this.x = x; this.y = (y - (_labelField.height - 30)); visible = true; } override public function update():void{ if (_completed){ return; }; y = (y + dy); dy = (dy + 0.15); if (dy >= 0){ _completed = true; }; } } }//package underConstruction.views.playField.animations
Section 129
//ColorMatchEngine (underConstruction.views.playField.colorMatch.ColorMatchEngine) package underConstruction.views.playField.colorMatch { import underConstruction.views.playField.*; public class ColorMatchEngine { private var height:int; private var width:int; private var _tilesValuesArray:Array; private var currentSearchGroupValue:int; private var _tilesCheckArray:Array; private var numTiles:int; private var currentSearchGroupArray:Array; public static const EMPTY_TILE_VALUE:int = 0; public function ColorMatchEngine(tileData:Array, height:int=10, width:int=16){ super(); this.height = height; this.width = width; this.numTiles = (height * width); _tilesValuesArray = tileData.slice(); } private function findMatchesGroup(row:int, col:int):void{ var index:int; index = ((row * width) + col); if (((!(_tilesCheckArray[index])) && ((_tilesValuesArray[index] == currentSearchGroupValue)))){ _tilesCheckArray[index] = true; currentSearchGroupArray.push(new TileData(row, col, currentSearchGroupValue)); if (((((!((row == 0))) && (!(_tilesCheckArray[(index - width)])))) && ((_tilesValuesArray[(index - width)] == currentSearchGroupValue)))){ findMatchesGroup((row - 1), col); }; if (((((!((row == (height - 1)))) && (!(_tilesCheckArray[(index + width)])))) && ((_tilesValuesArray[(index + width)] == currentSearchGroupValue)))){ findMatchesGroup((row + 1), col); }; if (((((!((col == 0))) && (!(_tilesCheckArray[(index - 1)])))) && ((_tilesValuesArray[(index - 1)] == currentSearchGroupValue)))){ findMatchesGroup(row, (col - 1)); }; if (((((!((col == (width - 1)))) && (!(_tilesCheckArray[(index + 1)])))) && ((_tilesValuesArray[(index + 1)] == currentSearchGroupValue)))){ findMatchesGroup(row, (col + 1)); }; }; } public function findMatches(minGroupSize:int=6):Array{ var matches:Array; var i:int; var row:int; var col:int; matches = []; _tilesCheckArray = []; i = 0; while (i < numTiles) { _tilesCheckArray.push(false); i++; }; i = 0; while (i < numTiles) { if (!_tilesCheckArray[i]){ currentSearchGroupValue = _tilesValuesArray[i]; currentSearchGroupArray = []; row = Math.floor((i / width)); col = (i % width); findMatchesGroup(row, col); if ((((currentSearchGroupArray.length >= minGroupSize)) && ((currentSearchGroupValue > EMPTY_TILE_VALUE)))){ matches.push(currentSearchGroupArray); }; }; i++; }; return (matches); } public function dispose():void{ _tilesValuesArray = null; _tilesCheckArray = null; currentSearchGroupArray = null; } } }//package underConstruction.views.playField.colorMatch
Section 130
//FieldEvent (underConstruction.views.playField.events.FieldEvent) package underConstruction.views.playField.events { import flash.events.*; public class FieldEvent extends Event { public static const ANIMATION_COMPLETE:String = "animation_complete"; public function FieldEvent(type:String){ super(type); } override public function toString():String{ return (formatToString("FieldEvent", "type")); } } }//package underConstruction.views.playField.events
Section 131
//HUDEvent (underConstruction.views.playField.events.HUDEvent) package underConstruction.views.playField.events { import flash.events.*; public class HUDEvent extends Event { private var _command:String; public static const COMMAND_PAUSE:String = "command_pause"; public static const BUTTON_CLICK:String = "button_click"; public function HUDEvent(type:String, command:String){ super(type); _command = command; } public function get command():String{ return (_command); } override public function toString():String{ return (formatToString("HUDEvent", "type", "command")); } } }//package underConstruction.views.playField.events
Section 132
//ModelEvent (underConstruction.views.playField.events.ModelEvent) package underConstruction.views.playField.events { import flash.events.*; public class ModelEvent extends Event { private var _data; public static const LEVEL_COMPLETE:String = "level_complete"; public static const PAUSE:String = "pause"; public static const POPUP_INVOKE:String = "popup_invoke"; public function ModelEvent(type:String, data=null){ _data = data; super(type); } public function get data(){ return (_data); } } }//package underConstruction.views.playField.events
Section 133
//PieceEvent (underConstruction.views.playField.events.PieceEvent) package underConstruction.views.playField.events { import flash.events.*; public class PieceEvent extends Event { public static const DISCARDED:String = "discarded"; public function PieceEvent(type:String){ super(type); } } }//package underConstruction.views.playField.events
Section 134
//HUD (underConstruction.views.playField.ui.HUD) package underConstruction.views.playField.ui { import underConstruction.views.playField.*; import gamework.net.*; import gamework.ui.*; import flash.text.*; import flash.events.*; import underConstruction.views.playField.events.*; import underConstruction.data.*; import gamework.ui.styles.*; import gamework.utils.*; public class HUD extends WidgetContainer { public var _pauseButton:TextButtonWidget; public var _scoreField:TextField; public var _2DPlayButton:IconicButtonWidget; public var _timerField:TextField; private var _selectedPowerupType:String;// = null private var powerupButtonsHash:Object; private var currentPowerupButtonsY:int; public var _floorField:TextField; public static const POWERUP_BUTTONS_STEP_Y:int = 60; public static const POWERUP_BUTTONS_INIT_X:int = 550; public static const POWERUP_BUTTONS_INIT_Y:int = 60; public function HUD(){ powerupButtonsHash = {}; _selectedPowerupType = null; super(); addChildren(_pauseButton, _2DPlayButton); addEventListener(MouseEvent.CLICK, onMouseClickHandler); __setProp__pauseButton_HUD_Layer1_1(); } function __setProp__pauseButton_HUD_Layer1_1(){ _pauseButton["componentInspectorSetting"] = true; //unresolved jump var _slot1 = e; _pauseButton.alignment = "right"; _pauseButton.label = "Pause"; _pauseButton["componentInspectorSetting"] = false; //unresolved jump var _slot1 = e; } public function showFloor(floor:Object=null, numFloors:Object=null):void{ _floorField.text = ((("Floor: " + String(((floor == null)) ? (GameInfo.floor + 1) : (int(floor) + 1))) + "/") + String(((numFloors == null)) ? GameInfo.numFloors : int(numFloors))); } public function showPowerups():void{ currentPowerupButtonsY = POWERUP_BUTTONS_INIT_Y; addPowerupButton(PowerupType.ADD_SINGLE_BRICK, GameInfo.powerupCount(PowerupType.ADD_SINGLE_BRICK)); addPowerupButton(PowerupType.REMOVE_SINGLE_BRICK, GameInfo.powerupCount(PowerupType.REMOVE_SINGLE_BRICK)); } public function showTimer(time:Object=null):void{ _timerField.text = ("Time: " + ((time == null)) ? StringUtil.secondsToElectronicTimerString(GameInfo.time) : StringUtil.secondsToElectronicTimerString(int(time))); } public function get selectedPowerupType():String{ return (_selectedPowerupType); } public function getActivePowerupButtonPosition():Object{ var btn:PowerupButton; for each (btn in powerupButtonsHash) { if (btn.count > 0){ return ({x:btn.x, y:btn.y}); }; }; return (null); } public function addPowerupButton(powerupType:String, powerupCount:int):void{ var powerupButton:PowerupButton; powerupButton = new PowerupButton(powerupType, powerupCount); powerupButton.setStyle(AbstractWidgetStyle.DISABLED_ALPHA, 0.8); powerupButton.x = POWERUP_BUTTONS_INIT_X; powerupButton.y = currentPowerupButtonsY; currentPowerupButtonsY = (currentPowerupButtonsY + POWERUP_BUTTONS_STEP_Y); powerupButton.enabled = false; addChild(powerupButton); powerupButtonsHash[powerupType] = powerupButton; } public function showScore():void{ _scoreField.text = ((("Goal: " + String(Levels.getGoal(GameInfo.level))) + " Score: ") + GameInfo.levelScore); } private function onMouseClickHandler(event:MouseEvent):void{ var buttonType:String; var b:AbstractWidget; switch (event.target){ case _pauseButton: dispatchEvent(new HUDEvent(HUDEvent.BUTTON_CLICK, HUDEvent.COMMAND_PAUSE)); break; case _2DPlayButton: URLCaller.mainLink(); break; default: if ((event.target is PowerupButton)){ buttonType = (event.target as PowerupButton).type; if (_selectedPowerupType){ if (_selectedPowerupType == buttonType){ _selectedPowerupType = null; (event.target as PowerupButton).selected = false; } else { for each (b in childWidgets) { if ((b is PowerupButton)){ (b as PowerupButton).selected = false; }; }; _selectedPowerupType = buttonType; (event.target as PowerupButton).selected = true; }; } else { _selectedPowerupType = buttonType; (event.target as PowerupButton).selected = true; }; }; }; } public function usePowerup(powerupType:String):void{ var powerupButton:PowerupButton; powerupButton = powerupButtonsHash[powerupType]; powerupButton.count--; GameInfo.usePowerup(powerupType); if (powerupButton.count == 0){ _selectedPowerupType = null; powerupButton.selected = false; }; } } }//package underConstruction.views.playField.ui
Section 135
//PowerupButton (underConstruction.views.playField.ui.PowerupButton) package underConstruction.views.playField.ui { import flash.display.*; import gamework.ui.*; import flash.text.*; import flash.filters.*; import gamework.effects.*; public class PowerupButton extends AbstractButtonWidget { public var _labelField:TextField; private var _count:int; private var _type:String; public var _icon:MovieClip; private var _selected:Boolean;// = false public static const BW_COLOR_FILTER:ColorMatrixFilter = new ColorMatrixFilter([0.3, 0.59, 0.11, 0, 0, 0.3, 0.59, 0.11, 0, 0, 0.3, 0.59, 0.11, 0, 0, 0, 0, 0, 1, 0]); public function PowerupButton(type:String, count:int){ _selected = false; super(); _type = type; _icon.gotoAndStop(type); this.count = count; } public function get count():int{ return (_count); } public function set count(value:int):void{ _count = value; if (_count == 0){ super.enabled = false; }; _labelField.text = String(value); invalidate(InvalidationType.STATE); } public function set selected(value:Boolean):void{ _selected = value; if (value){ startBeacon(new GlowBeacon(0xFFFFFF, 2, 16, 30, 1, 4)); } else { stopBeacon(); }; invalidate(); } public function get type():String{ return (_type); } override public function set enabled(value:Boolean):void{ if (_count == 0){ return; }; super.enabled = value; } override protected function drawState():void{ switch (_state){ case ButtonWidgetState.UP: alpha = (_selected) ? 1 : 0.8; _icon.filters = (_selected) ? [] : [BW_COLOR_FILTER]; break; case ButtonWidgetState.DOWN: case ButtonWidgetState.OVER: alpha = 1; _icon.filters = (_selected) ? [] : [BW_COLOR_FILTER]; break; }; } public function get selected():Boolean{ return (_selected); } } }//package underConstruction.views.playField.ui
Section 136
//CustomGameModel (underConstruction.views.playField.CustomGameModel) package underConstruction.views.playField { import flash.display.*; import underConstruction.views.playField.ui.*; import underConstruction.data.*; public class CustomGameModel extends GameModel { private var floor:int;// = -1 public function CustomGameModel(fieldSprite:Field, piecesHolder:Sprite, animationsHolder:Sprite, draggingPieceHolder:Sprite, hud:HUD){ floor = -1; super(fieldSprite, piecesHolder, animationsHolder, draggingPieceHolder, hud); } override protected function isFinalFloor():Boolean{ var result:Boolean; result = ((floor + 1) == Levels.getCustomNumFloors()); return (result); } override protected function initializeFloor():void{ var i:int; var row:int; var col:int; var numAdjacentTiles:int; floor++; hud.showFloor(); fieldData = Levels.getCustomFloorData(floor); EmptyTileCounter.reset(); i = 0; while (i < NUM_TILES) { if (fieldData[i] == 0){ EmptyTileCounter.registerEmptyTile(); row = Math.floor((i / WIDTH)); col = (i % WIDTH); numAdjacentTiles = 0; if (((!((row == 0))) && ((fieldData[(i - WIDTH)] == 0)))){ numAdjacentTiles++; }; if (((!((row == (HEIGHT - 1)))) && ((fieldData[(i + WIDTH)] == 0)))){ numAdjacentTiles++; }; if (((!((col == 0))) && ((fieldData[(i - 1)] == 0)))){ numAdjacentTiles++; }; if (((!((col == (WIDTH - 1)))) && ((fieldData[(i + 1)] == 0)))){ numAdjacentTiles++; }; if (numAdjacentTiles == 0){ EmptyTileCounter.registerHole(row, col); }; }; i++; }; fieldSprite.scrollToNextFloor(fieldData); } } }//package underConstruction.views.playField
Section 137
//CustomGameView (underConstruction.views.playField.CustomGameView) package underConstruction.views.playField { import underConstruction.views.playField.events.*; public class CustomGameView extends GameView { public function CustomGameView(){ super(); } override protected function initialize():void{ createChildren(); model = new CustomGameModel(fieldSprite, piecesHolder, animationsHolder, draggingPieceHolder, hud); model.addEventListener(ModelEvent.PAUSE, onModelPauseHandler); model.addEventListener(ModelEvent.LEVEL_COMPLETE, onLevelCompleteHandler); model.addEventListener(ModelEvent.POPUP_INVOKE, onLevelPopupInvokeHandler); model.start(); } } }//package underConstruction.views.playField
Section 138
//EmptyTileCounter (underConstruction.views.playField.EmptyTileCounter) package underConstruction.views.playField { public class EmptyTileCounter { private static var _holesHash:Object = new Object(); private static var _numEmptyTiles:int = 0; private static var _numHoles:int = 0; public function EmptyTileCounter(){ super(); } public static function registerHole(row:int, col:int):void{ var key:String; key = ((String(row) + "_") + String(col)); if (!_holesHash[key]){ _holesHash[key] = new TileData(row, col); _numHoles++; }; } public static function reset():void{ _numEmptyTiles = 0; _numHoles = 0; _holesHash = new Object(); } public static function get holesList():Array{ var list:Array; var data:TileData; list = new Array(); for each (data in _holesHash) { list.push(data); }; return (list); } public static function isGameComplete():Boolean{ return ((((_numEmptyTiles == 0)) || ((_numEmptyTiles == _numHoles)))); } public static function registerEmptyTile():void{ _numEmptyTiles++; } public static function unregisterHole(row:int, col:int):void{ var key:String; key = ((String(row) + "_") + String(col)); if (_holesHash[key]){ delete _holesHash[key]; _numHoles--; }; } public static function unregisterEmptyTile():void{ _numEmptyTiles--; } } }//package underConstruction.views.playField
Section 139
//Field (underConstruction.views.playField.Field) package underConstruction.views.playField { import flash.display.*; import com.boostworthy.animation.sequence.tweens.*; import fl.motion.*; import flash.filters.*; import underConstruction.views.playField.events.*; import com.boostworthy.events.*; import com.boostworthy.animation.easing.*; import com.boostworthy.animation.rendering.*; import com.boostworthy.animation.sequence.*; import flash.utils.*; public class Field extends Sprite { private var tilesCoords:Array; private var timeline:Timeline; private var scrollBitmap:Bitmap; private var piecesHolder:Sprite; private var grid:Shape; public static const GRAY_1:uint = 0x7B7B7B; public static const GRAY_2:uint = 0x666666; public function Field(){ super(); scrollBitmap = new Bitmap(null, PixelSnapping.AUTO, true); addChild(scrollBitmap); grid = new Shape(); addChild(grid); piecesHolder = new Sprite(); piecesHolder.mouseChildren = false; piecesHolder.mouseEnabled = false; addChild(piecesHolder); } public function fillHole(tile:TileData):void{ var pieceClip:Sprite; var newTile:Tile; pieceClip = new Sprite(); pieceClip.x = (tile.col * GameModel.TILE_SIZE); pieceClip.y = (tile.row * GameModel.TILE_SIZE); newTile = new Tile(); newTile.gotoAndStop(32); pieceClip.addChild(newTile); pieceClip.filters = [new BevelFilter(2, 45, 0xFFFFFF, 1, 0, 1, 4, 4)]; piecesHolder.addChild(pieceClip); } public function placePiece(pieceData:Array, insertionRow:int, insertionCol:int):void{ var pieceHeight:int; var pieceWidth:int; var pieceSprite:Sprite; var i:int; var j:int; var tileValue:int; var newTile:Tile; pieceHeight = pieceData.length; pieceWidth = pieceData[0].length; pieceSprite = new Sprite(); i = 0; while (i < pieceHeight) { j = 0; while (j < pieceWidth) { tileValue = pieceData[i][j]; if (tileValue > 0){ newTile = new Tile(); newTile.gotoAndStop((tileValue + 1)); newTile.x = ((j + insertionCol) * GameModel.TILE_SIZE); newTile.y = ((i + insertionRow) * GameModel.TILE_SIZE); pieceSprite.addChild(newTile); tilesCoords[(i + insertionRow)][(j + insertionCol)] = pieceSprite; }; j++; }; i++; }; pieceSprite.filters = [new BevelFilter(2, 45, 0xFFFFFF, 1, 0, 1, 4, 4)]; piecesHolder.addChild(pieceSprite); } private function removeAllGraphics(clearGrid:Boolean=false):void{ var spr:DisplayObject; while (piecesHolder.numChildren > 0) { spr = piecesHolder.getChildAt(0); spr.filters = []; piecesHolder.removeChild(spr); }; if (clearGrid){ grid.graphics.clear(); }; } public function scrollToNextFloor(data:Array):void{ var bmpData:BitmapData; filters = []; bmpData = new BitmapData((GameModel.WIDTH * GameModel.TILE_SIZE), (GameModel.HEIGHT * GameModel.TILE_SIZE), true, 0); bmpData.draw(grid, null, null, null, null, true); bmpData.draw(piecesHolder, null, null, null, null, true); scrollBitmap.y = 0; scrollBitmap.bitmapData = bmpData; removeAllGraphics(true); drawGrid(data); timeline = new Timeline(RenderMethod.ENTER_FRAME); timeline.addTween(new Tween(scrollBitmap, "y", (GameModel.HEIGHT * GameModel.TILE_SIZE), 0, 30, Transitions.QUAD_IN_AND_OUT)); timeline.addTween(new Tween(grid, "y", 0, 0, 30, Transitions.QUAD_IN_AND_OUT)); timeline.addEventListener(AnimationEvent.FINISH, onAnimationFinishHandler); timeline.play(); } public function showBricks(data:Array):void{ var numGroups:int; var i:int; var groupClip:Sprite; var colorGroup:Array; var numTiles:int; var j:int; var brick:Tile; removeAllGraphics(); numGroups = data.length; i = 0; while (i < numGroups) { groupClip = new Sprite(); colorGroup = data[i]; numTiles = colorGroup.length; j = 0; while (j < numTiles) { brick = new Tile(); brick.gotoAndStop((colorGroup[j].value + 1)); brick.x = (colorGroup[j].col * GameModel.TILE_SIZE); brick.y = (colorGroup[j].row * GameModel.TILE_SIZE); groupClip.addChild(brick); tilesCoords[colorGroup[j].row][colorGroup[j].col] = groupClip; j++; }; groupClip.filters = [new BevelFilter(2, 45, 0xFFFFFF, 1, 0, 1, 4, 4)]; piecesHolder.addChild(groupClip); i++; }; } private function drawGrid(data:Array):void{ var tileSize:int; var i:int; var tileValue:int; var row:int; var col:int; var color:uint; grid.y = (-(GameModel.HEIGHT) * GameModel.TILE_SIZE); grid.graphics.lineStyle(); tileSize = GameModel.TILE_SIZE; tilesCoords = new Array(); i = 0; while (i < GameModel.NUM_TILES) { tileValue = data[i]; if (tileValue != -1){ row = Math.floor((i / GameModel.WIDTH)); col = (i % GameModel.WIDTH); color = ((((row + col) % 2) == 0)) ? GRAY_1 : GRAY_2; grid.graphics.beginFill(color); grid.graphics.drawRect((col * tileSize), (row * tileSize), tileSize, tileSize); grid.graphics.endFill(); }; tilesCoords.push(new Array(GameModel.WIDTH)); i++; }; } public function makeHole(row:int, col:int, splittedPieces:Array):void{ var pieceSprite:Sprite; var i:int; var pieceTilesList:Array; var newPieceSprite:Sprite; var j:int; var tile:TileData; var newTile:Tile; pieceSprite = tilesCoords[row][col]; tilesCoords[row][col] = undefined; piecesHolder.removeChild(pieceSprite); if (splittedPieces != null){ i = 0; while (i < splittedPieces.length) { pieceTilesList = splittedPieces[i].tilesList; newPieceSprite = new Sprite(); j = 0; while (j < pieceTilesList.length) { tile = pieceTilesList[j]; newTile = new Tile(); newTile.gotoAndStop((tile.value + 1)); newTile.x = (tile.col * GameModel.TILE_SIZE); newTile.y = (tile.row * GameModel.TILE_SIZE); newPieceSprite.addChild(newTile); tilesCoords[tile.row][tile.col] = newPieceSprite; j++; }; newPieceSprite.filters = [new BevelFilter(2, 45, 0xFFFFFF, 1, 0, 1, 4, 4)]; piecesHolder.addChild(newPieceSprite); i++; }; }; } public function showColorMatchGroup(groupData:Array):void{ var pieces:Dictionary; var i:int; var tileSprite:Sprite; var tile:TileData; var pieceOnField:Sprite; var color:Color; pieces = new Dictionary(); i = 0; while (i < groupData.length) { tile = groupData[i]; pieceOnField = tilesCoords[tile.row][tile.col]; pieces[pieceOnField] = pieceOnField; i++; }; for each (tileSprite in pieces) { color = new Color(); color.brightness = 0.6; tileSprite.transform.colorTransform = color; }; } private function onAnimationFinishHandler(event:AnimationEvent):void{ timeline.removeEventListener(AnimationEvent.FINISH, onAnimationFinishHandler); timeline.dispose(); timeline = null; scrollBitmap.bitmapData.dispose(); dispatchEvent(new FieldEvent(FieldEvent.ANIMATION_COMPLETE)); filters = [new GlowFilter(0, 1, 4, 4, 5)]; } } }//package underConstruction.views.playField
Section 140
//GameCommand (underConstruction.views.playField.GameCommand) package underConstruction.views.playField { import gamework.utils.*; public class GameCommand { private var _priority:int; private var _data; private var _removeDuplicates:Boolean; private var _cancelPendingCommands:Boolean; private var _type:String; public static const POWERUP_USE:String = "powerup_use"; public static const SHOW_POPUP:String = "show_popup"; public static const PIECE_MOUSE_DOWN:String = "piece_mouse_down"; public static const ADD_PIECE:String = "add_piece"; public static const ROTATE_PIECE:String = "rotate_piece"; public static const REMOVE_PIECE:String = "remove_piece"; public static const COMPLETE_FLOOR:String = "complete_floor"; public static const PAUSE:String = "pause"; public function GameCommand(type:String, data=null){ super(); _type = type; _data = data; switch (_type){ case ROTATE_PIECE: _priority = 0; _cancelPendingCommands = false; _removeDuplicates = true; break; case ADD_PIECE: _priority = 1; _cancelPendingCommands = false; _removeDuplicates = false; break; case REMOVE_PIECE: _priority = 2; _cancelPendingCommands = false; _removeDuplicates = false; break; case COMPLETE_FLOOR: _priority = 3; _cancelPendingCommands = true; _removeDuplicates = false; break; case SHOW_POPUP: _priority = 8; _cancelPendingCommands = true; _removeDuplicates = false; break; case PAUSE: _priority = 5; _cancelPendingCommands = true; _removeDuplicates = false; break; case PIECE_MOUSE_DOWN: _priority = 6; _cancelPendingCommands = true; _removeDuplicates = true; break; case POWERUP_USE: _priority = 7; _cancelPendingCommands = false; _removeDuplicates = true; break; }; } public function get priority():int{ return (_priority); } public function get cancelPendingCommands():Boolean{ return (_cancelPendingCommands); } public function get removeDuplicates():Boolean{ return (_removeDuplicates); } public function get data(){ return (_data); } public function get type():String{ return (_type); } public function toString():String{ return (ObjectUtil.formatToString(this, "type", "priority", "data")); } } }//package underConstruction.views.playField
Section 141
//GameModel (underConstruction.views.playField.GameModel) package underConstruction.views.playField { import gamework.sound.*; import flash.display.*; import flash.events.*; import underConstruction.views.*; import gamework.statemachine.hsm.*; import underConstruction.views.playField.ui.*; import gamework.events.*; import underConstruction.views.playField.events.*; import gamework.core.*; import underConstruction.data.*; import gamework.utils.*; import underConstruction.sound.*; import underConstruction.popups.*; import underConstruction.views.playField.adjacentPiecesFinder.*; import underConstruction.views.playField.colorMatch.*; import underConstruction.hints.*; import underConstruction.views.playField.animations.*; import gamework.application.*; public class GameModel extends EventDispatcher implements IDisposable { private var animationsHash:Object; private var colorMatchGroups:Array; private var nextPieceAppearCounter:Number;// = 0 private var countdown:Countdown; private var pieceFinder:AdjacentPiecesFinder; private var pendingCommands:Array; protected var fieldData:Array; private var soundMan:SoundManager; private var piecesHolder:Sprite; private var draggingPiece:GamePiece; private var draggingPieceHolder:Sprite; protected var fieldSprite:Field; private var holesList:Array; protected var hud:HUD; private var nextHintPopupDelay:int; private var powerupIcon:PowerupIcon; private var piecesHash:Object; private var animationsHolder:Sprite; private var stateMachine:HSM; public static const WIDTH:int = 16; public static const HEIGHT:int = 10; public static const GAP_BETWEEN_PIECES_ON_CONVEYOR:int = 15; public static const TILE_SIZE:int = 30; public static const NUM_TILES:int = 160; public static const HINT_POPUP_DELAY:int = 1500; private static var POWERUPS_USED_ONCE:Boolean = false; public function GameModel(fieldSprite:Field, piecesHolder:Sprite, animationsHolder:Sprite, draggingPieceHolder:Sprite, hud:HUD){ var stage:Stage; pendingCommands = new Array(); piecesHash = new Object(); animationsHash = new Object(); nextPieceAppearCounter = 0; super(); soundMan = SoundManager.getInstance(); this.fieldSprite = fieldSprite; this.fieldSprite.addEventListener(FieldEvent.ANIMATION_COMPLETE, onFieldAnimationCompleteHandler); this.piecesHolder = piecesHolder; this.animationsHolder = animationsHolder; this.draggingPieceHolder = draggingPieceHolder; this.hud = hud; this.hud.enabled = false; this.hud.addEventListener(HUDEvent.BUTTON_CLICK, onHUDButtonClickHandler); stage = ApplicationGlobals.STAGE; stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownHandler); stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler); stage.addEventListener(Event.ENTER_FRAME, onStageEnterFrameHandler); stateMachine = new HSM("GameModel HSM"); stateMachine.addState(new InitialState(GameModelHSMState.INITIAL, null)); stateMachine.addState(new CompositeState(GameModelHSMState.START_LEVEL_POPUP, null, showStartLevelPopup)); stateMachine.addState(new CompositeState(GameModelHSMState.FIELD_ANIMATION, null, initializeFloor)); stateMachine.addState(new CompositeState(GameModelHSMState.PLAYING, null, startPlaying, playingStateDoAction, stopPlaying)); stateMachine.addState(new CompositeState(GameModelHSMState.HINT_POPUP, null)); stateMachine.addState(new CompositeState(GameModelHSMState.PAUSE, null, showPauseMenu)); stateMachine.addState(new CompositeState(GameModelHSMState.CALCULATE_COLORMATCH_BONUS, null, calculateBonuses)); stateMachine.addState(new InitialState(GameModelHSMState.INITIAL_COLORMATCH_BONUS, GameModelHSMState.CALCULATE_COLORMATCH_BONUS)); stateMachine.addState(new CompositeState(GameModelHSMState.COLORMATCH_ANIMATION, GameModelHSMState.CALCULATE_COLORMATCH_BONUS, startColorMatchAnimation)); stateMachine.addState(new FinalState(GameModelHSMState.FINAL, null, completeLevel)); stateMachine.addState(new CompositeState(GameModelHSMState.CALCULATE_HOLE_PENALTY, null)); stateMachine.addState(new InitialState(GameModelHSMState.INITIAL_HOLE_PENALTY, GameModelHSMState.CALCULATE_HOLE_PENALTY)); stateMachine.addState(new CompositeState(GameModelHSMState.HOLE_PENALTY_ANIMATION, GameModelHSMState.CALCULATE_HOLE_PENALTY, startHolePenaltyAnimation)); stateMachine.addState(new ChoicePointState(GameModelHSMState.CONTINUE_LEVEL_CHOICE, null)); stateMachine.addState(new ChoicePointState(GameModelHSMState.SHOW_NEXT_HOLE_PENALTY_ANIMATION_CHOICE, GameModelHSMState.CALCULATE_HOLE_PENALTY)); stateMachine.addState(new ChoicePointState(GameModelHSMState.SHOW_NEXT_COLORMATCH_ANIMATION_CHOICE, GameModelHSMState.CALCULATE_COLORMATCH_BONUS)); stateMachine.addTransition(GameModelHSMState.INITIAL, GameModelHSMState.START_LEVEL_POPUP, new SignalEvent(GameModelHSMEvent.INITIALIZE), initializeLevel); stateMachine.addTransition(GameModelHSMState.START_LEVEL_POPUP, GameModelHSMState.FIELD_ANIMATION, new SignalEvent(GameModelHSMEvent.PLAYING_RESUME)); stateMachine.addTransition(GameModelHSMState.FIELD_ANIMATION, GameModelHSMState.PLAYING, new SignalEvent(GameModelHSMEvent.ANIMATION_COMPLETE)); stateMachine.addTransition(GameModelHSMState.PLAYING, GameModelHSMState.CALCULATE_COLORMATCH_BONUS, new SignalEvent(GameModelHSMEvent.FLOOR_COMPLETE)); stateMachine.addTransition(GameModelHSMState.INITIAL_COLORMATCH_BONUS, GameModelHSMState.SHOW_NEXT_COLORMATCH_ANIMATION_CHOICE, new TimeEvent(1000)); stateMachine.addTransition(GameModelHSMState.COLORMATCH_ANIMATION, GameModelHSMState.SHOW_NEXT_COLORMATCH_ANIMATION_CHOICE, new TimeEvent(300)); stateMachine.addTransition(GameModelHSMState.INITIAL_HOLE_PENALTY, GameModelHSMState.SHOW_NEXT_HOLE_PENALTY_ANIMATION_CHOICE, new TimeEvent(1000)); stateMachine.addTransition(GameModelHSMState.HOLE_PENALTY_ANIMATION, GameModelHSMState.SHOW_NEXT_HOLE_PENALTY_ANIMATION_CHOICE, new TimeEvent(300)); stateMachine.addTransition(GameModelHSMState.CONTINUE_LEVEL_CHOICE, GameModelHSMState.FINAL, null, null, isFinalFloor); stateMachine.addTransition(GameModelHSMState.CONTINUE_LEVEL_CHOICE, GameModelHSMState.FIELD_ANIMATION, null, null); stateMachine.addTransition(GameModelHSMState.SHOW_NEXT_HOLE_PENALTY_ANIMATION_CHOICE, GameModelHSMState.HOLE_PENALTY_ANIMATION, null, null, isHolePenalty); stateMachine.addTransition(GameModelHSMState.SHOW_NEXT_HOLE_PENALTY_ANIMATION_CHOICE, GameModelHSMState.CONTINUE_LEVEL_CHOICE, null, null); stateMachine.addTransition(GameModelHSMState.SHOW_NEXT_COLORMATCH_ANIMATION_CHOICE, GameModelHSMState.COLORMATCH_ANIMATION, null, null, isColorMatchGroup); stateMachine.addTransition(GameModelHSMState.SHOW_NEXT_COLORMATCH_ANIMATION_CHOICE, GameModelHSMState.CALCULATE_HOLE_PENALTY, null, null); stateMachine.addTransition(GameModelHSMState.PLAYING, GameModelHSMState.HINT_POPUP, new SignalEvent(GameModelHSMEvent.HINT)); stateMachine.addTransition(GameModelHSMState.HINT_POPUP, GameModelHSMState.PLAYING, new SignalEvent(GameModelHSMEvent.PLAYING_RESUME)); stateMachine.addTransition(GameModelHSMState.PLAYING, GameModelHSMState.PAUSE, new SignalEvent(GameModelHSMEvent.PAUSE)); stateMachine.addTransition(GameModelHSMState.PAUSE, GameModelHSMState.PLAYING, new SignalEvent(GameModelHSMEvent.PLAYING_RESUME)); stateMachine.start(HSMUpdateMode.ENTER_FRAME); nextHintPopupDelay = HINT_POPUP_DELAY; pieceFinder = new AdjacentPiecesFinder(); } protected function isFinalFloor():Boolean{ var result:Boolean; result = ((GameInfo.floor + 1) == Levels.getNumFloors(GameInfo.level)); return (result); } private function onCountdownTickHandler(event:CountdownEvent):void{ GameInfo.time = event.ticksLeft; hud.showTimer(event.ticksLeft); } private function onStageEnterFrameHandler(event:Event):void{ var animation:AnimationEffect; for each (animation in animationsHash) { animation.update(); if (animation.completed){ delete animationsHash[animation.name]; animation.parent.removeChild(animation); }; }; } private function onPieceDiscardHandler(event:PieceEvent):void{ var piece:GamePiece; var sx:Number; var sy:Number; piece = (event.target as GamePiece); sx = (piece.x + (piece.width / 2)); sy = 460; showScoreEffect(sx, sy, ("Penalty!\n-" + String(Constants.DISPOSE_PENALTY)), 0xFF0000); GameInfo.levelScore = (GameInfo.levelScore - Constants.DISPOSE_PENALTY); hud.showScore(); soundMan.playSound(SoundID.BRICK_DISPOSE); appendCommand(new GameCommand(GameCommand.REMOVE_PIECE, piece)); } private function isColorMatchGroup():Boolean{ return ((colorMatchGroups.length > 0)); } public function unpause():void{ stateMachine.sendSignalEvent(GameModelHSMEvent.PLAYING_RESUME); } private function startPlaying():void{ countdown.start(); hud.enabled = true; } private function removePiece(piece:GamePiece):void{ piece.removeEventListener(PieceEvent.DISCARDED, onPieceDiscardHandler); piece.removeEventListener(MouseEvent.MOUSE_DOWN, onPieceMouseDownHandler); piece.dispose(); piece.parent.removeChild(piece); delete piecesHash[piece.name]; } private function getTileUnderCursor():TileData{ var stage:Stage; var col:Number; var row:Number; var tileValue:int; stage = ApplicationGlobals.STAGE; col = Math.floor((fieldSprite.mouseX / TILE_SIZE)); row = Math.floor((fieldSprite.mouseY / TILE_SIZE)); if ((((((((col >= 0)) && ((col < WIDTH)))) && ((row >= 0)))) && ((row < HEIGHT)))){ tileValue = fieldData[((row * WIDTH) + col)]; return (new TileData(row, col, tileValue)); }; return (null); } private function findPlaceForPiece(piece:GamePiece):Object{ var pieceData:Array; var pieceWidth:int; var pieceHeight:int; var m:int; var placeFound:Boolean; var insertionRow:int; var insertionCol:int; var i:int; var j:int; var pieceTileValue:int; var fieldTileValue:int; pieceData = piece.pieceData; pieceWidth = piece.pieceWidth; pieceHeight = piece.pieceHeight; m = (Constants.FIELD_NUM_TILES - 1); while (m >= 0) { placeFound = true; insertionRow = Math.floor((m / WIDTH)); insertionCol = (m % WIDTH); i = 0; while (i < pieceHeight) { j = 0; while (j < pieceWidth) { pieceTileValue = pieceData[i][j]; fieldTileValue = fieldData[((((i + insertionRow) * WIDTH) + j) + insertionCol)]; if (((!((fieldTileValue == 0))) && (!((pieceTileValue == 0))))){ placeFound = false; }; j++; }; i++; }; if (placeFound){ return ({x:(((insertionCol + (pieceWidth / 2)) * Constants.FIELD_TILE_SIZE) + GameView.FIELD_X), y:(((insertionRow + (pieceHeight / 2)) * Constants.FIELD_TILE_SIZE) + GameView.FIELD_Y)}); }; m--; }; return (null); } public function showScoreEffect(x:int, y:int, text:String, color:uint=0xFFFFFF):void{ var effect:ScoreEffect; effect = new ScoreEffect(x, y, text, color); animationsHolder.addChild(effect); animationsHash[effect.name] = effect; } private function appendCommand(command:GameCommand):void{ var i:int; if (stateMachine.currentState.name == GameModelHSMState.PLAYING){ if (command.removeDuplicates){ i = 0; while (i < pendingCommands.length) { if (command.type == GameCommand(pendingCommands[i]).type){ var _temp1 = i; i = (i - 1); pendingCommands.splice(_temp1, 1); }; i++; }; }; pendingCommands.push(command); pendingCommands.sortOn("priority", (Array.NUMERIC | Array.DESCENDING)); }; } private function onMouseDownHandler(event:MouseEvent):void{ var selectedPowerupType:String; selectedPowerupType = hud.selectedPowerupType; if (selectedPowerupType){ appendCommand(new GameCommand(GameCommand.POWERUP_USE, selectedPowerupType)); }; } private function isHolePenalty():Boolean{ return ((holesList.length > 0)); } public function dispose():void{ var stage:Stage; fieldSprite.removeEventListener(FieldEvent.ANIMATION_COMPLETE, onFieldAnimationCompleteHandler); fieldSprite = null; piecesHolder = null; animationsHolder = null; draggingPieceHolder = null; hud.removeEventListener(HUDEvent.BUTTON_CLICK, onHUDButtonClickHandler); hud = null; soundMan = null; stage = ApplicationGlobals.STAGE; stage.removeEventListener(KeyboardEvent.KEY_DOWN, onKeyDownHandler); stage.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler); stage.removeEventListener(Event.ENTER_FRAME, onStageEnterFrameHandler); pieceFinder.dispose(); pieceFinder = null; stateMachine.dispose(); stateMachine = null; countdown.removeEventListener(CountdownEvent.TICK, onCountdownTickHandler); countdown.dispose(); countdown = null; pendingCommands = null; } private function onFieldAnimationCompleteHandler(event:FieldEvent):void{ stateMachine.sendSignalEvent(GameModelHSMEvent.ANIMATION_COMPLETE); } private function mouseDownPiece(piece:GamePiece):void{ var insertionCol:int; var insertionRow:int; if (draggingPiece){ if ((((draggingPiece.x > GamePiece.DISCARD_POSITION_X)) && ((draggingPiece.y > GamePiece.DISCARD_POSITION_Y)))){ draggingPiece.discard(); draggingPieceHolder.removeChild(draggingPiece); piecesHolder.addChild(draggingPiece); draggingPiece = null; } else { insertionCol = (((draggingPiece.x - GameView.FIELD_X) + (TILE_SIZE / 2)) / TILE_SIZE); insertionRow = (((draggingPiece.y - GameView.FIELD_Y) + (TILE_SIZE / 2)) / TILE_SIZE); tryPlacePiece(draggingPiece, insertionRow, insertionCol); }; } else { if (piece.startDraggingState()){ soundMan.playSound(SoundID.SELECT_BRICK); piecesHolder.removeChild(piece); draggingPieceHolder.addChild(piece); draggingPiece = piece; }; }; } private function onKeyDownHandler(event:KeyboardEvent):void{ if (draggingPiece){ appendCommand(new GameCommand(GameCommand.ROTATE_PIECE)); }; } public function start():void{ stateMachine.sendSignalEvent(GameModelHSMEvent.INITIALIZE); } private function onHUDButtonClickHandler(event:HUDEvent):void{ switch (event.command){ case HUDEvent.COMMAND_PAUSE: appendCommand(new GameCommand(GameCommand.PAUSE)); break; }; } public function showPowerupIcon(tileData:TileData):void{ if (!powerupIcon){ powerupIcon = new PowerupIcon(); draggingPieceHolder.addChild(powerupIcon); }; powerupIcon.x = ((tileData.col * TILE_SIZE) + GameView.FIELD_X); powerupIcon.y = ((tileData.row * TILE_SIZE) + GameView.FIELD_Y); } private function tryPlacePiece(piece:GamePiece, insertionRow:int, insertionCol:int, addScore:Boolean=true):void{ var pieceWidth:int; var pieceHeight:int; var pieceData:Array; var i:int; var j:int; var pieceTileValue:int; var colorTileValue:int; var row:int; var col:int; var index:int; var colorMatchEngine:ColorMatchEngine; var fieldTileValue:int; var scoreEffectX:Number; var scoreEffectY:Number; var placeBrickSoundID:String; pieceWidth = piece.pieceWidth; pieceHeight = piece.pieceHeight; if ((((((((insertionCol < 0)) || ((insertionRow < 0)))) || (((insertionCol + pieceWidth) > WIDTH)))) || (((insertionRow + pieceHeight) > HEIGHT)))){ appendCommand(new GameCommand(GameCommand.ROTATE_PIECE)); return; }; pieceData = piece.pieceData; i = 0; while (i < pieceHeight) { j = 0; while (j < pieceWidth) { pieceTileValue = pieceData[i][j]; index = ((((i + insertionRow) * WIDTH) + j) + insertionCol); fieldTileValue = fieldData[index]; if (((!((fieldTileValue == 0))) && (!((pieceTileValue == 0))))){ appendCommand(new GameCommand(GameCommand.ROTATE_PIECE)); return; }; j++; }; i++; }; i = 0; while (i < pieceHeight) { j = 0; while (j < pieceWidth) { pieceTileValue = pieceData[i][j]; if (pieceTileValue != 0){ colorTileValue = pieceTileValue; row = (i + insertionRow); col = (j + insertionCol); index = ((row * WIDTH) + col); fieldData[index] = pieceTileValue; EmptyTileCounter.unregisterEmptyTile(); EmptyTileCounter.unregisterHole(row, col); }; j++; }; i++; }; pieceFinder.addPiece(pieceData, colorTileValue, insertionRow, insertionCol); registerHoles(insertionRow, insertionCol, pieceHeight, pieceWidth); if (addScore){ scoreEffectX = (((insertionCol + (pieceWidth / 2)) * TILE_SIZE) + GameView.FIELD_X); scoreEffectY = (((insertionRow + (pieceHeight / 2)) * TILE_SIZE) + GameView.FIELD_Y); showScoreEffect(scoreEffectX, scoreEffectY, ("+" + String(Constants.PLACE_PIECE_SCORE))); GameInfo.levelScore = (GameInfo.levelScore + Constants.PLACE_PIECE_SCORE); hud.showScore(); placeBrickSoundID = ("placebrick_" + (int((Math.random() * 4)) + 1)); soundMan.playSound(placeBrickSoundID); }; fieldSprite.placePiece(pieceData, insertionRow, insertionCol); colorMatchEngine = new ColorMatchEngine(fieldData); fieldSprite.showBricks(colorMatchEngine.findMatches(1)); colorMatchEngine.dispose(); if (piece == draggingPiece){ piece.visible = false; appendCommand(new GameCommand(GameCommand.REMOVE_PIECE, piece)); draggingPiece = null; }; } private function stopPlaying():void{ countdown.pause(); hud.enabled = false; } private function calculateBonuses():void{ colorMatchGroups = pieceFinder.findAdjacentPieces(fieldData); holesList = EmptyTileCounter.holesList; GameInfo.addCompletedFloor(fieldData, holesList.length); } private function startColorMatchAnimation():void{ var colorGroup:Array; var minRow:int; var maxRow:int; var minCol:int; var maxCol:int; var numTiles:int; var i:int; var groupColorBonus:int; var sx:Number; var sy:Number; var r:int; var c:int; colorGroup = colorMatchGroups.pop(); minRow = int.MAX_VALUE; maxRow = int.MIN_VALUE; minCol = int.MAX_VALUE; maxCol = int.MIN_VALUE; numTiles = colorGroup.length; i = 0; while (i < numTiles) { r = colorGroup[i].row; c = colorGroup[i].col; if (r < minRow){ minRow = r; } else { if (r > maxRow){ maxRow = r; }; }; if (c < minCol){ minCol = c; } else { if (c > maxCol){ maxCol = c; }; }; i++; }; fieldSprite.showColorMatchGroup(colorGroup); groupColorBonus = (numTiles * Constants.COLOR_MATCH_BONUS); sx = (((((maxCol + minCol) / 2) + 0.5) * TILE_SIZE) + GameView.FIELD_X); sy = (((((maxRow + minRow) / 2) + 0.5) * TILE_SIZE) + GameView.FIELD_Y); showScoreEffect(sx, sy, ("Color Match!\n+" + String(groupColorBonus)), 0xFFFFFF); GameInfo.levelScore = (GameInfo.levelScore + groupColorBonus); hud.showScore(); soundMan.playSound(SoundID.BONUS_POINT); } private function registerHoles(insertionRow:int, insertionCol:int, pieceHeight:int, pieceWidth:int):void{ var i:int; var j:int; var row:int; var col:int; var index:int; var tileValue:int; i = -1; while (i < (pieceHeight + 1)) { j = -1; while (j < (pieceWidth + 1)) { row = (i + insertionRow); col = (j + insertionCol); if ((((((((row < 0)) || ((row > (HEIGHT - 1))))) || ((col < 0)))) || ((col > (WIDTH - 1))))){ } else { index = ((row * WIDTH) + col); tileValue = fieldData[index]; if (tileValue == 0){ if ((((row > 0)) && ((fieldData[(index - WIDTH)] == 0)))){ } else { if ((((row < (HEIGHT - 1))) && ((fieldData[(index + WIDTH)] == 0)))){ } else { if ((((col > 0)) && ((fieldData[(index - 1)] == 0)))){ } else { if ((((col < (WIDTH - 1))) && ((fieldData[(index + 1)] == 0)))){ } else { EmptyTileCounter.registerHole(row, col); }; }; }; }; }; }; j++; }; i++; }; } private function completeLevel():void{ dispatchEvent(new ModelEvent(ModelEvent.LEVEL_COMPLETE)); } private function playingStateDoAction():void{ var commandQueue:Array; var numActivePieces:int; var piece:IUpdatable; var command:GameCommand; var _local7:TileData; var _local8:TileData; var pendingHintType:String; var _local10:Object; var actPowerupHintProps:Object; if (EmptyTileCounter.isGameComplete()){ appendCommand(new GameCommand(GameCommand.COMPLETE_FLOOR)); }; commandQueue = pendingCommands.slice(); pendingCommands = []; while (commandQueue.length > 0) { command = commandQueue.pop(); switch (command.type){ case GameCommand.ROTATE_PIECE: soundMan.playSound(SoundID.ROTATE); draggingPiece.rotateClockwise90(); break; case GameCommand.PIECE_MOUSE_DOWN: mouseDownPiece((command.data as GamePiece)); break; case GameCommand.COMPLETE_FLOOR: stateMachine.sendSignalEvent(GameModelHSMEvent.FLOOR_COMPLETE); break; case GameCommand.ADD_PIECE: addPiece(); break; case GameCommand.REMOVE_PIECE: removePiece((command.data as GamePiece)); break; case GameCommand.POWERUP_USE: usePowerup((command.data as String)); break; case GameCommand.SHOW_POPUP: showHintPopup((command.data as Object)); break; case GameCommand.PAUSE: stateMachine.sendSignalEvent(GameModelHSMEvent.PAUSE); break; }; if (command.cancelPendingCommands){ return; }; }; if (!draggingPiece){ switch (hud.selectedPowerupType){ case null: hidePowerupIcon(); break; case PowerupType.ADD_SINGLE_BRICK: _local7 = getTileUnderCursor(); if (((_local7) && ((_local7.value == 0)))){ showPowerupIcon(_local7); } else { hidePowerupIcon(); }; break; case PowerupType.REMOVE_SINGLE_BRICK: _local8 = getTileUnderCursor(); if (((_local8) && ((_local8.value > 0)))){ showPowerupIcon(_local8); } else { hidePowerupIcon(); }; break; }; }; numActivePieces = 0; for each (piece in piecesHash) { piece.update(); numActivePieces++; }; nextHintPopupDelay--; if (nextHintPopupDelay < 0){ pendingHintType = HintManager.pendingHintType(); switch (pendingHintType){ case HintType.ACTIVATE_POWERUP: _local10 = hud.getActivePowerupButtonPosition(); if (((_local10) && (!(POWERUPS_USED_ONCE)))){ actPowerupHintProps = {type:HintType.ACTIVATE_POWERUP, x:_local10.x, y:_local10.y}; appendCommand(new GameCommand(GameCommand.SHOW_POPUP, actPowerupHintProps)); }; break; }; nextHintPopupDelay = HINT_POPUP_DELAY; }; nextPieceAppearCounter = (nextPieceAppearCounter - Constants.PIECE_SPEED_ON_CONVEYOR); if ((((numActivePieces == 1)) && (!((draggingPiece == null))))){ if (nextPieceAppearCounter > GAP_BETWEEN_PIECES_ON_CONVEYOR){ nextPieceAppearCounter = GAP_BETWEEN_PIECES_ON_CONVEYOR; }; }; if (nextPieceAppearCounter <= 0){ appendCommand(new GameCommand(GameCommand.ADD_PIECE)); }; } public function hidePowerupIcon():void{ if (powerupIcon){ draggingPieceHolder.removeChild(powerupIcon); powerupIcon = null; }; } private function onPieceMouseDownHandler(event:MouseEvent):void{ appendCommand(new GameCommand(GameCommand.PIECE_MOUSE_DOWN, event.target)); } private function dumpFloorData():void{ var i:int; var str:String; var j:int; i = 0; while (i < HEIGHT) { str = ""; j = 0; while (j < WIDTH) { str = (str + (fieldData[((i * WIDTH) + j)] + ", ")); j++; }; trace(str); i++; }; } private function initializeLevel():void{ GameInfo.initializeNewLevel(); countdown = new Countdown(GameInfo.time); countdown.addEventListener(CountdownEvent.TICK, onCountdownTickHandler); hud.showPowerups(); hud.showScore(); hud.showTimer(); hud.showFloor(0); } private function showStartLevelPopup():void{ dispatchEvent(new ModelEvent(ModelEvent.POPUP_INVOKE, PopupType.START_LEVEL)); } private function startHolePenaltyAnimation():void{ var tile:TileData; var sx:Number; var sy:Number; tile = holesList.pop(); fieldSprite.fillHole(tile); sx = (((tile.col + 0.5) * TILE_SIZE) + GameView.FIELD_X); sy = (((tile.row + 0.5) * TILE_SIZE) + GameView.FIELD_Y); showScoreEffect(sx, sy, ("Hole Penalty!\n-" + String(Constants.HOLE_PENALTY)), 0xFF0000); GameInfo.levelScore = (GameInfo.levelScore - Constants.HOLE_PENALTY); hud.showScore(); soundMan.playSound(SoundID.PENALTY); } private function usePowerup(powerupType:String):void{ var tile:TileData; var newSinglePiece:GamePiece; var splittedPieces:Array; var colorMatchEngine:ColorMatchEngine; var effect:BrickDebris; tile = getTileUnderCursor(); switch (powerupType){ case PowerupType.ADD_SINGLE_BRICK: if (((tile) && ((tile.value == 0)))){ newSinglePiece = new GamePiece(PieceConfig.SINGLE_BRICK_PIECE); tryPlacePiece(newSinglePiece, tile.row, tile.col, false); hud.usePowerup(powerupType); soundMan.playSound(SoundID.ADD_BRICK); POWERUPS_USED_ONCE = true; }; break; case PowerupType.REMOVE_SINGLE_BRICK: if (((tile) && ((tile.value > 0)))){ fieldData[((tile.row * WIDTH) + tile.col)] = 0; EmptyTileCounter.registerEmptyTile(); registerHoles(tile.row, tile.col, 1, 1); splittedPieces = pieceFinder.makeHole(tile.row, tile.col); colorMatchEngine = new ColorMatchEngine(fieldData); fieldSprite.showBricks(colorMatchEngine.findMatches(1)); colorMatchEngine.dispose(); effect = new BrickDebris(tile.value); effect.x = ((tile.col * TILE_SIZE) + GameView.FIELD_X); effect.y = ((tile.row * TILE_SIZE) + GameView.FIELD_Y); animationsHolder.addChild(effect); animationsHash[effect.name] = effect; hud.usePowerup(powerupType); soundMan.playSound(SoundID.SMASH_BRICK); POWERUPS_USED_ONCE = true; }; break; }; } protected function initializeFloor():void{ var i:int; var row:int; var col:int; var numAdjacentTiles:int; GameInfo.floor++; hud.showFloor(); fieldData = Levels.getFloorData(GameInfo.level, GameInfo.floor); EmptyTileCounter.reset(); i = 0; while (i < NUM_TILES) { if (fieldData[i] == 0){ EmptyTileCounter.registerEmptyTile(); row = Math.floor((i / WIDTH)); col = (i % WIDTH); numAdjacentTiles = 0; if (((!((row == 0))) && ((fieldData[(i - WIDTH)] == 0)))){ numAdjacentTiles++; }; if (((!((row == (HEIGHT - 1)))) && ((fieldData[(i + WIDTH)] == 0)))){ numAdjacentTiles++; }; if (((!((col == 0))) && ((fieldData[(i - 1)] == 0)))){ numAdjacentTiles++; }; if (((!((col == (WIDTH - 1)))) && ((fieldData[(i + 1)] == 0)))){ numAdjacentTiles++; }; if (numAdjacentTiles == 0){ EmptyTileCounter.registerHole(row, col); }; }; i++; }; fieldSprite.scrollToNextFloor(fieldData); } private function addPiece():void{ var pieceData:Array; var piece:GamePiece; pieceData = PieceConfig.getRandomPieceData(); piece = new GamePiece(pieceData); piece.addEventListener(PieceEvent.DISCARDED, onPieceDiscardHandler); piece.addEventListener(MouseEvent.MOUSE_DOWN, onPieceMouseDownHandler); piecesHash[piece.name] = piece; piecesHolder.addChild(piece); nextPieceAppearCounter = (piece.width + GAP_BETWEEN_PIECES_ON_CONVEYOR); } private function showHintPopup(props:Object):void{ var popup:AbstractView; popup = HintManager.getHintPopup(props); if (popup){ stateMachine.sendSignalEvent(GameModelHSMEvent.HINT); dispatchEvent(new ModelEvent(ModelEvent.POPUP_INVOKE, popup)); }; } private function showPauseMenu():void{ dispatchEvent(new ModelEvent(ModelEvent.PAUSE)); } } }//package underConstruction.views.playField
Section 142
//GameModelHSMEvent (underConstruction.views.playField.GameModelHSMEvent) package underConstruction.views.playField { public class GameModelHSMEvent { public static const HINT:String = "hint"; public static const INITIALIZE:String = "initialize"; public static const FLOOR_COMPLETE:String = "floor_complete"; public static const ANIMATION_COMPLETE:String = "animation_complete"; public static const PAUSE:String = "pause"; public static const PLAYING_RESUME:String = "playing_resume"; public function GameModelHSMEvent(){ super(); } } }//package underConstruction.views.playField
Section 143
//GameModelHSMState (underConstruction.views.playField.GameModelHSMState) package underConstruction.views.playField { public class GameModelHSMState { public static const CALCULATE_HOLE_PENALTY:String = "calculate_hole_penalty"; public static const SHOW_NEXT_HOLE_PENALTY_ANIMATION_CHOICE:String = "show_next_hole_penalty_animation_choice"; public static const HOLE_PENALTY_ANIMATION:String = "hole_penalty_animation"; public static const HINT_POPUP:String = "hint_popup"; public static const PLAYING:String = "playing"; public static const PAUSE:String = "pause"; public static const CALCULATE_COLORMATCH_BONUS:String = "calculate_colormatch_bonus"; public static const INITIAL:String = "initial"; public static const INITIAL_HOLE_PENALTY:String = "initial_hole_penalty"; public static const COLORMATCH_ANIMATION:String = "colormatch_animation"; public static const FINAL:String = "final"; public static const START_LEVEL_POPUP:String = "start_level_popup"; public static const SHOW_NEXT_COLORMATCH_ANIMATION_CHOICE:String = "show_next_colormatch_animation_choice"; public static const CONTINUE_LEVEL_CHOICE:String = "continue_level_choice"; public static const INITIAL_COLORMATCH_BONUS:String = "initial_colormatch_bonus"; public static const FIELD_ANIMATION:String = "field_animation"; public function GameModelHSMState(){ super(); } } }//package underConstruction.views.playField
Section 144
//GamePiece (underConstruction.views.playField.GamePiece) package underConstruction.views.playField { import flash.display.*; import gamework.statemachine.hsm.*; import flash.filters.*; import underConstruction.views.playField.events.*; import gamework.core.*; import underConstruction.data.*; public class GamePiece extends Sprite implements IDisposable, IUpdatable { private var shadow:DropShadowFilter; private var _pieceData:Array; private var stateMachine:HSM; private var _height:int; private var tilesHolder:Sprite; private var _tileClips:Array; private var disposeArrowClip:Sprite; private var bevel:BevelFilter; private var dy:int;// = 0 private var _width:int; public static const DISCARD_POSITION_X:int = 500; public static const DISCARD_POSITION_Y:int = 300; public function GamePiece(data:Array){ _pieceData = []; _tileClips = []; dy = 0; super(); shadow = new DropShadowFilter(4, 45, 0, 0.7, 8, 8); bevel = new BevelFilter(2, 45, 0xFFFFFF, 1, 0, 1, 4, 4); tilesHolder = new Sprite(); addChild(tilesHolder); tilesHolder.filters = [bevel]; mouseChildren = false; _pieceData = data; _height = _pieceData.length; _width = _pieceData[0].length; x = (-(_width) * GameModel.TILE_SIZE); y = (450 - (_height * GameModel.TILE_SIZE)); draw(); stateMachine = new HSM("GamePiece HSM"); stateMachine.addState(new InitialState(GamePieceHSMState.INITIAL, null)); stateMachine.addState(new CompositeState(GamePieceHSMState.ON_CONVEYOR, null, null, onConveyorStateDoAction)); stateMachine.addState(new CompositeState(GamePieceHSMState.DRAGGING, null, draggingStateEntryAction, draggingStateDoAction, draggingStateExitAction)); stateMachine.addState(new CompositeState(GamePieceHSMState.FALLING_OFF_CONVEYOR, null, null, discardingDoAction)); stateMachine.addState(new CompositeState(GamePieceHSMState.DISCARDING, null, null, discardingDoAction)); stateMachine.addState(new FinalState(GamePieceHSMState.FINAL, null, finalStateEntryAction)); stateMachine.addTransition(GamePieceHSMState.INITIAL, GamePieceHSMState.ON_CONVEYOR); stateMachine.addTransition(GamePieceHSMState.ON_CONVEYOR, GamePieceHSMState.DRAGGING, new SignalEvent(GamePieceHSMEvent.START_DRAG)); stateMachine.addTransition(GamePieceHSMState.DRAGGING, GamePieceHSMState.FINAL, new SignalEvent(GamePieceHSMEvent.PLACE)); stateMachine.addTransition(GamePieceHSMState.ON_CONVEYOR, GamePieceHSMState.FALLING_OFF_CONVEYOR, new SignalEvent(GamePieceHSMEvent.DISCARD)); stateMachine.addTransition(GamePieceHSMState.FALLING_OFF_CONVEYOR, GamePieceHSMState.FINAL, new SignalEvent(GamePieceHSMEvent.ANIMATION_COMPLETE)); stateMachine.addTransition(GamePieceHSMState.DRAGGING, GamePieceHSMState.DISCARDING, new SignalEvent(GamePieceHSMEvent.DISCARD)); stateMachine.addTransition(GamePieceHSMState.DISCARDING, GamePieceHSMState.FINAL, new SignalEvent(GamePieceHSMEvent.ANIMATION_COMPLETE)); stateMachine.start(); } private function draggingStateExitAction():void{ removeDisposeArrowClip(); tilesHolder.filters = [bevel]; } public function dispose():void{ stateMachine.dispose(); stateMachine = null; removeDisposeArrowClip(); _pieceData = null; removeChild(tilesHolder); tilesHolder = null; } override public function get height():Number{ return ((_height * GameModel.TILE_SIZE)); } private function removeDisposeArrowClip():void{ if (disposeArrowClip){ removeChild(disposeArrowClip); disposeArrowClip = null; }; } private function draggingStateDoAction():void{ var newX:int; var newY:int; newX = (stage.mouseX - (width / 2)); newY = (stage.mouseY - (height / 2)); x = newX; y = newY; if ((((x > DISCARD_POSITION_X)) && ((y > DISCARD_POSITION_Y)))){ if (!disposeArrowClip){ disposeArrowClip = new DisposeArrowClip(); addChild(disposeArrowClip); }; disposeArrowClip.x = (width / 2); disposeArrowClip.y = (height / 2); } else { removeDisposeArrowClip(); }; } private function draw():void{ var i:int; var tile:MovieClip; var j:int; var tileValue:int; var newTile:Tile; while (_tileClips.length > 0) { tile = MovieClip(_tileClips.pop()); tilesHolder.removeChild(tile); }; _tileClips = []; i = 0; while (i < _height) { j = 0; while (j < _width) { tileValue = _pieceData[i][j]; newTile = new Tile(); newTile.gotoAndStop((tileValue + 1)); newTile.x = (j * GameModel.TILE_SIZE); newTile.y = (i * GameModel.TILE_SIZE); tilesHolder.addChild(newTile); _tileClips.push(newTile); j++; }; i++; }; } private function discardingDoAction():void{ y = (y + dy); dy = (dy + 2); if (y > 480){ stateMachine.sendSignalEvent(GamePieceHSMEvent.ANIMATION_COMPLETE); }; } private function draggingStateEntryAction():void{ tilesHolder.filters = [bevel, shadow]; } public function get pieceWidth():int{ return (_width); } private function onConveyorStateDoAction():void{ x = (x + Constants.PIECE_SPEED_ON_CONVEYOR); if (x > 550){ stateMachine.sendSignalEvent(GamePieceHSMEvent.DISCARD); }; } private function finalStateEntryAction():void{ dispatchEvent(new PieceEvent(PieceEvent.DISCARDED)); } public function startDraggingState():Boolean{ var result:Boolean; result = stateMachine.sendSignalEvent(GamePieceHSMEvent.START_DRAG); return (result); } public function get pieceHeight():int{ return (_height); } public function get centerX():Number{ return ((x + (width / 2))); } public function dumpData():void{ var i:int; i = 0; while (i < _height) { trace(_pieceData[i]); i++; }; } override public function get width():Number{ return ((_width * GameModel.TILE_SIZE)); } public function update():void{ stateMachine.update(); } public function get onConveyor():Boolean{ return ((stateMachine.currentState.name == GamePieceHSMState.ON_CONVEYOR)); } public function get centerY():Number{ return ((y + (height / 2))); } public function discard():void{ stateMachine.sendSignalEvent(GamePieceHSMEvent.DISCARD); } public function get pieceData():Array{ return (_pieceData); } public function rotateClockwise90():void{ var rotatedData:Array; var i:int; var newRow:Array; var j:int; rotatedData = []; i = 0; while (i < _width) { newRow = []; j = 0; while (j < _height) { newRow.unshift(_pieceData[j][i]); j++; }; rotatedData.push(newRow); i++; }; _pieceData = rotatedData; _height = _pieceData.length; _width = _pieceData[0].length; draw(); x = (stage.mouseX - (width / 2)); y = (stage.mouseY - (height / 2)); } } }//package underConstruction.views.playField
Section 145
//GamePieceHSMEvent (underConstruction.views.playField.GamePieceHSMEvent) package underConstruction.views.playField { public class GamePieceHSMEvent { public static const START_DRAG:String = "start_drag"; public static const ANIMATION_COMPLETE:String = "animation_complete"; public static const PLACE:String = "place"; public static const DISCARD:String = "discard"; public function GamePieceHSMEvent(){ super(); } } }//package underConstruction.views.playField
Section 146
//GamePieceHSMState (underConstruction.views.playField.GamePieceHSMState) package underConstruction.views.playField { public class GamePieceHSMState { public static const INITIAL:String = "initial"; public static const DRAGGING:String = "dragging"; public static const ON_CONVEYOR:String = "on_conveyor"; public static const FALLING_OFF_CONVEYOR:String = "falling_off_conveyor"; public static const FINAL:String = "final"; public static const DISCARDING:String = "discarding"; public function GamePieceHSMState(){ super(); } } }//package underConstruction.views.playField
Section 147
//GameView (underConstruction.views.playField.GameView) package underConstruction.views.playField { import gamework.sound.*; import flash.display.*; import underConstruction.views.*; import underConstruction.views.playField.ui.*; import underConstruction.views.playField.events.*; import underConstruction.events.*; import underConstruction.data.*; import underConstruction.sound.*; import underConstruction.popups.*; import underConstruction.views.main.*; public class GameView extends AbstractView { protected var model:GameModel; protected var background:Sprite; protected var trashBinSprite:Sprite; protected var fieldSprite:Field; protected var piecesHolder:Sprite; protected var draggingPieceHolder:Sprite; protected var animationsHolder:Sprite; public var _backgroundClip:MovieClip; protected var fieldSpriteMask:Shape; protected var hud:HUD; public static const FIELD_X:int = 40; public static const FIELD_Y:int = 60; public function GameView(){ super(); initialize(); } protected function onPopupCloseHandler(event:PopupEvent):void{ removePopup(); model.unpause(); } protected function createChildren():void{ var _backgroundFrame:int; _backgroundFrame = ((GameInfo.level % _backgroundClip.totalFrames) + 1); _backgroundClip.gotoAndStop(_backgroundFrame); background = new Sprite(); background.mouseChildren = false; background.mouseEnabled = false; addChild(background); hud = new HUD(); addChild(hud); fieldSprite = new Field(); fieldSprite.x = FIELD_X; fieldSprite.y = FIELD_Y; addChild(fieldSprite); fieldSpriteMask = new Shape(); fieldSpriteMask.graphics.beginFill(0); fieldSpriteMask.graphics.drawRect(FIELD_X, FIELD_Y, (GameModel.WIDTH * GameModel.TILE_SIZE), (GameModel.HEIGHT * GameModel.TILE_SIZE)); fieldSpriteMask.graphics.endFill(); fieldSprite.mask = fieldSpriteMask; piecesHolder = new Sprite(); addChild(piecesHolder); animationsHolder = new Sprite(); animationsHolder.mouseChildren = false; animationsHolder.mouseEnabled = false; addChild(animationsHolder); draggingPieceHolder = new Sprite(); addChild(draggingPieceHolder); trashBinSprite = new TrashBinSprite(); trashBinSprite.mouseEnabled = false; trashBinSprite.x = 535; trashBinSprite.y = 447; addChild(trashBinSprite); } protected function onModelPauseHandler(event:ModelEvent):void{ popup = new PausePopup(); popup.addEventListener(PopupEvent.CLOSE, onPausePopupCloseHandler); addChild(popup); } override public function dispose():void{ super.dispose(); model.removeEventListener(ModelEvent.PAUSE, onModelPauseHandler); model.removeEventListener(ModelEvent.LEVEL_COMPLETE, onLevelCompleteHandler); model.removeEventListener(ModelEvent.POPUP_INVOKE, onLevelPopupInvokeHandler); model.dispose(); model = null; } protected function onLevelPopupInvokeHandler(event:ModelEvent):void{ var popupType:String; popupType = (event.data as String); switch (popupType){ case PopupType.START_LEVEL: popup = new StartLevelPopup(); popup.addEventListener(PopupEvent.CLOSE, onPopupCloseHandler); addChild(popup); break; default: popup = (event.data as AbstractView); popup.addEventListener(PopupEvent.CLOSE, onPopupCloseHandler); addChild(popup); break; }; } protected function onLevelCompleteHandler(event:ModelEvent):void{ dispatchEvent(new ViewEvent(ViewEvent.COMPLETE, MainHSMEvent.LEVEL_COMPLETE)); } protected function onPausePopupCloseHandler(event:PopupEvent):void{ switch (event.data){ case PausePopupSelectedOption.RESUME: removePopup(); model.unpause(); break; case PausePopupSelectedOption.MAIN_MENU: dispatchEvent(new ViewEvent(ViewEvent.COMPLETE, MainHSMEvent.GAME_QUIT)); break; case PausePopupSelectedOption.RESTART: dispatchEvent(new ViewEvent(ViewEvent.COMPLETE, MainHSMEvent.GAME_RESTART)); break; }; } protected function initialize():void{ SoundManager.getInstance().setSoundVolume(SoundID.IN_GAME_MUSIC, 0.25); createChildren(); model = new GameModel(fieldSprite, piecesHolder, animationsHolder, draggingPieceHolder, hud); model.addEventListener(ModelEvent.PAUSE, onModelPauseHandler); model.addEventListener(ModelEvent.LEVEL_COMPLETE, onLevelCompleteHandler); model.addEventListener(ModelEvent.POPUP_INVOKE, onLevelPopupInvokeHandler); model.start(); } } }//package underConstruction.views.playField
Section 148
//PieceConfig (underConstruction.views.playField.PieceConfig) package underConstruction.views.playField { public class PieceConfig { private static const COLOR_DATA:Array = [1, 1, 2, 2, 3, 3, 4, 4, 5, 5]; private static const DATA:Array = [[[1, 1]], [[1, 1, 1]], [[1, 1, 1, 1]], [[1, 1, 1], [0, 0, 1]], [[1, 1, 1], [1, 0, 0]], [[1, 1], [1, 1]], [[1, 1], [1, 0]], [[0, 1, 1], [1, 1, 0]], [[1, 1, 0], [0, 1, 1]], [[1, 1, 1], [0, 1, 0]]]; private static var previousIndex:int = -1; public function PieceConfig(){ super(); } public static function get SINGLE_BRICK_PIECE():Array{ return ([[30]]); } public static function getRandomPieceData(maxIndex:int=9):Array{ var pieceData:Array; var data:Array; var colorIndex:int; var width:int; var height:int; var i:int; var randomIndex:int; var row:Array; var j:int; while (true) { randomIndex = Math.floor((Math.random() * (maxIndex + 1))); if (Math.random() < 0.15){ randomIndex = 0; }; if (randomIndex != previousIndex){ previousIndex = randomIndex; break; }; }; pieceData = new Array(); data = DATA[randomIndex]; colorIndex = COLOR_DATA[randomIndex]; width = data[0].length; height = data.length; i = 0; while (i < height) { row = new Array(); j = 0; while (j < width) { row.push((data[i][j] * colorIndex)); j++; }; pieceData.push(row); i++; }; return (pieceData); } } }//package underConstruction.views.playField
Section 149
//PowerupType (underConstruction.views.playField.PowerupType) package underConstruction.views.playField { public class PowerupType { public static const ADD_SINGLE_BRICK:String = "add_single_brick"; public static const REMOVE_SINGLE_BRICK:String = "remove_single_brick"; public function PowerupType(){ super(); } } }//package underConstruction.views.playField
Section 150
//TileData (underConstruction.views.playField.TileData) package underConstruction.views.playField { import gamework.utils.*; public class TileData { private var _col:int; private var _value:int; private var _row:int; public function TileData(row:int, col:int, value:int=-1){ super(); _row = row; _col = col; _value = value; } public function get col():int{ return (_col); } public function toString():String{ return (ObjectUtil.formatToString(this, "row", "col", "value")); } public function get value():int{ return (_value); } public function get row():int{ return (_row); } public function clone():TileData{ return (new TileData(_row, _col, _value)); } } }//package underConstruction.views.playField
Section 151
//AbstractView (underConstruction.views.AbstractView) package underConstruction.views { import gamework.ui.*; public class AbstractView extends WidgetContainer { protected var popup:AbstractView; protected var subview:AbstractView; public function AbstractView(){ super(); } override public function dispose():void{ removePopup(); removeSubview(); super.dispose(); } protected function removePopup():void{ if (popup){ popup.dispose(); removeChild(popup); popup = null; }; } protected function removeSubview():void{ if (subview){ subview.dispose(); removeChild(subview); subview = null; }; } } }//package underConstruction.views
Section 152
//Main (underConstruction.Main) package underConstruction { import gamework.application.*; import flash.display.*; import flash.events.*; import gamework.preloaders.*; import gamework.ui.*; import flash.net.*; import flash.system.*; public class Main extends Application { private var _preloader:TwoDPlayPreloader; private var ad:Sprite; private var adLoader:Loader; private var BigWigGameData:Object; public static const USE_PRELOADER:Boolean = true; public function Main(){ BigWigGameData = {}; super(); } private function preload():void{ _preloader = new TwoDPlayPreloader(); addChild(_preloader); startPreloading(_preloader); } private function onAdCompleteHandler(event:Event):void{ var event = event; adLoader.contentLoaderInfo.sharedEvents.removeEventListener("BigwigInGameAdComplete", onAdCompleteHandler); adLoader.unload(); //unresolved jump var _slot1 = error; ad.removeChild(adLoader); adLoader = null; removeChild(ad); ad = null; preload(); } public function getBigWigWrappedGameData():Object{ return (BigWigGameData); } override protected function completePreloading():void{ if (_preloader){ removeChild(_preloader); _preloader = null; }; super.completePreloading(); removeBackground(); createMainView("underConstruction.views.main.MainView"); } override protected function initialize():void{ super.initialize(); setGlobals("1715", "1.0.0.0", "com.bigwigmedia.underConstruction"); createMask(); createBackground(0xFFFFFF); this.contextMenu = ApplicationContextMenu.getMenu(); BigWigGameData.url = this.loaderInfo.url; BigWigGameData.gameid = ApplicationGlobals.ID; BigWigGameData.affid = this.loaderInfo.parameters.affid; Security.allowDomain("adserver.bigwigmedia.com"); if (USE_PRELOADER){ if (Security.sandboxType != Security.LOCAL_WITH_FILE){ ad = new Sprite(); ad.graphics.lineStyle(); ad.graphics.beginFill(0xFFFFFF); ad.graphics.drawRect(0, 0, 400, 350); ad.graphics.endFill(); ad.x = ((ApplicationGlobals.WIDTH - 400) / 2); ad.y = ((ApplicationGlobals.HEIGHT - 350) / 2); addChild(ad); adLoader = new Loader(); ad.addChild(adLoader); adLoader.contentLoaderInfo.sharedEvents.addEventListener("BigwigInGameAdComplete", onAdCompleteHandler); adLoader.load(new URLRequest("http://adserver.bigwigmedia.com/ingamead3.swf")); } else { preload(); }; } else { startPreloading(); }; } } }//package underConstruction
Section 153
//AddBrick (AddBrick) package { import flash.media.*; public dynamic class AddBrick extends Sound { public function AddBrick(){ super(); } } }//package
Section 154
//BonusPoint (BonusPoint) package { import flash.media.*; public dynamic class BonusPoint extends Sound { public function BonusPoint(){ super(); } } }//package
Section 155
//BrickDispose (BrickDispose) package { import flash.media.*; public dynamic class BrickDispose extends Sound { public function BrickDispose(){ super(); } } }//package
Section 156
//BuildingBrick (BuildingBrick) package { import flash.display.*; public dynamic class BuildingBrick extends MovieClip { public function BuildingBrick(){ super(); } } }//package
Section 157
//DisposeArrowClip (DisposeArrowClip) package { import flash.display.*; public dynamic class DisposeArrowClip extends MovieClip { public function DisposeArrowClip(){ super(); } } }//package
Section 158
//InGameMusic (InGameMusic) package { import flash.media.*; public dynamic class InGameMusic extends Sound { public function InGameMusic(){ super(); } } }//package
Section 159
//NavigateArrowButton (NavigateArrowButton) package { import gamework.ui.*; public dynamic class NavigateArrowButton extends IconicFramedButtonWidget { public function NavigateArrowButton(){ super(); } } }//package
Section 160
//Penalty (Penalty) package { import flash.media.*; public dynamic class Penalty extends Sound { public function Penalty(){ super(); } } }//package
Section 161
//PlaceBrick_1 (PlaceBrick_1) package { import flash.media.*; public dynamic class PlaceBrick_1 extends Sound { public function PlaceBrick_1(){ super(); } } }//package
Section 162
//PlaceBrick_2 (PlaceBrick_2) package { import flash.media.*; public dynamic class PlaceBrick_2 extends Sound { public function PlaceBrick_2(){ super(); } } }//package
Section 163
//PlaceBrick_3 (PlaceBrick_3) package { import flash.media.*; public dynamic class PlaceBrick_3 extends Sound { public function PlaceBrick_3(){ super(); } } }//package
Section 164
//PlaceBrick_4 (PlaceBrick_4) package { import flash.media.*; public dynamic class PlaceBrick_4 extends Sound { public function PlaceBrick_4(){ super(); } } }//package
Section 165
//PowerupIcon (PowerupIcon) package { import flash.display.*; public dynamic class PowerupIcon extends MovieClip { public function PowerupIcon(){ super(); } } }//package
Section 166
//Rotate (Rotate) package { import flash.media.*; public dynamic class Rotate extends Sound { public function Rotate(){ super(); } } }//package
Section 167
//SelectBrick (SelectBrick) package { import flash.media.*; public dynamic class SelectBrick extends Sound { public function SelectBrick(){ super(); } } }//package
Section 168
//SmashBrick (SmashBrick) package { import flash.media.*; public dynamic class SmashBrick extends Sound { public function SmashBrick(){ super(); } } }//package
Section 169
//Tile (Tile) package { import flash.display.*; public dynamic class Tile extends MovieClip { public function Tile(){ super(); } } }//package
Section 170
//TrashBinSprite (TrashBinSprite) package { import flash.display.*; public dynamic class TrashBinSprite extends Sprite { public function TrashBinSprite(){ super(); } } }//package
Section 171
//TwoDPlayButton (TwoDPlayButton) package { import gamework.ui.*; public dynamic class TwoDPlayButton extends IconicButtonWidget { public function TwoDPlayButton(){ super(); } } }//package
Section 172
//UIButtonPress (UIButtonPress) package { import flash.media.*; public dynamic class UIButtonPress extends Sound { public function UIButtonPress(){ super(); } } }//package

Library Items

Symbol 1 GraphicUsed by:83
Symbol 2 ShapeTweeningUsed by:76
Symbol 3 GraphicUsed by:76
Symbol 4 SoundUsed by:76
Symbol 5 GraphicUsed by:76
Symbol 6 GraphicUsed by:76
Symbol 7 GraphicUsed by:76
Symbol 8 GraphicUsed by:76
Symbol 9 GraphicUsed by:76
Symbol 10 GraphicUsed by:76
Symbol 11 GraphicUsed by:76
Symbol 12 GraphicUsed by:76
Symbol 13 GraphicUsed by:76
Symbol 14 GraphicUsed by:76
Symbol 15 GraphicUsed by:76
Symbol 16 GraphicUsed by:76
Symbol 17 GraphicUsed by:76
Symbol 18 GraphicUsed by:76
Symbol 19 GraphicUsed by:76
Symbol 20 GraphicUsed by:76
Symbol 21 GraphicUsed by:76
Symbol 22 GraphicUsed by:76
Symbol 23 GraphicUsed by:76
Symbol 24 GraphicUsed by:76
Symbol 25 GraphicUsed by:76
Symbol 26 GraphicUsed by:76
Symbol 27 GraphicUsed by:76
Symbol 28 GraphicUsed by:76
Symbol 29 GraphicUsed by:76
Symbol 30 GraphicUsed by:76
Symbol 31 GraphicUsed by:76
Symbol 32 GraphicUsed by:76
Symbol 33 GraphicUsed by:76
Symbol 34 GraphicUsed by:76
Symbol 35 GraphicUsed by:76
Symbol 36 GraphicUsed by:76
Symbol 37 GraphicUsed by:76
Symbol 38 GraphicUsed by:76
Symbol 39 GraphicUsed by:76
Symbol 40 GraphicUsed by:76
Symbol 41 GraphicUsed by:76
Symbol 42 GraphicUsed by:76
Symbol 43 GraphicUsed by:76
Symbol 44 GraphicUsed by:76
Symbol 45 GraphicUsed by:76
Symbol 46 GraphicUsed by:76
Symbol 47 GraphicUsed by:76
Symbol 48 GraphicUsed by:76
Symbol 49 GraphicUsed by:76
Symbol 50 GraphicUsed by:76
Symbol 51 GraphicUsed by:76
Symbol 52 GraphicUsed by:76
Symbol 53 GraphicUsed by:76
Symbol 54 GraphicUsed by:76
Symbol 55 GraphicUsed by:76
Symbol 56 GraphicUsed by:76
Symbol 57 GraphicUsed by:76
Symbol 58 GraphicUsed by:76
Symbol 59 GraphicUsed by:76
Symbol 60 SoundUsed by:76
Symbol 61 GraphicUsed by:76
Symbol 62 GraphicUsed by:76
Symbol 63 ShapeTweeningUsed by:76
Symbol 64 GraphicUsed by:76
Symbol 65 GraphicUsed by:76
Symbol 66 SoundUsed by:76
Symbol 67 GraphicUsed by:76
Symbol 68 SoundUsed by:76
Symbol 69 GraphicUsed by:76
Symbol 70 GraphicUsed by:76
Symbol 71 GraphicUsed by:76
Symbol 72 GraphicUsed by:76
Symbol 73 GraphicUsed by:76
Symbol 74 SoundUsed by:76
Symbol 75 GraphicUsed by:76
Symbol 76 MovieClipUses:2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75Used by:83
Symbol 77 GraphicUsed by:82
Symbol 78 GraphicUsed by:79
Symbol 79 MovieClipUses:78Used by:82
Symbol 80 GraphicUsed by:82 239 284
Symbol 81 GraphicUsed by:82
Symbol 82 MovieClip {under_fla.preloader_progress_bar_61}Uses:77 79 80 81Used by:83
Symbol 83 MovieClipUses:1 76 82Used by:302
Symbol 84 FontUsed by:85 236 237 238 303
Symbol 85 EditableTextUses:84Used by:302
Symbol 86 GraphicUsed by:113
Symbol 87 GraphicUsed by:88 131
Symbol 88 MovieClipUses:87Used by:113 149 161
Symbol 89 GraphicUsed by:90 131
Symbol 90 MovieClipUses:89Used by:113 149 161
Symbol 91 GraphicUsed by:113
Symbol 92 GraphicUsed by:93 131
Symbol 93 MovieClipUses:92Used by:113 149 161
Symbol 94 FontUsed by:95 100 103 104 107 111 112 114 130 143 144 145 146 148 157 158 160 169 170 171 277 278
Symbol 95 TextUses:94Used by:113
Symbol 96 GraphicUsed by:97
Symbol 97 MovieClipUses:96Used by:113
Symbol 98 GraphicUsed by:113
Symbol 99 GraphicUsed by:113
Symbol 100 TextUses:94Used by:113
Symbol 101 GraphicUsed by:113
Symbol 102 GraphicUsed by:113
Symbol 103 TextUses:94Used by:113
Symbol 104 TextUses:94Used by:113
Symbol 105 GraphicUsed by:113
Symbol 106 GraphicUsed by:113
Symbol 107 TextUses:94Used by:113
Symbol 108 GraphicUsed by:113
Symbol 109 GraphicUsed by:113
Symbol 110 GraphicUsed by:113
Symbol 111 TextUses:94Used by:113
Symbol 112 TextUses:94Used by:113
Symbol 113 MovieClip {under_fla.HintPopupMovie_3}Uses:86 88 90 91 93 95 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112Used by:116
Symbol 114 EditableTextUses:94 156Used by:115
Symbol 115 MovieClip {gamework.ui.TextButtonWidget}Uses:114Used by:116 131 149 175 239 242 243 244 279 284 302
Symbol 116 MovieClip {underConstruction.popups.HintPopup}Uses:113 115Used by:302
Symbol 117 GraphicUsed by:118
Symbol 118 MovieClip {TrashBinSprite}Uses:117Used by:302
Symbol 119 GraphicUsed by:121
Symbol 120 GraphicUsed by:121
Symbol 121 MovieClipUses:119 120Used by:122
Symbol 122 MovieClip {PowerupIcon}Uses:121Used by:302
Symbol 123 GraphicUsed by:124
Symbol 124 MovieClip {underConstruction.views.levelEditor.EditorField}Uses:123Used by:302
Symbol 125 FontUsed by:126 165 224 225
Symbol 126 EditableTextUses:125Used by:127
Symbol 127 MovieClip {underConstruction.views.playField.animations.ScoreEffect}Uses:126Used by:302
Symbol 128 GraphicUsed by:131 149
Symbol 129 GraphicUsed by:131 149
Symbol 130 TextUses:94Used by:131
Symbol 131 MovieClip {underConstruction.popups.PausePopup}Uses:128 87 89 129 92 115 130Used by:302
Symbol 132 GraphicUsed by:147
Symbol 133 GraphicUsed by:134
Symbol 134 MovieClipUses:133Used by:147
Symbol 135 GraphicUsed by:136
Symbol 136 MovieClipUses:135Used by:147
Symbol 137 GraphicUsed by:147
Symbol 138 GraphicUsed by:139
Symbol 139 MovieClipUses:138Used by:147
Symbol 140 GraphicUsed by:141
Symbol 141 MovieClipUses:140Used by:147
Symbol 142 GraphicUsed by:147
Symbol 143 EditableTextUses:94 156Used by:147
Symbol 144 TextUses:94Used by:147
Symbol 145 EditableTextUses:94 156Used by:147
Symbol 146 EditableTextUses:94 156Used by:147
Symbol 147 MovieClip {underConstruction.popups.LevelScorePopup}Uses:132 134 136 137 139 141 142 143 144 145 146Used by:302
Symbol 148 TextUses:94Used by:149
Symbol 149 MovieClip {underConstruction.popups.PromptGameContinuePopup}Uses:128 88 90 129 93 115 148Used by:302
Symbol 150 GraphicUsed by:161
Symbol 151 GraphicUsed by:161
Symbol 152 GraphicUsed by:155
Symbol 153 GraphicUsed by:154
Symbol 154 MovieClipUses:153Used by:155
Symbol 155 MovieClipUses:152 154Used by:161
Symbol 156 FontUsed by:114 143 145 146 157 158 159 160 169 170 171 278
Symbol 157 EditableTextUses:94 156Used by:161
Symbol 158 EditableTextUses:94 156Used by:161
Symbol 159 TextUses:156Used by:161
Symbol 160 EditableTextUses:94 156Used by:161
Symbol 161 MovieClip {underConstruction.popups.StartLevelPopup}Uses:150 88 90 151 93 155 157 158 159 160Used by:302
Symbol 162 GraphicUsed by:164
Symbol 163 GraphicUsed by:164
Symbol 164 MovieClipUses:162 163Used by:166
Symbol 165 EditableTextUses:125Used by:166
Symbol 166 MovieClip {underConstruction.views.playField.ui.PowerupButton}Uses:164 165Used by:302
Symbol 167 GraphicUsed by:168
Symbol 168 MovieClip {DisposeArrowClip}Uses:167Used by:302
Symbol 169 EditableTextUses:94 156Used by:175
Symbol 170 EditableTextUses:94 156Used by:175
Symbol 171 EditableTextUses:94 156Used by:175
Symbol 172 GraphicUsed by:173
Symbol 173 MovieClipUses:172Used by:174
Symbol 174 MovieClip {TwoDPlayButton}Uses:173Used by:175 244 279 284 302
Symbol 175 MovieClip {underConstruction.views.playField.ui.HUD}Uses:115 169 170 171 174Used by:302
Symbol 176 BitmapUsed by:177
Symbol 177 GraphicUses:176Used by:184
Symbol 178 BitmapUsed by:179
Symbol 179 GraphicUses:178Used by:184
Symbol 180 BitmapUsed by:181
Symbol 181 GraphicUses:180Used by:184
Symbol 182 BitmapUsed by:183
Symbol 183 GraphicUses:182Used by:184
Symbol 184 MovieClipUses:177 179 181 183Used by:218 223 244
Symbol 185 BitmapUsed by:186
Symbol 186 GraphicUses:185Used by:217
Symbol 187 BitmapUsed by:188
Symbol 188 GraphicUses:187Used by:217
Symbol 189 BitmapUsed by:190
Symbol 190 GraphicUses:189Used by:217
Symbol 191 BitmapUsed by:192
Symbol 192 GraphicUses:191Used by:217
Symbol 193 BitmapUsed by:194
Symbol 194 GraphicUses:193Used by:217
Symbol 195 BitmapUsed by:196
Symbol 196 GraphicUses:195Used by:217
Symbol 197 BitmapUsed by:198
Symbol 198 GraphicUses:197Used by:217
Symbol 199 BitmapUsed by:200
Symbol 200 GraphicUses:199Used by:217
Symbol 201 BitmapUsed by:202
Symbol 202 GraphicUses:201Used by:217
Symbol 203 BitmapUsed by:204
Symbol 204 GraphicUses:203Used by:217
Symbol 205 BitmapUsed by:206
Symbol 206 GraphicUses:205Used by:217
Symbol 207 BitmapUsed by:208
Symbol 208 GraphicUses:207Used by:217
Symbol 209 BitmapUsed by:210
Symbol 210 GraphicUses:209Used by:217
Symbol 211 BitmapUsed by:212
Symbol 212 GraphicUses:211Used by:217
Symbol 213 BitmapUsed by:214
Symbol 214 GraphicUses:213Used by:217
Symbol 215 BitmapUsed by:216
Symbol 216 GraphicUses:215Used by:217
Symbol 217 MovieClipUses:186 188 190 192 194 196 198 200 202 204 206 208 210 212 214 216Used by:218
Symbol 218 MovieClip {underConstruction.views.playField.GameView}Uses:184 217Used by:302
Symbol 219 BitmapUsed by:220 221
Symbol 220 GraphicUses:219Used by:222
Symbol 221 GraphicUses:219Used by:222
Symbol 222 MovieClipUses:220 221Used by:223
Symbol 223 MovieClip {underConstruction.views.playField.CustomGameView}Uses:184 222Used by:302
Symbol 224 EditableTextUses:125Used by:239
Symbol 225 EditableTextUses:125Used by:239
Symbol 226 GraphicUsed by:229
Symbol 227 GraphicUsed by:229
Symbol 228 GraphicUsed by:229
Symbol 229 MovieClipUses:226 227 228Used by:230
Symbol 230 MovieClip {NavigateArrowButton}Uses:229Used by:239 302
Symbol 231 FontUsed by:232 233 234 235 283
Symbol 232 EditableTextUses:231Used by:239
Symbol 233 EditableTextUses:231Used by:239
Symbol 234 EditableTextUses:231Used by:239
Symbol 235 EditableTextUses:231Used by:239
Symbol 236 EditableTextUses:84Used by:239
Symbol 237 EditableTextUses:84Used by:239
Symbol 238 EditableTextUses:84Used by:239
Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView}Uses:80 115 224 225 230 232 233 234 235 236 237 238Used by:302
Symbol 240 BitmapUsed by:241
Symbol 241 GraphicUses:240Used by:242 243
Symbol 242 MovieClip {underConstruction.views.instructions.InstructionsView}Uses:241 115Used by:302
Symbol 243 MovieClip {underConstruction.popups.InstructionPopup}Uses:241 115Used by:302
Symbol 244 MovieClip {underConstruction.views.levelEnd.LevelEndView}Uses:184 174 115Used by:302
Symbol 245 GraphicUsed by:246
Symbol 246 MovieClipUses:245Used by:279
Symbol 247 GraphicUsed by:279
Symbol 248 GraphicUsed by:249
Symbol 249 MovieClipUses:248Used by:279
Symbol 250 GraphicUsed by:251
Symbol 251 MovieClipUses:250Used by:279
Symbol 252 GraphicUsed by:253
Symbol 253 MovieClipUses:252Used by:279
Symbol 254 GraphicUsed by:279
Symbol 255 GraphicUsed by:276
Symbol 256 GraphicUsed by:257
Symbol 257 MovieClipUses:256Used by:276
Symbol 258 GraphicUsed by:276
Symbol 259 GraphicUsed by:260
Symbol 260 MovieClipUses:259Used by:276
Symbol 261 GraphicUsed by:276
Symbol 262 GraphicUsed by:263
Symbol 263 MovieClipUses:262Used by:276
Symbol 264 GraphicUsed by:276
Symbol 265 GraphicUsed by:266
Symbol 266 MovieClipUses:265Used by:276
Symbol 267 GraphicUsed by:276
Symbol 268 GraphicUsed by:269
Symbol 269 MovieClipUses:268Used by:276
Symbol 270 GraphicUsed by:276
Symbol 271 GraphicUsed by:272
Symbol 272 MovieClipUses:271Used by:276
Symbol 273 GraphicUsed by:274
Symbol 274 MovieClipUses:273Used by:276
Symbol 275 GraphicUsed by:276
Symbol 276 MovieClipUses:255 257 258 260 261 263 264 266 267 269 270 272 274 275Used by:279
Symbol 277 TextUses:94Used by:279
Symbol 278 EditableTextUses:94 156Used by:279
Symbol 279 MovieClip {underConstruction.views.gameWon.GameWonView}Uses:246 247 249 251 253 254 276 115 174 277 278Used by:302
Symbol 280 GraphicUsed by:284
Symbol 281 GraphicUsed by:282
Symbol 282 MovieClipUses:281Used by:284
Symbol 283 EditableTextUses:231Used by:284
Symbol 284 MovieClip {underConstruction.views.mainMenu.MainMenuView}Uses:280 115 174 80 282 283Used by:302
Symbol 285 MovieClip {underConstruction.views.main.MainView}Used by:302
Symbol 286 GraphicUsed by:300 301
Symbol 287 BitmapUsed by:288
Symbol 288 GraphicUses:287Used by:300 301
Symbol 289 BitmapUsed by:290
Symbol 290 GraphicUses:289Used by:300 301
Symbol 291 BitmapUsed by:292
Symbol 292 GraphicUses:291Used by:300 301
Symbol 293 BitmapUsed by:294
Symbol 294 GraphicUses:293Used by:300 301
Symbol 295 BitmapUsed by:296
Symbol 296 GraphicUses:295Used by:300 301
Symbol 297 BitmapUsed by:298
Symbol 298 GraphicUses:297Used by:300 301
Symbol 299 GraphicUsed by:300 301
Symbol 300 MovieClip {Tile}Uses:286 288 290 292 294 296 298 299Used by:302
Symbol 301 MovieClip {BuildingBrick}Uses:286 288 290 292 294 296 298 299Used by:302
Symbol 302 MovieClip {under_fla.exported_movieclips_1}Uses:85 116 118 122 124 127 131 147 149 161 166 168 175 218 223 239 242 243 244 279 284 285 300 301 83 115 174 230Used by:Timeline
Symbol 303 EditableTextUses:84Used by:317
Symbol 304 Sound {BonusPoint}Used by:317
Symbol 305 Sound {Penalty}Used by:317
Symbol 306 Sound {PlaceBrick_1}Used by:317
Symbol 307 Sound {AddBrick}Used by:317
Symbol 308 Sound {PlaceBrick_2}Used by:317
Symbol 309 Sound {PlaceBrick_3}Used by:317
Symbol 310 Sound {PlaceBrick_4}Used by:317
Symbol 311 Sound {Rotate}Used by:317
Symbol 312 Sound {SelectBrick}Used by:317
Symbol 313 Sound {BrickDispose}Used by:317
Symbol 314 Sound {SmashBrick}Used by:317
Symbol 315 Sound {InGameMusic}Used by:317
Symbol 316 Sound {UIButtonPress}Used by:317
Symbol 317 MovieClip {under_fla.exported_sounds_63}Uses:303 304 305 306 307 308 309 310 311 312 313 314 315 316Used by:Timeline

Instance Names

"progress_bar_mask"Symbol 82 MovieClip {under_fla.preloader_progress_bar_61} Frame 1Symbol 79 MovieClip
"_animatedLogo"Symbol 83 MovieClip Frame 1Symbol 76 MovieClip
"_progressBar"Symbol 83 MovieClip Frame 1Symbol 82 MovieClip {under_fla.preloader_progress_bar_61}
"closeButtonPositioner"Symbol 113 MovieClip {under_fla.HintPopupMovie_3} Frame 1Symbol 97 MovieClip
"_labelField"Symbol 115 MovieClip {gamework.ui.TextButtonWidget} Frame 1Symbol 114 EditableText
"_movieClip"Symbol 116 MovieClip {underConstruction.popups.HintPopup} Frame 1Symbol 113 MovieClip {under_fla.HintPopupMovie_3}
"_closeButton"Symbol 116 MovieClip {underConstruction.popups.HintPopup} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_labelField"Symbol 127 MovieClip {underConstruction.views.playField.animations.ScoreEffect} Frame 1Symbol 126 EditableText
"_resumeButton"Symbol 131 MovieClip {underConstruction.popups.PausePopup} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_mainMenuButton"Symbol 131 MovieClip {underConstruction.popups.PausePopup} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_restartLevelButton"Symbol 131 MovieClip {underConstruction.popups.PausePopup} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_switchSoundButton"Symbol 131 MovieClip {underConstruction.popups.PausePopup} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_resultMessageField"Symbol 147 MovieClip {underConstruction.popups.LevelScorePopup} Frame 1Symbol 143 EditableText
"_captionsField"Symbol 147 MovieClip {underConstruction.popups.LevelScorePopup} Frame 1Symbol 145 EditableText
"_valuesField"Symbol 147 MovieClip {underConstruction.popups.LevelScorePopup} Frame 1Symbol 146 EditableText
"_continueButton"Symbol 149 MovieClip {underConstruction.popups.PromptGameContinuePopup} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_newGameButton"Symbol 149 MovieClip {underConstruction.popups.PromptGameContinuePopup} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_levelNumField"Symbol 161 MovieClip {underConstruction.popups.StartLevelPopup} Frame 1Symbol 157 EditableText
"_levelNameField"Symbol 161 MovieClip {underConstruction.popups.StartLevelPopup} Frame 1Symbol 158 EditableText
"_goalField"Symbol 161 MovieClip {underConstruction.popups.StartLevelPopup} Frame 1Symbol 160 EditableText
"_icon"Symbol 166 MovieClip {underConstruction.views.playField.ui.PowerupButton} Frame 1Symbol 164 MovieClip
"_labelField"Symbol 166 MovieClip {underConstruction.views.playField.ui.PowerupButton} Frame 1Symbol 165 EditableText
"_icon"Symbol 174 MovieClip {TwoDPlayButton} Frame 1Symbol 173 MovieClip
"_pauseButton"Symbol 175 MovieClip {underConstruction.views.playField.ui.HUD} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_floorField"Symbol 175 MovieClip {underConstruction.views.playField.ui.HUD} Frame 1Symbol 169 EditableText
"_scoreField"Symbol 175 MovieClip {underConstruction.views.playField.ui.HUD} Frame 1Symbol 170 EditableText
"_timerField"Symbol 175 MovieClip {underConstruction.views.playField.ui.HUD} Frame 1Symbol 171 EditableText
"_2DPlayButton"Symbol 175 MovieClip {underConstruction.views.playField.ui.HUD} Frame 1Symbol 174 MovieClip {TwoDPlayButton}
"_backgroundClip"Symbol 218 MovieClip {underConstruction.views.playField.GameView} Frame 1Symbol 184 MovieClip
"_backgroundClip"Symbol 223 MovieClip {underConstruction.views.playField.CustomGameView} Frame 1Symbol 184 MovieClip
"_icon"Symbol 230 MovieClip {NavigateArrowButton} Frame 1Symbol 229 MovieClip
"_playButton"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_mainMenuButton"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_addLevelButton"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_deleteLevelButton"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_addFloorButton"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_deleteFloorButton"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_clearFloorButton"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_levelTextField"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 224 EditableText
"_floorTextField"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 225 EditableText
"_levelLeftButton"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 230 MovieClip {NavigateArrowButton}
"_levelRightButton"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 230 MovieClip {NavigateArrowButton}
"_floorLeftButton"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 230 MovieClip {NavigateArrowButton}
"_floorRightButton"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 230 MovieClip {NavigateArrowButton}
"_levelNameField"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 232 EditableText
"_showCodeButton"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_importLevelsButton"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_levelCodeField"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 233 EditableText
"_levelGoalField"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 234 EditableText
"_levelTimeField"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 235 EditableText
"_showASCodeButton"Symbol 239 MovieClip {underConstruction.views.levelEditor.LevelEditorView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_mainMenuButton"Symbol 242 MovieClip {underConstruction.views.instructions.InstructionsView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_continueButton"Symbol 243 MovieClip {underConstruction.popups.InstructionPopup} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_backgroundClip"Symbol 244 MovieClip {underConstruction.views.levelEnd.LevelEndView} Frame 1Symbol 184 MovieClip
"_2DPlayButton"Symbol 244 MovieClip {underConstruction.views.levelEnd.LevelEndView} Frame 1Symbol 174 MovieClip {TwoDPlayButton}
"_mainMenuButton"Symbol 244 MovieClip {underConstruction.views.levelEnd.LevelEndView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_restartLevelButton"Symbol 244 MovieClip {underConstruction.views.levelEnd.LevelEndView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_submitScoreButton"Symbol 244 MovieClip {underConstruction.views.levelEnd.LevelEndView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_continueGameButton"Symbol 244 MovieClip {underConstruction.views.levelEnd.LevelEndView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_mainMenuButton"Symbol 279 MovieClip {underConstruction.views.gameWon.GameWonView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_2DPlayButton"Symbol 279 MovieClip {underConstruction.views.gameWon.GameWonView} Frame 1Symbol 174 MovieClip {TwoDPlayButton}
"_submitScoreButton"Symbol 279 MovieClip {underConstruction.views.gameWon.GameWonView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_finalScoreField"Symbol 279 MovieClip {underConstruction.views.gameWon.GameWonView} Frame 1Symbol 278 EditableText
"_startGameButton"Symbol 284 MovieClip {underConstruction.views.mainMenu.MainMenuView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_instructionsButton"Symbol 284 MovieClip {underConstruction.views.mainMenu.MainMenuView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_highScoresButton"Symbol 284 MovieClip {underConstruction.views.mainMenu.MainMenuView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_2DPlayButton"Symbol 284 MovieClip {underConstruction.views.mainMenu.MainMenuView} Frame 1Symbol 174 MovieClip {TwoDPlayButton}
"_2DPlayLinkButton"Symbol 284 MovieClip {underConstruction.views.mainMenu.MainMenuView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_levelEditorButton"Symbol 284 MovieClip {underConstruction.views.mainMenu.MainMenuView} Frame 1Symbol 115 MovieClip {gamework.ui.TextButtonWidget}
"_startLevelField"Symbol 284 MovieClip {underConstruction.views.mainMenu.MainMenuView} Frame 1Symbol 283 EditableText

Special Tags

FileAttributes (69)Timeline Frame 1Access network only, Metadata not present, AS3.
ScriptLimits (65)Timeline Frame 1MaxRecursionDepth: 256, ScriptTimeout: 5 seconds
EnableDebugger2 (64)Timeline Frame 131 bytes "..$1$C.$Ch1QkKdk4p9FU7US0Zq2P0."

Labels

"preloader"Frame 1
"export"Frame 2
"start"Frame 3
"selectPiece"Symbol 113 MovieClip {under_fla.HintPopupMovie_3} Frame 1
"rotatePiece"Symbol 113 MovieClip {under_fla.HintPopupMovie_3} Frame 2
"placePiece"Symbol 113 MovieClip {under_fla.HintPopupMovie_3} Frame 3
"connectColors"Symbol 113 MovieClip {under_fla.HintPopupMovie_3} Frame 4
"activatePowerup"Symbol 113 MovieClip {under_fla.HintPopupMovie_3} Frame 5
"trashPiece"Symbol 113 MovieClip {under_fla.HintPopupMovie_3} Frame 6
"powerupUsage"Symbol 113 MovieClip {under_fla.HintPopupMovie_3} Frame 7
"add_single_brick"Symbol 164 MovieClip Frame 1
"remove_single_brick"Symbol 164 MovieClip Frame 2




http://swfchan.com/10/47511/info.shtml
Created: 1/5 -2019 17:25:07 Last modified: 1/5 -2019 17:25:07 Server time: 21/06 -2024 05:54:48