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

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

Nunchuck Charlie.swf

This is the info page for
Flash #207496

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


ActionScript [AS1/AS2]
Combined Code
movieClip 2 { } // unknown tag 88 length 138 movieClip 10 playerRunningControlHint { frame 1 { _yscale = 0; _xscale = 0; scaleSpeed = 0; xOffset2 = 0; xOffset = 0; scaleTarget = 100; rootXMousePos = _root._xmouse; stop(); onEnterFrame = function () { _x = _root.heroP1._x + xOffset2; _y = _root.heroP1._y - 130; if (_y < _root.gameCamera._y - 30) { _y = _root.gameCamera._y - 30; if (_root.heroP1._x < _root.gameCamera._x) { xOffset = 130; } else { xOffset = -130; } } else { xOffset = 0; } xOffset2 += (xOffset - xOffset2) * 0.2; pointer._rotation = _root.getAngle(_x, _y - 90, _root.heroP1._x, _root.heroP1._y) + 90; scaleSpeed += (scaleTarget - _yscale) * 0.25; scaleSpeed *= 0.9; _yscale = _yscale + scaleSpeed; _xscale = _yscale + scaleSpeed; if (scaleTarget <= 0 || !_root.hero1Alive) { scaleTarget = 0; if (_yscale <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } } movieClip 13 { } movieClip 14 { } movieClip 16 { } movieClip 18 { frame 1 { stop(); } } movieClip 21 { } movieClip 22 { } movieClip 25 { } movieClip 28 { frame 1 { stop(); } } movieClip 29 Preloader { frame 1 { function enterFrameHandler() { var v2 = 0; v2 = _root.getBytesLoaded() / _root.getBytesTotal(); if (loadingBar) { loadingBar.gotoAndStop(int(v2 * (loadingBar._totalframes - 1)) + 1); } if (v2 >= 1 && haltComplete != true) { onEnterFrame = null; gotoAndStop('loaded'); } } stop(); var autoPlay; var className; var haltComplete; onEnterFrame = enterFrameHandler; } frame 10 { function _onPlayClick() { _root.nextFrame(); _root.play(); _parent._onLoaded(); } if (playButton) { playButton.onRelease = _onPlayClick; playButton.stop(); } if (autoPlay) { _onPlayClick(null); } } } movieClip 31 Newgrounds API Classes { #initclip Object.registerClass('Newgrounds API Classes', com.newgrounds.shims.APIShim); #endinitclip } movieClip 71 { } movieClip 74 { } movieClip 79 { } movieClip 83 { } movieClip 84 { } movieClip 85 { } movieClip 86 FlashAd { #initclip Object.registerClass('FlashAd', com.newgrounds.components.FlashAdBase); #endinitclip frame 1 { function initPlayButton() { if (this.playButton) { this.playButton.onRelease = onPlayClick; if (!this.showPlayButton) { this.playButton._visible = false; } } } function onPlayClick() { removeAd(); _visible = false; } stop(); } frame 2 { initPlayButton(); } frame 10 { initPlayButton(); } frame 20 { initPlayButton(); } } movieClip 87 APIConnector { frame 1 { function _onLoaded() { gotoAndStop('invisible'); if (_redirect) { com.newgrounds.API.loadOfficialVersion(); return undefined; } } function _apiConnect() { var v2 = com.newgrounds.API; if (v2 && !v2.connected) { if (!apiId) { com.newgrounds.Logger.logError('No API ID entered in the API Connector component.', 'You can create an API ID for this submission at http://newgrounds.com/account/flashapi', 'Enter your API ID into the API Connector using the Component Inspector (Window -> Component Inspector).'); return undefined; } switch (debugMode) { case 'Off': default: v2.debugMode = v2.RELEASE_MODE; goto 1319; case 'Simulate Logged-in User': //Invalid switch } v2.debugMode = v2.DEBUG_MODE_LOGGED_IN; goto 1319; case 'Off': v2.debugMode = v2.DEBUG_MODE_LOGGED_OUT; goto 1319; case 'Simulate Logged-in User': v2.debugMode = v2.DEBUG_MODE_NEW_VERSION; goto 1319; case 'Simulate Logged-out User': v2.debugMode = v2.DEBUG_MODE_HOST_BLOCKED; label 1319: if (loader) { loader.haltComplete = true; } v2.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, _onConnected); v2.connect(_root, apiId, encryptionKey, movieVersion); } } function _onConnected(event) { if (loader) { loader.haltComplete = false; } if (redirectOnNewVersion && event.__get__success() && (event.__get__data()).newVersion) { _redirect = true; } if (redirectOnHostBlocked && !event.__get__success() && event.__get__error() == com.newgrounds.APIEvent.ERROR_HOST_BLOCKED) { _redirect = true; } if (_redirect) { gotoAndStop('adPreloader'); forceAlwaysOnTop(); } } function forceAlwaysOnTop() { var v2 = getNextHighestDepth(); swapDepths(v2); if (Stage) { _x = (Stage.width - _width) / 2; _y = (Stage.height - _height) / 2; _visible = true; } if (_root && _root instanceof MovieClip) { (MovieClip(_root)).stop(); } } stop(); if (_root && _root instanceof MovieClip) { (MovieClip(_root)).stop(); } var apiId; var encryptionKey; var movieVersion; var debugMode; var connectorType; var redirectOnHostBlocked; var redirectOnNewVersion; var adType; var className; var _redirect; _x = int(_x); _y = int(_y); if (!debugMode) { debugMode = 'Simulate Logged-in User'; } if (!connectorType) { connectorType = 'Flash Ad + Preloader'; } if (!adType) { adType = 'Video'; } if (ad) { ad.adType = adType; } switch (connectorType) { case 'Flash Ad + Preloader': gotoAndStop('adPreloader'); break; case 'Flash Ad Only': gotoAndStop('ad'); break; case 'Invisible': gotoAndStop('invisible'); } _apiConnect(); } instance ad of movieClip 86 FlashAd { onClipEvent (construct) { apiId = ''; showBorder = true; adType = 'Video'; } } instance loader of movieClip 29 Preloader { onClipEvent (construct) { autoPlay = false; mainClass = ''; } } } frame 1 { function siteKongregate() { siteURL = _root._url; if (siteURL.indexOf('kongregate.com') != -1) { return true; } else { return false; } } function siteNewgrounds() { siteURL = _root._url; if (siteURL.indexOf('undergrounded.net') != -1) { return true; } else { return false; } } function disableAds() { if (siteKongregate()) { return true; } else { return false; } } function disableTracking() { return false; } if (siteKongregate()) { _global.kongregate.services.connect(); } } frame 1 { function mySiteLink() { getURL('http://www.deadtoast.com', '_blank'); } stop(); debug = false; timer = 0; var rightClick = new ContextMenu(); rightClick.hideBuiltInItems(); _root.menu = rightClick; var mySiteLink = new ContextMenuItem('Visit DeadToast.com', mySiteLink); rightClick.customItems.push(mySiteLink); gameURL = _root._url; onEnterFrame = function () { ++timer; if (timer >= 60) { timer = 0; _root.nextFrame(); } }; } movieClip 90 { } instance mainMenuBackground of movieClip 90 { onClipEvent (load) { startX = _x; startY = _y; _x = startX - (_parent._xmouse + 400) * 0.08; _y = startY - (_parent._ymouse + 240) * 0.08; } onClipEvent (enterFrame) { _x = startX - (_parent._xmouse + 400) * 0.08; _y = startY - (_parent._ymouse + 240) * 0.08; } } movieClip 94 { } movieClip 96 { frame 1 { this._visible = false; if (!_root.disableAds()) { System.security.loadPolicyFile(DTADS_url + 'dtads_policy.xml'); this.createEmptyMovieClip('adHolder', this.getNextHighestDepth()); loadVariables(DTADS_url + 'dtads.txt', this); onEnterFrame = function () { if (DTADS_active == 'true' && !_root.NGad._visible) { DTADS_ranNr = 1 + random(parseInt(DTADS_nrOfAds)); if (this['DTADS_adXOffset' + DTADS_ranNr] != undefined) { adHolder._x += parseInt(this['DTADS_adXOffset' + DTADS_ranNr]); } if (this['DTADS_adYOffset' + DTADS_ranNr] != undefined) { adHolder._y += parseInt(this['DTADS_adYOffset' + DTADS_ranNr]); } loadMovie(DTADS_url + this['DTADS_adPic' + DTADS_ranNr], adHolder); this.onRelease = function () { com.newgrounds.API.logCustomEvent('DTAD_click_' + clickIdentifier + '_' + DTADS_ranNr); getURL(this['DTADS_adURL' + DTADS_ranNr], '_blank'); }; onEnterFrame = function () { if (_root._currentframe == visibleOnFrame) { _visible = true; } if (_visible) { _root.NGad.gotoAndStop(3); _root.NGad._visible = true; onEnterFrame = undefined; } }; } else { if (DTADS_active == 'false' || DTADS_active == undefined || DTADS_active != 'true') { if (_root._currentframe == visibleOnFrame) { _root.NGad.gotoAndStop(2); _root.NGad._visible = true; } } } }; } else { this.onEnterFrame = function () { if (_root._currentframe == visibleOnFrame) { if (!_root.disableTracking()) { _root.NGad.gotoAndStop(3); _root.NGad._visible = true; this.onEnterFrame = undefined; } else { trace('do nothing, tracking disabled'); this.onEnterFrame = undefined; } } }; } } } instance of movieClip 96 { onClipEvent (load) { visibleOnFrame = 3; DTADS_url = 'http://www.deadtoast.com/dtads/nc/'; clickIdentifier = 'NC'; } } movieClip 40 __Packages.com.newgrounds.APIConnection { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.APIConnection) { var v1 = function () { this.reset(); }; com.newgrounds.APIConnection = v1; var v2 = v1.prototype; v2.__get__hostURL = function () { return this._hostURL; }; v2.__set__hostURL = function (value) { this._hostURL = value; this.hostDomain = null; if (this._hostURL) { var v2 = this._hostURL.split('/'); if (v2[0] != 'file:' && this._hostURL != 'localhost') { this.hostDomain = (v2.splice(0, 3)).join('/'); } } if (!this.hostDomain) { this.hostDomain = 'localhost'; } return this.__get__hostURL(); }; v2.__get__sandboxType = function () { return System.security.sandboxType; }; v2.__get__isNetworkHost = function () { switch (this.__get__sandboxType()) { return true; case 'localWithFile': case 'localWithNetwork': case 'localTrusted': case 'application': return false; case 'remote': } return true; }; v2.__get__hasUserSession = function () { return this.sessionId != null && this.sessionId != '' && this.publisherId != 0; }; v2.__get__connected = function () { return this.connectionState == com.newgrounds.APIConnection.CONNECTED; }; v2.reset = function () { this.connectionState = com.newgrounds.APIConnection.NOT_CONNECTED; this.encryptionKey = null; this.sessionId = null; this.userEmail = null; this.username = null; this.userId = 0; this.userpageFormat = 0; }; v2.assertInitialized = function () { if (!this.initialized) { com.newgrounds.Logger.logError('You must initialized the API using API.connect() before using this command.'); return false; } return true; }; v2.assertConnected = function () { if (!this.connectionState == com.newgrounds.APIConnection.CONNECTED) { com.newgrounds.Logger.logError('You must establish a connection using API.connect() before using this command.'); return false; } return true; }; v2.sendSimpleCommand = function (command, completeHandler, parameters, secureParameters) { if (parameters == undefined) { parameters = null; } if (secureParameters == undefined) { secureParameters = null; } var v2 = new com.newgrounds.APICommand(command); v2.__set__parameters(parameters); v2.__set__secureParameters(secureParameters); if (completeHandler != null) { v2.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, completeHandler); } v2.send(this); }; v2.sendCommand = function (command) { command.send(this); }; v2.loadInBrowser = function (command, newWindow, parameters) { if (newWindow == undefined) { newWindow = true; } if (parameters == undefined) { parameters = null; } var v2 = new com.newgrounds.APICommand(command); v2.__set__parameters(parameters); v2.loadInBrowser(this, newWindow); }; v1.NOT_CONNECTED = 'notConnected'; v1.CONNECTING = 'connecting'; v1.CONNECTED = 'connected'; v2.connectionState = com.newgrounds.APIConnection.NOT_CONNECTED; v2.apiURL = 'http://www.ngads.com/gateway_v2.php'; v2.addProperty('connected', v2.__get__connected, function () {}); v2.addProperty('hasUserSession', v2.__get__hasUserSession, function () {}); v2.addProperty('hostURL', v2.__get__hostURL, v2.__set__hostURL); v2.addProperty('isNetworkHost', v2.__get__isNetworkHost, function () {}); v2.addProperty('sandboxType', v2.__get__sandboxType, function () {}); ASSetPropFlags(com.newgrounds.APIConnection.prototype, null, 1); } #endinitclip } movieClip 33 __Packages.com.newgrounds.EventDispatcher { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.EventDispatcher) { var v1 = function () { this._listeners = {}; }; com.newgrounds.EventDispatcher = v1; var v2 = v1.prototype; v2.addEventListener = function (type, listener) { if (!this._listeners[type]) { this._listeners[type] = []; } if (typeof listener == 'function') { this._listeners[type].push({'target': null, 'func': listener}); } else { this._listeners[type].push(listener); } }; v2.removeEventListener = function (type, listener) { var v3 = this._listeners[type]; if (v3) { var v5 = v3.length; var v2 = 0; while (v2 < v5) { if (v3[v2].func == listener || v3[v2] == listener) { v3.splice(v2, 1); return undefined; } ++v2; } } }; v2.dispatchEvent = function (event) { var v4 = this._listeners[event.__get__type()]; if (v4) { var v5 = v4.length; var v2 = 0; while (v2 < v5) { var v3 = v4[v2]; v3.func.call(v3.target, event); ++v2; } } return true; }; ASSetPropFlags(com.newgrounds.EventDispatcher.prototype, null, 1); } #endinitclip } movieClip 32 __Packages.com.newgrounds.Event { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.Event) { var v1 = function (type) { this._type = type; }; com.newgrounds.Event = v1; var v2 = v1.prototype; v2.__get__type = function () { return this._type; }; v2.addProperty('type', v2.__get__type, function () {}); ASSetPropFlags(com.newgrounds.Event.prototype, null, 1); } #endinitclip } movieClip 34 __Packages.com.newgrounds.APIEventDispatcher { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.APIEventDispatcher) { var v1 = function () { super(); }; com.newgrounds.APIEventDispatcher = v1; com.newgrounds.APIEventDispatcher extends com.newgrounds.EventDispatcher; var v2 = v1.prototype; v1.__get__globalDispatcher = function () { return com.newgrounds.APIEventDispatcher._globalDispatcher; }; v1.__set__globalDispatcher = function (value) { com.newgrounds.APIEventDispatcher._globalDispatcher = value; return com.newgrounds.APIEventDispatcher.__get__globalDispatcher(); }; v1.initEventQueue = function () { setInterval(com.newgrounds.APIEventDispatcher.runEventQueue, 50); return []; }; v2.dispatchEvent = function (event) { com.newgrounds.APIEventDispatcher._eventQueue.push({'dispatcher': this, 'event': event}); return true; }; v2.actualDispatchEvent = function (event) { var v3 = super.dispatchEvent(event); if (com.newgrounds.APIEventDispatcher._globalDispatcher && this != com.newgrounds.APIEventDispatcher._globalDispatcher) { com.newgrounds.APIEventDispatcher._globalDispatcher.dispatchEvent(event); } }; v1.runEventQueue = function (event) { var v3 = com.newgrounds.APIEventDispatcher._eventQueue.length; if (v3) { var v4 = com.newgrounds.APIEventDispatcher._eventQueue; com.newgrounds.APIEventDispatcher._eventQueue = []; var v1 = 0; while (v1 < v3) { var v2 = v4[v1]; v2.dispatcher.actualDispatchEvent(v2.event); ++v1; } } }; v1._eventQueue = com.newgrounds.APIEventDispatcher.initEventQueue(); v1.addProperty('globalDispatcher', v1.__get__globalDispatcher, v1.__set__globalDispatcher); ASSetPropFlags(com.newgrounds.APIEventDispatcher.prototype, null, 1); } #endinitclip } movieClip 37 __Packages.com.newgrounds.encoders.BaseN { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.encoders) { _global.com.newgrounds.encoders = new Object(); } if (!_global.com.newgrounds.encoders.BaseN) { var v1 = function (hash) { if (hash) { this._hash = hash; } else { this._hash = com.newgrounds.encoders.BaseN.DEFAULT_HASH; } this._base = this._hash.length; this._reverseHash = new Object(); var v2 = 0; while (v2 < this._hash.length) { this._reverseHash[this._hash.charAt(v2)] = v2; ++v2; } }; com.newgrounds.encoders.BaseN = v1; var v2 = v1.prototype; v2.encodeUint = function (number, minimumChars) { if (minimumChars == undefined) { minimumChars = 1; } var v2 = ''; var v3 = number; while (v3 != 0) { v2 = this._hash.charAt(v3 % this._base) + v2; v3 /= this._base; v3 = int(v3); } while (v2.length < minimumChars) { v2 = this._hash.charAt(0) + v2; } return v2; }; v2.decodeUint = function (encodedNumber) { var v3 = 0; var v2 = 0; while (v2 < encodedNumber.length) { v3 *= this._base; v3 += this._reverseHash[encodedNumber.charAt(v2)]; ++v2; } return v3; }; v1.DEFAULT_HASH = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~@#$%^&*()+|;/'; ASSetPropFlags(com.newgrounds.encoders.BaseN.prototype, null, 1); } #endinitclip } movieClip 43 __Packages.com.newgrounds.APICommand { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.APICommand) { var v1 = function (command) { super(); this._command = command; this._parameters = new Object(); this._secureParameters = new Object(); this._hasTimeout = true; }; com.newgrounds.APICommand = v1; com.newgrounds.APICommand extends com.newgrounds.APIEventDispatcher; var v2 = v1.prototype; v1.stopPendingCommands = function () { for (var v2 in com.newgrounds.APICommand._pendingCommands) { var v1 = com.newgrounds.APICommand._pendingCommands[v2]; v1.close(); } com.newgrounds.APICommand._pendingCommands = []; }; v1.onThrottleTimer = function (event) { if (getTimer() - com.newgrounds.APICommand._throttleTimestamp >= com.newgrounds.APICommand.THROTTLE_INTERVAL) { com.newgrounds.APICommand._throttleCount = 0; com.newgrounds.APICommand._throttleCount = 0; for (;;) { if (!(com.newgrounds.APICommand._commandQueue.length && com.newgrounds.APICommand._throttleCount < com.newgrounds.APICommand.THROTTLE_THRESHOLD)) break; var v1 = com.newgrounds.APICommand._commandQueue.shift(); v1.command.send(v1.connection); ++com.newgrounds.APICommand._throttleCount; } } }; v1.encryptHex = function (hexValue) { var v4 = hexValue.length % 6; var v3 = ''; var v1 = 0; while (v1 < hexValue.length) { v3 += com.newgrounds.APICommand._encryptor.encodeUint(int('0x' + hexValue.substr(v1, 6)), 4); v1 += 6; } return v4.toString() + v3; }; v2.__get__command = function () { return this._command; }; v2.__set__command = function (value) { this._command = value; return this.__get__command(); }; v2.__get__hasTimeout = function () { return this._hasTimeout; }; v2.__set__hasTimeout = function (val) { this._hasTimeout = val; return this.__get__hasTimeout(); }; v2.__get__parameters = function () { return this._parameters; }; v2.__set__parameters = function (object) { this._parameters = new Object(); if (object) { for (var v3 in object) { this._parameters[v3] = object[v3]; } } return this.__get__parameters(); }; v2.__get__preventCache = function () { return this._preventCache; }; v2.__set__preventCache = function (value) { this._preventCache = value; return this.__get__preventCache(); }; v2.__get__secureParameters = function () { return this._secureParameters; }; v2.__set__secureParameters = function (object) { this._secureParameters = new Object(); if (object) { for (var v3 in object) { this._secureParameters[v3] = object[v3]; } } return this.__get__secureParameters(); }; v2.__get__hasSecureParameters = function () { for (var v2 in this._secureParameters) { return true; } return false; }; v2.addFile = function (filename, data, dataField, contentType) { if (contentType == undefined) { contentType = 'application/octet-stream'; } if (!this._files) { this._files = new Object(); } var v3 = {'filename': filename, 'data': data, 'dataField': dataField, 'contentType': contentType}; this._files[filename] = v3; }; v2.removeFile = function (filename) { if (this._files) { delete this._files[filename]; } }; v2.clearFiles = function () { this._files = null; }; v2.close = function () { if (this._loader) { clearInterval(this._timeoutTimer); var v2 = 0; while (v2 < com.newgrounds.APICommand._pendingCommands.length) { if (com.newgrounds.APICommand._pendingCommands[v2] == this) { com.newgrounds.APICommand._pendingCommands.splice(v2, 1); break; } ++v2; } this._loader = null; } }; v2.loadInBrowser = function (connection, newWindow) { this._parameters.command_id = this._command; this._parameters.tracker_id = connection.apiId ? connection.apiId : 1; if (connection.debug) { this._parameters.debug = 1; } var v3 = connection.apiURL + '?host=' + escape(connection.hostDomain); for (var v4 in this._parameters) { v3 += '&' + escape(v4) + '=' + escape(this._parameters[v4]); } var v6; if (newWindow) { v6 = '_blank'; } else { v6 = '_top'; } _root.getURL(v3, v6); }; v2.send = function (connection) { if (com.newgrounds.APICommand._throttleCount >= com.newgrounds.APICommand.THROTTLE_THRESHOLD) { com.newgrounds.APICommand._commandQueue.push({'connection': connection, 'command': this}); } else { this.sendInternal(connection); } }; v2.sendInternal = function (connection) { var v4; v4 = new LoadVars(); v4.command_id = this._command; v4.tracker_id = connection.apiId; if (connection.debug) { v4.debug = 1; } if (this._preventCache) { v4.seed = Math.random(); } var v2; var v3; var v7; for (v2 in this._parameters) { v3 = this._parameters[v2]; if (v3 != null) { if (typeof v3 == 'boolean') { v4[v2] = int(v3); } else { v4[v2] = v3; } } } if (this.__get__hasSecureParameters()) { var v6 = new Object(); for (v2 in this._secureParameters) { v3 = this._secureParameters[v2]; if (v3 != null) { if (typeof v3 == 'boolean') { v6[v2] = int(v3); } else { v6[v2] = v3; } } } var v8 = ''; v7 = 0; while (v7 < 16) { v8 += com.newgrounds.APICommand.ENCRYPTOR_RADIX.charAt(int(Math.random() * com.newgrounds.APICommand.ENCRYPTOR_RADIX.length)); ++v7; } v4.command_id = 'securePacket'; v6.command_id = this._command; v6.as_version = 3; v6.session_id = connection.sessionId; v6.user_email = connection.userEmail; v6.publisher_id = connection.publisherId; v6.seed = v8; var v13 = com.newgrounds.crypto.MD5.hash(v8); var v11 = com.newgrounds.crypto.RC4.encrypt(com.newgrounds.encoders.json.JSON.encode(v6), connection.encryptionKey); v4.secure = com.newgrounds.APICommand.encryptHex(v13 + v11); } com.newgrounds.Logger.logInternal('Sending packet:', v4); var v12; v12 = 'application/x-www-form-urlencoded'; for (v2 in v4) { if (typeof v4[v2] == 'object') { v4[v2] = com.newgrounds.encoders.json.JSON.encode(v4[v2]); } } if (this._files) { for (var v10 in this._files) { var v5 = this._files[v10]; if (typeof v5.data == 'string') { v4[v10] = v5.data; } else { v4[v10] = com.newgrounds.encoders.json.JSON.encode(v5.data); } } } com.newgrounds.APICommand._pendingCommands.push(this); ++com.newgrounds.APICommand._throttleCount; com.newgrounds.APICommand._throttleTimestamp = getTimer(); this.startLoader(connection.apiURL, v4, v12); }; v2.startLoader = function (url, data, contentType) { this._loader = LoadVars(data); this._loader.onData = this.as2CompleteHandler; this._loader.contentType = contentType; this._loader.sendAndLoad(url, this._loader, 'POST'); if (this._hasTimeout) { setInterval(this, this.onTimeout, com.newgrounds.APICommand.TIMEOUT_INTERVAL); } }; v2.as2CompleteHandler = function (data) { var v3; var v2 = 0; while (v2 < com.newgrounds.APICommand._pendingCommands.length) { if (com.newgrounds.APICommand._pendingCommands[v2]._loader == this) { v3 = com.newgrounds.APICommand._pendingCommands[v2]; break; } ++v2; } v3.onComplete(data); }; v2.onTimeout = function (event) { this.close(); com.newgrounds.Logger.logError('Command timed out.'); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_TIMED_OUT)); }; v2.onError = function (error) { com.newgrounds.Logger.logError('Error when sending command:', error); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_UNKNOWN)); this.close(); }; v2.onComplete = function (data) { com.newgrounds.Logger.logInternal('Received packet:', data); try { if (!data || data == '') { throw new Error(); } var v2 = com.newgrounds.encoders.json.JSON.decode(data); if (!v2) { throw new Error(); } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, v2, (v2 && v2.success) ? com.newgrounds.APIEvent.ERROR_NONE : com.newgrounds.APIEvent.ERROR_COMMAND_FAILED)); if (com.newgrounds.APICommand.bridge) { com.newgrounds.APICommand.bridge.sendEvent(v2.command_id, v2); } } catch (e) { com.newgrounds.Logger.logError('Invalid response returned from server: ' + data); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.COMMAND_COMPLETE, null, com.newgrounds.APIEvent.ERROR_BAD_RESPONSE)); } this.close(); }; v1.TIMEOUT_INTERVAL = 10000; v1.THROTTLE_INTERVAL = 10050; v1.THROTTLE_TICK_INTERVAL = 1000; v1.THROTTLE_THRESHOLD = 24; v1._throttleCount = 0; v1._commandQueue = []; v1._throttleTimer = setInterval(com.newgrounds.APICommand.onThrottleTimer, com.newgrounds.APICommand.THROTTLE_TICK_INTERVAL); v1.ENCRYPTOR_RADIX = '/g8236klvBQ#&|;Zb*7CEA59%s`Oue1wziFp$rDVY@TKxUPWytSaGHJ>dmoMR^<0~4qNLhc(I+fjn)X'; v1._encryptor = new com.newgrounds.encoders.BaseN(com.newgrounds.APICommand.ENCRYPTOR_RADIX); v1._pendingCommands = []; v1.CRLF = '\r\n'; v2.addProperty('command', v2.__get__command, v2.__set__command); v2.addProperty('hasSecureParameters', v2.__get__hasSecureParameters, function () {}); v2.addProperty('hasTimeout', v2.__get__hasTimeout, v2.__set__hasTimeout); v2.addProperty('parameters', v2.__get__parameters, v2.__set__parameters); v2.addProperty('preventCache', v2.__get__preventCache, v2.__set__preventCache); v2.addProperty('secureParameters', v2.__get__secureParameters, v2.__set__secureParameters); ASSetPropFlags(com.newgrounds.APICommand.prototype, null, 1); } #endinitclip } movieClip 39 __Packages.com.newgrounds.Bridge { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.Bridge) { var v1 = function (id) { super(); this._widgetId = id; this._inConnection = new LocalConnection(); this._outConnection = new LocalConnection(); var me = this; this._inConnection.receiveEvent = function () { me.receiveEvent.apply(me, arguments); }; this._inConnection.allowInsecureDomain = function (d) { return d == 'www.newgrounds.com' || d == 'newgrounds.com' || d == 'uploads.ungrounded.net'; }; this._inConnection.allowDomain = this._inConnection.allowInsecureDomain; this._inConnection.connect('_rec_' + this._widgetId); com.newgrounds.Logger.addEventListener(com.newgrounds.APIEvent.LOG, {'target': this, 'func': this.onLogMessage}); }; com.newgrounds.Bridge = v1; com.newgrounds.Bridge extends com.newgrounds.EventDispatcher; var v2 = v1.prototype; v2.__get__widgetId = function () { return this._widgetId; }; v2.onLogMessage = function (event) { try { this._outConnection.send(this._widgetId, 'sendEvent', 'trace', String(event.__get__data())); } }; v2.sendEvent = function (command, parameters) { if (this._outConnection) { parameters = {'data': parameters}; try { this._outConnection.send(this._widgetId, 'sendEvent', command, parameters); } } }; v2.receiveEvent = function (responseData) { var v2; try { v2 = com.newgrounds.encoders.json.JSON.decode(responseData); } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.BRIDGE_EVENT_RECEIVED, v2, (v2 == null) ? com.newgrounds.APIEvent.ERROR_UNKNOWN : null)); }; v2.onStatus = function (event) {}; v2.addProperty('widgetId', v2.__get__widgetId, function () {}); ASSetPropFlags(com.newgrounds.Bridge.prototype, null, 1); } #endinitclip } movieClip 35 __Packages.com.newgrounds.APIEvent { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.APIEvent) { var v1 = function (type, data, error) { super(type); if (data == undefined) { data = null; } if (error == undefined) { error = null; } if (!error || error == '' || error == com.newgrounds.APIEvent.ERROR_NONE) { this._error = com.newgrounds.APIEvent.ERROR_NONE; this._success = true; } else { this._error = error; this._success = false; } if (data) { this._data = data; } else { this._data = {}; } }; com.newgrounds.APIEvent = v1; com.newgrounds.APIEvent extends com.newgrounds.Event; var v2 = v1.prototype; v2.clone = function () { return new com.newgrounds.APIEvent(this.__get__type(), this._data, this._error); }; v2.__get__success = function () { return this._success; }; v2.__get__data = function () { return this._data; }; v2.__get__error = function () { return this._error; }; v1.COMMAND_COMPLETE = 'commandComplete'; v1.MEDAL_UNLOCK_CONFIRMED = 'medalUnlockConfirmed'; v1.ICON_LOADED = 'iconLoaded'; v1.BRIDGE_EVENT_RECEIVED = 'brdigeEventReceived'; v1.API_CONNECTED = 'movieConnected'; v1.LOG = 'log'; v1.MEDAL_UNLOCKED = 'medalUnlocked'; v1.SCORES_LOADED = 'scoresLoaded'; v1.SCORE_POSTED = 'scorePosted'; v1.QUERY_COMPLETE = 'queryComplete'; v1.FILE_LOADED = 'fileLoaded'; v1.FILE_SAVED = 'fileSaved'; v1.FILE_DELETED = 'fileDeleted'; v1.FILE_REQUESTED = 'fileRequested'; v1.VOTE_COMPLETE = 'voteComplete'; v1.USER_SIGNED_IN = 'userSignedIn'; v1.ERROR_NONE = 'noError'; v1.ERROR_UNKNOWN = 'unknownError'; v1.ERROR_COMMAND_FAILED = 'commandFailed'; v1.ERROR_NOT_CONNECTED = 'notConnected'; v1.ERROR_INVALID_ARGUMENT = 'invalidArgument'; v1.ERROR_TIMED_OUT = 'timedOut'; v1.ERROR_BAD_FILE = 'badFile'; v1.ERROR_BAD_RESPONSE = 'badResponse'; v1.ERROR_SENDING_COMMAND = 'errorSendingCommand'; v1.ERROR_HOST_BLOCKED = 'hostBlocked'; v1.ERROR_ALREADY_VOTED = 'alreadyVoted'; v1.ERROR_NOT_LOGGED_IN = 'notLoggedIn'; v1.ERROR_WRONG_ENCRYPTION_KEY = 'wrongEncryptionKey'; v1.ERROR_SIGN_IN_FAILED = 'signInFailed'; v2.addProperty('data', v2.__get__data, function () {}); v2.addProperty('error', v2.__get__error, function () {}); v2.addProperty('success', v2.__get__success, function () {}); ASSetPropFlags(com.newgrounds.APIEvent.prototype, null, 1); } #endinitclip } movieClip 54 __Packages.com.newgrounds.API { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.API) { var v1 = function () {}; com.newgrounds.API = v1; var v2 = v1.prototype; v1.__get__connected = function () { return com.newgrounds.API._connection.__get__connected(); }; v1.__get__isNetworkHost = function () { return com.newgrounds.API._connection.__get__isNetworkHost(); }; v1.__get__apiId = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.apiId; }; v1.__get__debugMode = function () { return com.newgrounds.API._debugMode; }; v1.__set__debugMode = function (val) { com.newgrounds.API._debugMode = val; return com.newgrounds.API.__get__debugMode(); }; v1.__get__publisherId = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.publisherId; }; v1.__get__sessionId = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.sessionId; }; v1.__get__hostDomain = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.hostDomain; }; v1.__get__hostURL = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.__get__hostURL(); }; v1.__get__isNewgrounds = function () { return com.newgrounds.API._connection.publisherId == 1; }; v1.__get__hasUserSession = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.__get__hasUserSession(); }; v1.__get__username = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.username; }; v1.__get__userId = function () { com.newgrounds.API._connection.assertInitialized(); return com.newgrounds.API._connection.userId; }; v1.assertConnected = function (eventType) { if (eventType == undefined) { eventType = null; } if (com.newgrounds.API._connection.assertConnected()) { return true; } else { if (eventType) { com.newgrounds.API.dispatchEvent(eventType, null, com.newgrounds.APIEvent.ERROR_NOT_CONNECTED); } return false; } }; v1.__get__serverTime = function () { return com.newgrounds.API._serverTime; }; v1.__get__adsApproved = function () { return com.newgrounds.API._adsApproved; }; v1.__get__adFeedURL = function () { return com.newgrounds.API._adFeedURL; }; v1.__get__medals = function () { return com.newgrounds.API._medalsArray; }; v1.__get__scoreBoards = function () { return com.newgrounds.API._scoreBoardsArray; }; v1.__get__saveGroups = function () { return com.newgrounds.API._saveGroupsArray; }; v1.connect = function (_root, apiId, encryptionKey, movieVersion) { if (encryptionKey == undefined) { encryptionKey = null; } if (movieVersion == undefined) { movieVersion = ''; } com.newgrounds.APIEventDispatcher.__set__globalDispatcher(com.newgrounds.API._dispatcher); System.security.loadPolicyFile('http://apifiles.ngfiles.com/crossdomain.xml'); if (com.newgrounds.API._connection.initialized) { com.newgrounds.Logger.logError('Connection already in progress. Please call API.disconnect() before attempting another connection.'); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_NOT_CONNECTED); return undefined; } apiId = com.newgrounds.API.trimWhitespace(apiId); if (encryptionKey) { encryptionKey = com.newgrounds.API.trimWhitespace(encryptionKey); } if (!apiId || apiId == '') { com.newgrounds.Logger.logError('No apiId given. Please use the API ID from your API settings page.'); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT); return undefined; } com.newgrounds.Logger.logMessage('====== Newgrounds API v' + com.newgrounds.API.VERSION + ' ======'); com.newgrounds.API._connection.connectionState = com.newgrounds.APIConnection.CONNECTING; _root = _root; com.newgrounds.API._movieVersion = movieVersion; com.newgrounds.API._connection.apiId = apiId; var v4; v4 = apiId.indexOf(':'); if (v4 != -1) { com.newgrounds.API._connection.trackerId = int(apiId.substring(0, v4)); } else { com.newgrounds.API._connection.trackerId = int(apiId); } if (!com.newgrounds.API._connection.trackerId) { com.newgrounds.Logger.logError('Invalid API ID: ' + apiId); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, false, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT); return undefined; } com.newgrounds.API._connection.encryptionKey = encryptionKey; com.newgrounds.API._connection.initialized = true; com.newgrounds.API._connection.__set__hostURL(_root._url); com.newgrounds.API.doConnect(_root); }; v1.doConnect = function (flashVars) { if (com.newgrounds.API.__get__isNetworkHost() && com.newgrounds.API._debugMode != com.newgrounds.API.RELEASE_MODE) { com.newgrounds.Logger.logMessage('Live file detected, turning off debug mode.'); com.newgrounds.API._debugMode = com.newgrounds.API.RELEASE_MODE; } if (flashVars && flashVars.NewgroundsAPI_SandboxID) { com.newgrounds.API._bridge = new com.newgrounds.Bridge(flashVars.NewgroundsAPI_SandboxID); com.newgrounds.APICommand.bridge = com.newgrounds.API._bridge; } else { com.newgrounds.API._bridge = new com.newgrounds.Bridge(com.newgrounds.crypto.MD5.hash(String(Math.random()))); com.newgrounds.APICommand.bridge = com.newgrounds.API._bridge; } if (com.newgrounds.API._debugMode == com.newgrounds.API.RELEASE_MODE) { if (flashVars) { if (flashVars.NewgroundsAPI_UserName) { com.newgrounds.API._connection.username = flashVars.NewgroundsAPI_UserName; } if (flashVars.NewgroundsAPI_UserID) { com.newgrounds.API._connection.userId = flashVars.NewgroundsAPI_UserID; } if (flashVars.NewgroundsAPI_PublisherID) { com.newgrounds.API._connection.publisherId = flashVars.NewgroundsAPI_PublisherID; } if (flashVars.NewgroundsAPI_UserpageFormat) { com.newgrounds.API._connection.userpageFormat = flashVars.NewgroundsAPI_UserpageFormat; } if (flashVars.NewgroundsAPI_SessionID) { com.newgrounds.API._connection.sessionId = flashVars.NewgroundsAPI_SessionID; } if (flashVars.NewgroundsAPI_SaveGroupID) { com.newgrounds.API._requestedSaveGroupId = flashVars.NewgroundsAPI_SaveGroupID; } if (flashVars.NewgroundsAPI_SaveFileID) { com.newgrounds.API._requestedSaveFileId = flashVars.NewgroundsAPI_SaveFileID; } } } else { com.newgrounds.API._connection.debug = true; if (com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_LOGGED_IN || com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_LOGGED_OUT) { com.newgrounds.API._connection.publisherId = 1; } if (com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_LOGGED_IN) { com.newgrounds.API._connection.sessionId = 'D3bu64p1U53R'; com.newgrounds.API._connection.userId = 10; com.newgrounds.API._connection.username = 'API-Debugger'; } } com.newgrounds.API._connection.sendSimpleCommand('connectMovie', com.newgrounds.API.onConnect, {'host': com.newgrounds.API._connection.hostDomain, 'movie_version': com.newgrounds.API._movieVersion, 'publisher_id': com.newgrounds.API._connection.publisherId}); }; v1.onConnect = function (event) { var v1 = event.__get__data(); if (!event.__get__success()) { com.newgrounds.Logger.logError('Unable to connect to the API.'); com.newgrounds.API._connection.reset(); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, event.__get__data(), event.__get__error()); return undefined; } if (com.newgrounds.API.__get__debugMode() != com.newgrounds.API.RELEASE_MODE) { com.newgrounds.API._adFeedURL = com.newgrounds.API.TEST_AD_FEED_URL; } else { if (v1.ad_url) { com.newgrounds.API._adFeedURL = unescape(v1.ad_url); } } switch (v1.ad_status) { case -1: com.newgrounds.Logger.logWarning('Your movie is not approved to run Flash Ads.'); break; case 0: com.newgrounds.Logger.logWarning('Your movie is still awaiting approval to run Flash Ads.'); break; case 1: com.newgrounds.Logger.logMessage('Your movie is approved to run Flash Ads!'); } com.newgrounds.API._adsApproved = v1.ad_status == 1; if (com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_HOST_BLOCKED || v1.deny_host) { com.newgrounds.Logger.logWarning(com.newgrounds.API._connection.hostDomain + ' does not have permission to host this movie!', 'Update your API configuration to allow this host.'); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, {'officialURL': unescape(v1.movie_url)}, com.newgrounds.APIEvent.ERROR_HOST_BLOCKED); com.newgrounds.API._connection.reset(); return undefined; } com.newgrounds.API._movieName = v1.movieName ? v1.movieName : ''; com.newgrounds.Logger.logMessage('Connecting to the Newgrounds API Gateway...', '----- ' + v1.movie_name + ' -----'); if (com.newgrounds.API._debugMode == com.newgrounds.API.DEBUG_MODE_NEW_VERSION) { v1.movie_version = 'Debug Mode'; } if (v1.movie_version) { com.newgrounds.Logger.logMessage('A new version of this movie is available.', 'Current version:\t' + com.newgrounds.API._movieVersion, 'Newest version:\t' + v1.movie_version, 'Use API.loadOfficialVersion() to link to the latest version.'); com.newgrounds.API._newVersion = true; } else { com.newgrounds.API._newVersion = false; } com.newgrounds.API._serverTime = new Date(int(v1.time) * 1000); if (v1.request_portal_url) { com.newgrounds.API._connection.sendSimpleCommand('setPortalID', null, {'portal_url': com.newgrounds.API._connection.__get__hostURL()}); } com.newgrounds.API._connection.sendSimpleCommand('preloadSettings', com.newgrounds.API.onMetadataLoaded, {'publisher_id': com.newgrounds.API._connection.publisherId, 'user_id': com.newgrounds.API._connection.userId}); }; v1.onMetadataLoaded = function (event) { var v11 = event.__get__data(); var v4; var v1; if (!event.__get__success()) { com.newgrounds.Logger.logWarning('Unable to load movie metadata.'); com.newgrounds.API.disconnect(); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, null, event.__get__error()); return undefined; } var v10 = 0; if (v11.medals) { v10 = v11.medals.length; var v18; if (com.newgrounds.API.__get__hasUserSession()) { v18 = com.newgrounds.API.loadLocal('medals_unlocked_' + com.newgrounds.API.__get__username()); } else { v18 = com.newgrounds.API.loadLocal('medals_unlocked'); } v4 = 0; while (v4 < v10) { var v5 = v11.medals[v4]; var v15 = v5.medal_unlocked; var v17 = v18 && v18[v5.medal_id]; var v14 = com.newgrounds.API.__get__hasUserSession() ? v15 : v17; if (com.newgrounds.API.__get__debugMode() != com.newgrounds.API.RELEASE_MODE) { v14 = false; } var v6 = new com.newgrounds.Medal(com.newgrounds.API._connection, v5.medal_id, v5.medal_name, v5.medal_description, Boolean(int(v5.secret)), v14, v5.medal_value, v5.medal_difficulty, v5.medal_icon); v6.addEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, com.newgrounds.API.onMedalUnlocked, false, 0, true); v6.addEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, com.newgrounds.API.onMedalUnlockConfirmed, false, 0, true); com.newgrounds.API._medals[v6.__get__name()] = v6; com.newgrounds.API._medalsArray.push(v6); com.newgrounds.Logger.logMessage(v6); if (com.newgrounds.API.__get__hasUserSession() && v17 && !v15) { com.newgrounds.Logger.logMessage('Server missed the "' + v6.__get__name() + '" unlock. Resending...'); v6.unlock(); } ++v4; } } com.newgrounds.Logger.logMessage(v10 + ' medal' + ((v10 != 1) ? 's' : '') + ' initialized.'); v10 = 0; if (v11.score_boards) { v10 = v11.score_boards.length; v4 = 0; while (v4 < v10) { var v16 = v11.score_boards[v4]; var v9 = new com.newgrounds.ScoreBoard(com.newgrounds.API._connection, v16.name, v16.id); com.newgrounds.API._scoreBoards[v9.__get__name()] = v9; com.newgrounds.API._scoreBoardsArray.push(v9); com.newgrounds.Logger.logMessage(v9); ++v4; } } com.newgrounds.Logger.logMessage(v10 + ' scoreboard' + ((v10 != 1) ? 's' : '') + ' initialized.'); v10 = 0; if (v11.save_groups) { v10 = v11.save_groups.length; v4 = 0; while (v4 < v10) { var v2 = v11.save_groups[v4]; var v13 = []; if (v2.keys) { v1 = 0; while (v1 < v2.keys.length) { var v7 = v2.keys[v1]; v13.push(new com.newgrounds.SaveKey(v7.name, v7.id, v7.type)); ++v1; } } var v12 = []; if (v2.ratings) { v1 = 0; while (v1 < v2.ratings.length) { var v3 = v2.ratings[v1]; v12.push(new com.newgrounds.SaveRating(v3.name, v3.id, v3.float, v3.min, v3.max)); ++v1; } } var v8 = new com.newgrounds.SaveGroup(com.newgrounds.API._connection, v2.group_name, v2.group_id, v2.group_type, v13, v12); com.newgrounds.API._saveGroups[v8.__get__name()] = v8; com.newgrounds.API._saveGroupsArray.push(v8); com.newgrounds.Logger.logMessage(v8); ++v4; } } com.newgrounds.Logger.logMessage(v10 + ' save group' + ((v10 != 1) ? 's' : '') + ' initialized.'); if (v11.save_file_path) { com.newgrounds.API._saveFilePath = v11.save_file_path + '/'; com.newgrounds.SaveFile._saveFilePath = com.newgrounds.API._saveFilePath; com.newgrounds.Logger.logInternal('Save file path: ' + com.newgrounds.API._saveFilePath); } if (v11.image_file_path) { com.newgrounds.API._imageFilePath = v11.image_file_path + '/'; com.newgrounds.SaveFile._imageFilePath = com.newgrounds.API._imageFilePath; com.newgrounds.Logger.logInternal('Image file path: ' + com.newgrounds.API._imageFilePath); } com.newgrounds.Logger.logMessage('Connection complete!'); com.newgrounds.API._connection.connectionState = com.newgrounds.APIConnection.CONNECTED; com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.API_CONNECTED, {'movieName': com.newgrounds.API._movieName, 'newVersion': com.newgrounds.API._newVersion}); if (com.newgrounds.API._requestedSaveFileId && com.newgrounds.API._requestedSaveGroupId) { com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.FILE_LOADED, com.newgrounds.API.onRequestedFileLoaded); com.newgrounds.API.loadSaveFile(com.newgrounds.API._requestedSaveFileId, false); } }; v1.disconnect = function () { if (!com.newgrounds.API._connection.__get__connected()) { com.newgrounds.Logger.logWarning('The Newgrounds API is already disconnected.'); return undefined; } com.newgrounds.API._connection.reset(); for (var v2 in com.newgrounds.API._medals) { var v1 = com.newgrounds.API._medals[v2]; v1.removeEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCKED, com.newgrounds.API.onMedalUnlocked); v1.removeEventListener(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, com.newgrounds.API.onMedalUnlockConfirmed); } com.newgrounds.API._newVersion = false; com.newgrounds.API._medals = new Object(); com.newgrounds.API._medalsArray = []; com.newgrounds.API._scoreBoards = new Object(); com.newgrounds.API._scoreBoardsArray = []; com.newgrounds.API._saveGroups = new Object(); com.newgrounds.API._saveGroupsArray = []; com.newgrounds.API._sharedObjects = new Object(); com.newgrounds.API._imageFilePath = null; com.newgrounds.API._saveFilePath = null; com.newgrounds.Logger.logMessage('Disconnected from the Newgrounds API.'); }; v1.loadNewgrounds = function () { com.newgrounds.API._connection.loadInBrowser('loadNewgrounds'); }; v1.loadOfficialVersion = function () { if (com.newgrounds.API._connection.assertInitialized()) { com.newgrounds.API._connection.loadInBrowser('loadOfficialVersion', false); } }; v1.promptSignIn = function () { if (com.newgrounds.API._connection.assertInitialized()) { getURL(com.newgrounds.API.PASSPORT_URL + com.newgrounds.API._bridge.__get__widgetId(), '_blank'); com.newgrounds.API._bridge.addEventListener(com.newgrounds.APIEvent.BRIDGE_EVENT_RECEIVED, com.newgrounds.API.onUserSignedIn, false, 0, true); } }; v1.onUserSignedIn = function (e) { com.newgrounds.API._bridge.removeEventListener(com.newgrounds.APIEvent.BRIDGE_EVENT_RECEIVED, com.newgrounds.API.onUserSignedIn); var v1 = e.__get__data(); if (e.__get__success()) { try { if (v1.NewgroundsAPI_UserName) { com.newgrounds.API._connection.username = v1.NewgroundsAPI_UserName; } if (v1.NewgroundsAPI_UserID) { com.newgrounds.API._connection.userId = v1.NewgroundsAPI_UserID; } if (v1.NewgroundsAPI_PublisherID) { com.newgrounds.API._connection.publisherId = v1.NewgroundsAPI_PublisherID; } if (v1.NewgroundsAPI_SessionID) { com.newgrounds.API._connection.sessionId = v1.NewgroundsAPI_SessionID; } com.newgrounds.API._connection.sendSimpleCommand('preloadSettings', com.newgrounds.API.onMetadataLoaded, {'publisher_id': com.newgrounds.API._connection.publisherId, 'user_id': com.newgrounds.API._connection.userId}); } com.newgrounds.Logger.logMessage('User ' + com.newgrounds.API._connection.username + ' signed in.'); } com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.USER_SIGNED_IN, null, e.__get__success() ? null : com.newgrounds.APIEvent.ERROR_SIGN_IN_FAILED); }; v1.loadMySite = function () { if (com.newgrounds.API._connection.assertInitialized()) { com.newgrounds.API._connection.loadInBrowser('loadMySite'); } }; v1.loadCustomLink = function (linkName) { if (com.newgrounds.API._connection.assertInitialized()) { com.newgrounds.API._connection.loadInBrowser('loadCustomLink', true, {'link': linkName}); } }; v1.getMedal = function (medalName) { return com.newgrounds.API._medals[medalName]; }; v1.unlockMedal = function (medalName) { if (!com.newgrounds.API.assertConnected()) { return undefined; } var v1 = com.newgrounds.API._medals[medalName]; if (!v1) { com.newgrounds.Logger.logError('No medal named "' + medalName + '" w.'); return undefined; } v1.unlock(); }; v1.onMedalUnlocked = function (event) { if (event.__get__success()) { var v2 = com.newgrounds.Medal(event.__get__data()); var v1; if (com.newgrounds.API.__get__hasUserSession()) { v1 = com.newgrounds.API.loadLocal('medals_unlocked_' + com.newgrounds.API.__get__username()); if (!v1) { v1 = new Object(); } v1[v2.__get__id()] = true; com.newgrounds.API.saveLocal('medals_unlocked_' + com.newgrounds.API.__get__username(), v1); } else { v1 = com.newgrounds.API.loadLocal('medals_unlocked'); if (!v1) { v1 = new Object(); } v1[(com.newgrounds.Medal(event.__get__data())).__get__id()] = true; com.newgrounds.API.saveLocal('medals_unlocked', v1); com.newgrounds.Logger.logMessage('User instanceof not logged in. Medal "' + v2.__get__name() + '" unlocked locally.'); } } }; v1.onMedalUnlockConfirmed = function (event) { if (com.newgrounds.API.__get__hasUserSession()) { var v1 = com.newgrounds.API.loadLocal('medals_unlocked_' + com.newgrounds.API.__get__username()); if (!v1) { v1 = new Object(); } else { delete v1[(com.newgrounds.Medal(event.__get__data())).__get__id()]; } com.newgrounds.API.saveLocal('medals_unlocked_' + com.newgrounds.API.__get__username(), v1); } }; v1.clearLocalMedals = function () { for (var v2 in com.newgrounds.API._medals) { var v1 = com.newgrounds.API._medals[v2]; v1.setUnlocked(false); } if (!com.newgrounds.API.__get__hasUserSession()) { com.newgrounds.API.saveLocal('medals_unlocked', new Object()); } }; v1.getScoreBoard = function (scoreBoardName) { if (!com.newgrounds.API.assertConnected()) { return null; } return com.newgrounds.API._scoreBoards[scoreBoardName]; }; v1.loadScores = function (scoreBoardName, period, firstResult, numResults, tag) { if (period == undefined) { period = 'All-Time'; } if (firstResult == undefined) { firstResult = 1; } if (numResults == undefined) { numResults = 10; } if (tag == undefined) { tag = null; } if (!com.newgrounds.API.assertConnected()) { return null; } var v1 = com.newgrounds.API._scoreBoards[scoreBoardName]; if (!v1) { com.newgrounds.Logger.logError('No scoreboard named "' + scoreBoardName + '" w.'); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.SCORES_LOADED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT); return null; } v1.__set__period(period); v1.__set__firstResult(firstResult); v1.__set__numResults(numResults); v1.__set__tag(tag); v1.loadScores(); return v1; }; v1.postScore = function (scoreBoardName, numericScore, tag) { if (tag == undefined) { tag = null; } if (!com.newgrounds.API.assertConnected()) { return undefined; } if (!com.newgrounds.API.__get__hasUserSession()) { com.newgrounds.Logger.logError('The user must be logged-in to post a score.'); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN); return undefined; } var v1 = com.newgrounds.API._scoreBoards[scoreBoardName]; if (!v1) { com.newgrounds.Logger.logError('No scoreboard named "' + scoreBoardName + '" w.'); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT); return undefined; } v1.postScore(numericScore, tag); }; v1.getSaveGroup = function (groupName) { if (!com.newgrounds.API.assertConnected()) { return null; } return com.newgrounds.API._saveGroups[groupName]; }; v1.getSaveGroupById = function (id) { for (var v3 in com.newgrounds.API._saveGroups) { var v1 = com.newgrounds.API._saveGroups[v3]; if (v1.__get__id() == id) { return v1; } } return null; }; v1.createSaveFile = function (groupName) { if (!com.newgrounds.API.assertConnected()) { return null; } var v1 = com.newgrounds.API.getSaveGroup(groupName); if (!v1) { com.newgrounds.Logger.logError('The save group "' + groupName + '" w found.'); return null; } return new com.newgrounds.SaveFile(v1); }; v1.loadSaveFile = function (saveId, loadContents) { if (loadContents == undefined) { loadContents = true; } com.newgrounds.API._connection.sendSimpleCommand('loadSaveFile', com.newgrounds.API.onFileLoaded, {'save_id': saveId, 'get_contents': loadContents}); }; v1.onFileLoaded = function (event) { var v2; if (event.__get__success()) { v2 = com.newgrounds.SaveFile.fromObject(com.newgrounds.API.getSaveGroupById((event.__get__data()).group_id), (event.__get__data()).file); if ((event.__get__data()).get_contents) { v2.load(); } else { com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.FILE_LOADED, v2); } } else { com.newgrounds.Logger.logError('Unable to load file:', event.__get__error()); com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.FILE_LOADED, null, event.__get__error()); } }; v1.createSaveQuery = function (groupName) { if (!com.newgrounds.API.assertConnected()) { return null; } var v1 = com.newgrounds.API.getSaveGroup(groupName); if (!v1) { com.newgrounds.Logger.logError('The save group "' + groupName + '" w found.'); return null; } var v2 = new com.newgrounds.SaveQuery(v1); return v2; }; v1.createSaveQueryByDate = function (groupName, sortDescending) { if (sortDescending == undefined) { sortDescending = true; } var v1 = com.newgrounds.API.createSaveQuery(groupName); if (!v1) { return null; } v1.sortOn(com.newgrounds.SaveQuery.CREATED_ON, sortDescending); return v1; }; v1.createSaveQueryByName = function (groupName, filename, exactMatch, sortDescending) { if (exactMatch == undefined) { exactMatch = false; } if (sortDescending == undefined) { sortDescending = false; } var v1 = com.newgrounds.API.createSaveQuery(groupName); if (!exactMatch) { v1.addCondition(com.newgrounds.SaveQuery.FILE_NAME, com.newgrounds.SaveQuery.OPERATOR_CONTAINS, filename); return v1; } v1.addCondition(com.newgrounds.SaveQuery.FILE_NAME, com.newgrounds.SaveQuery.OPERATOR_EQUAL, filename); return v1; }; v1.createSaveQueryByRating = function (groupName, ratingName, sortDescending) { if (sortDescending == undefined) { sortDescending = true; } var v1 = com.newgrounds.API.createSaveQuery(groupName); v1.sortOn(ratingName, sortDescending); return v1; }; v1.onRequestedFileLoaded = function (event) { com.newgrounds.API.removeEventListener(com.newgrounds.APIEvent.FILE_LOADED, com.newgrounds.API.onRequestedFileLoaded); if (event.__get__success()) { var v1 = event.__get__data(); if (v1) { com.newgrounds.API.dispatchEvent(com.newgrounds.APIEvent.FILE_REQUESTED, v1); } } }; v1.addEventListener = function (eventType, listener, priority, useWeakReference) { if (priority == undefined) { priority = 0; } if (useWeakReference == undefined) { useWeakReference = true; } com.newgrounds.API._dispatcher.addEventListener(eventType, listener, false, priority, useWeakReference); }; v1.removeEventListener = function (eventType, listener) { com.newgrounds.API._dispatcher.removeEventListener(eventType, listener); }; v1.dispatchEvent = function (event, data, error) { if (data == undefined) { data = null; } if (error == undefined) { error = null; } com.newgrounds.API._dispatcher.dispatchEvent(new com.newgrounds.APIEvent(event, data, error)); }; v1.saveLocal = function (saveId, saveData) { try { var v3; var v2 = 'ng_ap_secure_' + com.newgrounds.API._connection.trackerId + '_' + com.newgrounds.crypto.RC4.encrypt(saveId, com.newgrounds.API._connection.encryptionKey); if (!com.newgrounds.API._sharedObjects[saveId]) { com.newgrounds.API._sharedObjects[saveId] = SharedObject.getLocal(v2); } v3 = com.newgrounds.API._sharedObjects[saveId]; v3.data.data = com.newgrounds.API.encodeData(saveData); } catch (v0) { if (Error(v0) != null) { var error = Error(v0); com.newgrounds.Logger.logError('Unable to save local data.', error); return false; return true; } throw v0; } return true; }; v1.loadLocal = function (saveId) { try { var v1; var v3 = 'ng_ap_secure_' + com.newgrounds.API._connection.trackerId + '_' + com.newgrounds.crypto.RC4.encrypt(saveId, com.newgrounds.API._connection.encryptionKey); if (!com.newgrounds.API._sharedObjects[saveId]) { com.newgrounds.API._sharedObjects[saveId] = SharedObject.getLocal(v3); } v1 = com.newgrounds.API._sharedObjects[saveId]; if (v1 && v1.data && v1.data.data) { return com.newgrounds.API.decodeData(v1.data.data); } return null; } catch (v0) { if (Error(v0) != null) { var error = Error(v0); com.newgrounds.Logger.logError('Unable to load local data.', error); return null; } throw v0; } return null; }; v1.logCustomEvent = function (eventName) { if (com.newgrounds.API.assertConnected()) { com.newgrounds.Logger.logMessage('Logged event: ' + eventName); com.newgrounds.API._connection.sendSimpleCommand('logCustomEvent', null, {'event': eventName}); } }; v1.encodeData = function (data) { if (!com.newgrounds.API._connection.assertInitialized()) { return null; } return com.newgrounds.crypto.RC4.encrypt(com.newgrounds.encoders.json.JSON.encode(data), com.newgrounds.API._connection.encryptionKey); }; v1.decodeData = function (data) { if (!com.newgrounds.API._connection.assertInitialized()) { return null; } try { return com.newgrounds.encoders.json.JSON.decode(com.newgrounds.crypto.RC4.decrypt(data, com.newgrounds.API._connection.encryptionKey)); } catch (v0) { if (Error(v0) != null) { var error = Error(v0); return null; } throw v0; } return null; }; v1.stopPendingCommands = function () { com.newgrounds.APICommand.stopPendingCommands(); com.newgrounds.Logger.logMessage('Pending commands stopped.'); }; v1.trimWhitespace = function (string) { if (!string) { return null; } var v3 = 0; while (string.charAt(v3) == ' ') { ++v3; } var v1 = string.length - 1; for (;;) { if (!(string.charAt(v1) == ' ' && v1 >= 0)) break; --v1; } return string.slice(v3, v1 + 1); }; v1.VERSION = '3.2 AS2'; v1.RELEASE_MODE = 'releaseMode'; v1.DEBUG_MODE_LOGGED_IN = 'debugModeLoggedIn'; v1.DEBUG_MODE_LOGGED_OUT = 'debugModeLoggedOut'; v1.DEBUG_MODE_NEW_VERSION = 'debugModeNewVersion'; v1.DEBUG_MODE_HOST_BLOCKED = 'debugModeHostBlocked'; v1.TEST_AD_FEED_URL = 'http://www.ngads.com/adtest.php'; v1.PASSPORT_URL = 'https://www.newgrounds.com/login/remote/'; v1._dispatcher = new com.newgrounds.APIEventDispatcher(); v1._connection = new com.newgrounds.APIConnection(); v1._debugMode = com.newgrounds.API.DEBUG_MODE_LOGGED_IN; v1._adsApproved = false; v1._medals = new Object(); v1._medalsArray = []; v1._scoreBoards = new Object(); v1._scoreBoardsArray = []; v1._saveGroups = new Object(); v1._saveGroupsArray = []; v1._sharedObjects = new Object(); v1.addProperty('adFeedURL', v1.__get__adFeedURL, function () {}); v1.addProperty('adsApproved', v1.__get__adsApproved, function () {}); v1.addProperty('apiId', v1.__get__apiId, function () {}); v1.addProperty('connected', v1.__get__connected, function () {}); v1.addProperty('debugMode', v1.__get__debugMode, v1.__set__debugMode); v1.addProperty('hasUserSession', v1.__get__hasUserSession, function () {}); v1.addProperty('hostDomain', v1.__get__hostDomain, function () {}); v1.addProperty('hostURL', v1.__get__hostURL, function () {}); v1.addProperty('isNetworkHost', v1.__get__isNetworkHost, function () {}); v1.addProperty('isNewgrounds', v1.__get__isNewgrounds, function () {}); v1.addProperty('medals', v1.__get__medals, function () {}); v1.addProperty('publisherId', v1.__get__publisherId, function () {}); v1.addProperty('saveGroups', v1.__get__saveGroups, function () {}); v1.addProperty('scoreBoards', v1.__get__scoreBoards, function () {}); v1.addProperty('serverTime', v1.__get__serverTime, function () {}); v1.addProperty('sessionId', v1.__get__sessionId, function () {}); v1.addProperty('userId', v1.__get__userId, function () {}); v1.addProperty('username', v1.__get__username, function () {}); ASSetPropFlags(com.newgrounds.API.prototype, null, 1); } #endinitclip } movieClip 51 __Packages.com.newgrounds.encoders.ImageScanner { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.encoders) { _global.com.newgrounds.encoders = new Object(); } if (!_global.com.newgrounds.encoders.ImageScanner) { var v1 = function (hashLength, charsPerPixel) { if (hashLength) { this._hash = com.newgrounds.encoders.ImageScanner.DEFAULT_HASH.substr(0, hashLength); } this._baseN = new com.newgrounds.encoders.BaseN(this._hash); if (charsPerPixel) { this._charsPerPixel = charsPerPixel; } this.__set__encodeAlpha(false); }; com.newgrounds.encoders.ImageScanner = v1; var v2 = v1.prototype; v2.__get__encodeAlpha = function () { return this._encodeAlpha; }; v2.__set__encodeAlpha = function (v) { this._encodeAlpha = v; this._maxPerChannel = int(Math.pow(this._hash.length, this._charsPerPixel / (this._encodeAlpha ? 4 : 3))); if (this._maxPerChannel > 256) { this._maxPerChannel = 256; } return this.__get__encodeAlpha(); }; v2.encode = function (source, callbackFunction, callbackObject) { var v4 = {'callbackFunction': callbackFunction, 'callbackObject': callbackObject, 'source': source, 'x': 0, 'y': 0, 'output': null}; var v2 = source.width.toString(); var v3 = source.height.toString(); while (v2.length < 3) { v2 = '0' + v2; } while (v3.length < 3) { v3 = '0' + v3; } v4.output = v2 + v3; var v6 = setInterval(this, 'doEncode', com.newgrounds.encoders.ImageScanner.WORK_INTERVAL, v4); v4.interval = v6; }; v2.decode = function (source, callbackFunction, callbackObject) { var v4 = {'callbackFunction': callbackFunction, 'callbackObject': callbackObject, 'source': source, 'i': 6, 'x': 0, 'y': 0, 'output': null}; var v3 = source.substr(0, 3); var v2 = source.substr(3, 3); while (v3.charAt(0) == '0') { v3 = v3.substr(1); } while (v2.charAt(0) == '0') { v2 = v2.substr(1); } var v7 = int(v3); var v8 = int(v2); v4.output = new flash.display.BitmapData(v7, v8, this._encodeAlpha); var v6 = setInterval(this, 'doDecode', com.newgrounds.encoders.ImageScanner.WORK_INTERVAL, v4); v4.interval = v6; }; v2.doEncode = function (state) { var v3 = getTimer(); for (;;) { if (!(state.y < state.source.height && getTimer() - v3 < com.newgrounds.encoders.ImageScanner.WORK_INTERVAL)) break; state.output += this.encodePixel(state.source.getPixel32(state.x, state.y)); ++state.x; if (state.x == state.source.width) { state.x = 0; ++state.y; } } if (state.y == state.source.height) { clearInterval(state.interval); state.callbackFunction.call(state.callbackObject, state.output); } }; v2.doDecode = function (state) { var v4 = getTimer(); for (;;) { if (!(state.y < state.output.height && getTimer() - v4 < com.newgrounds.encoders.ImageScanner.WORK_INTERVAL)) break; var v3 = this.decodePixel(state.source.substr(state.i, this._charsPerPixel)); state.output.setPixel32(state.x, state.y, v3); state.i += this._charsPerPixel; ++state.x; if (state.x == state.output.width) { state.x = 0; ++state.y; } } if (state.y == state.output.height) { clearInterval(state.interval); state.callbackFunction.call(state.callbackObject, state.output); } }; v2.encodePixel = function (pixel) { var v3 = pixel >> 24 & 255; var v4 = pixel >> 16 & 255; var v5 = pixel >> 8 & 255; var v2 = pixel & 255; v3 = int((v3 / 256) * this._maxPerChannel); v4 = int((v4 / 256) * this._maxPerChannel); v5 = int((v5 / 256) * this._maxPerChannel); v2 = int((v2 / 256) * this._maxPerChannel); var v7 = v4 * this._maxPerChannel * this._maxPerChannel + v5 * this._maxPerChannel + v2; if (this._encodeAlpha) { v7 += v3 * this._maxPerChannel * this._maxPerChannel * this._maxPerChannel; } return this._baseN.encodeUint(v7, this._charsPerPixel); }; v2.decodePixel = function (encodedPixel) { var v3 = 255; var v5; var v6; var v4; var v7 = 0; var v2 = this._baseN.decodeUint(encodedPixel); v4 = v2 % this._maxPerChannel; v2 /= int(this._maxPerChannel); v6 = v2 % this._maxPerChannel; v2 /= int(this._maxPerChannel); v5 = v2 % this._maxPerChannel; v2 /= int(this._maxPerChannel); if (this._encodeAlpha) { v3 = v2 % this._maxPerChannel; v2 /= int(this._maxPerChannel); } return v3 << 24 | v5 << 16 | v6 << 8 | v4; }; v1.DEFAULT_HASH = '0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ<>?:;-_=+()!&'; v2._hash = com.newgrounds.encoders.ImageScanner.DEFAULT_HASH; v2._charsPerPixel = 2; v1.WORK_INTERVAL = 33.33333333333334; v2.addProperty('encodeAlpha', v2.__get__encodeAlpha, v2.__set__encodeAlpha); ASSetPropFlags(com.newgrounds.encoders.ImageScanner.prototype, null, 1); } #endinitclip } movieClip 52 __Packages.com.newgrounds.SaveFile { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.SaveFile) { var v1 = function (group) { super(); this._iconLoader = new com.newgrounds.BitmapLoader(com.newgrounds.SaveFile.DEFAULT_ICON, null); this._group = group; this._keys = {}; this._ratings = {}; this._numVotes = {}; }; com.newgrounds.SaveFile = v1; com.newgrounds.SaveFile extends com.newgrounds.APIEventDispatcher; var v2 = v1.prototype; v1.__get__currentFile = function () { return com.newgrounds.SaveFile._currentFile; }; v1.fromObject = function (group, fileData) { var v3 = new com.newgrounds.SaveFile(group); v3._name = fileData.filename; v3._description = fileData.description; v3._id = fileData.save_id; v3._authorId = fileData.user_id; v3._authorName = fileData.user_name; v3._createdDate = fileData.created; v3._modifiedDate = fileData.last_update; v3._views = fileData.views; if (fileData.thumb && fileData.thumb != '') { v3._iconLoader.__set__url(com.newgrounds.SaveFile._imageFilePath + fileData.thumb); } v3._dataURL = com.newgrounds.SaveFile._saveFilePath + fileData.file; v3._fileSize = fileData.file_size; v3._approved = fileData.status != com.newgrounds.SaveFile.STATUS_UNAPPROVED; v3._readOnly = false; v3._public = fileData.status != com.newgrounds.SaveFile.STATUS_PRIVATE && fileData.status != com.newgrounds.SaveFile.STATUS_UNAPPROVED; for (var v8 in fileData.keys) { var v6 = fileData.keys[v8]; var v4 = group.getKeyById(v6.id); if (v4) { v3._keys[v4.__get__name()] = v4.validateValue(v6.value); } } for (var v9 in fileData.ratings) { var v5 = fileData.ratings[v9]; var v2 = group.getRatingById(v5.id); if (v2) { v3._ratings[v2.__get__name()] = v2.validateValue(v5.score); v3._numVotes[v2.__get__name()] = int(v5.votes); } } return v3; }; v2.__get__group = function () { return this._group; }; v2.__get__name = function () { return this._name; }; v2.__set__name = function (val) { this._name = val; return this.__get__name(); }; v2.__get__description = function () { return this._description; }; v2.__set__description = function (val) { this._description = val; return this.__get__description(); }; v2.__get__id = function () { return this._id; }; v2.__get__data = function () { return this._data; }; v2.__set__data = function (val) { this._data = val; return this.__get__data(); }; v2.__get__bytesLoaded = function () { if (this._data) { return this.__get__bytesTotal(); } else { if (!this._dataLoader) { return 0; } else { return this._dataLoader.getBytesLoaded(); } } }; v2.__get__bytesTotal = function () { return this._fileSize; }; v2.__get__readOnly = function () { return this._readOnly; }; v2.__get__draft = function () { return this._draft; }; v2.__set__draft = function (v) { this._draft = v; return this.__get__draft(); }; v2.__get__authorId = function () { return this._authorId; }; v2.__get__authorName = function () { return this._authorName; }; v2.__get__keys = function () { return this._keys; }; v2.__get__ratings = function () { return this._ratings; }; v2.__get__numVotes = function () { return this._numVotes; }; v2.__get__views = function () { return this._views; }; v2.__get__createdDate = function () { return this._createdDate; }; v2.__get__updatedDate = function () { return this._modifiedDate; }; v2.toString = function () { return 'Save File: ' + this._name; }; v2.__get__icon = function () { return this._iconLoader.__get__bitmapData(); }; v2.__set__icon = function (v) { this.createIcon(v); return this.__get__icon(); }; v2.__get__iconLoaded = function () { return this._iconLoader.__get__loaded(); }; v2.createIcon = function (source) { var v9 = new flash.display.BitmapData(com.newgrounds.SaveFile.ICON_WIDTH, com.newgrounds.SaveFile.ICON_HEIGHT, false, 0); var v7; var v6; var v10 = 0; var v8 = 0; if (source instanceof flash.display.BitmapData) { v7 = source.width; v6 = source.height; } else { if (source instanceof MovieClip) { var v2 = (MovieClip(source)).getBounds(source); v7 = v2.xMax - v2.xMin; v6 = v2.yMax - v2.yMin; v10 = v2.xMin; v8 = v2.yMin; } } var v4 = new flash.geom.Matrix(); var v5; v5 = Math.min(com.newgrounds.SaveFile.ICON_WIDTH / v7, com.newgrounds.SaveFile.ICON_HEIGHT / v6); v4.translate(-v10, -v8); v4.scale(v5, v5); v4.translate((com.newgrounds.SaveFile.ICON_WIDTH - v7 * v5) / 2, (com.newgrounds.SaveFile.ICON_HEIGHT - v6 * v5) / 2); v9.draw(source, v4); this._iconLoader.__set__bitmapData(v9); }; v2.attachIcon = function (parent) { if (this._iconLoader) { return this._iconLoader.attachBitmap(parent); } com.newgrounds.Logger.logError('No icon available for this sumbission.'); return null; }; v2.deleteFile = function () { if (!(this._group.__get__connection()).__get__hasUserSession()) { com.newgrounds.Logger.logError('The user must be logged-in to delete a file.'); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN)); return undefined; } if (!this._id) { com.newgrounds.Logger.logError('The file does not exist.'); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN)); return undefined; } var v2 = new com.newgrounds.APICommand('deleteSaveFile'); (v2.__get__secureParameters()).save_id = this._id; v2.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, {'target': this, 'func': this.onFileDeleted}); (this._group.__get__connection()).sendCommand(v2); }; v2.save = function () { if (!(this._group.__get__connection()).__get__hasUserSession()) { com.newgrounds.Logger.logError('The user must be logged-in to save a file.'); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, null, com.newgrounds.APIEvent.ERROR_NOT_LOGGED_IN)); return undefined; } ++com.newgrounds.BitmapLoader._cacheSeed; com.newgrounds.SaveFile._currentFile = this; if (this.__get__iconLoaded()) { com.newgrounds.SaveFile.ICON_IMAGE_SCANNER.encode(this.__get__icon(), this.onIconEncoded, this); } else { this.encodeData(true); } }; v2.onIconEncoded = function (encodedIcon) { this._encodedIcon = encodedIcon; this.encodeData(true); }; v2.doSave = function () { var v4 = new com.newgrounds.APICommand('saveFile'); (v4.__get__secureParameters()).group = this._group.id; (v4.__get__secureParameters()).user_name = (this._group.__get__connection()).username; (v4.__get__secureParameters()).filename = this._name; (v4.__get__secureParameters()).description = this._description; if (this._draft) { (v4.__get__secureParameters()).draft = true; } if (this._id && !this._readOnly) { (v4.__get__secureParameters()).overwrite = 1; (v4.__get__secureParameters()).save_id = this._id; } var v8 = []; for (var v9 in this._keys) { var v2 = this._group.getKey(v9); if (v2) { v8.push({'id': v2.__get__id(), 'value': v2.validateValue(this._keys[v9])}); } else { com.newgrounds.Logger.logError('No key named "' + v9 + '" in save group "' + this._group.__get__name() + '".'); } } (v4.__get__secureParameters()).keys = v8; var v7 = []; for (var v10 in this._ratings) { var v3 = this._group.getRating(v10); if (v3) { v7.push({'id': v3.__get__id(), 'value': v3.validateValue(this._ratings[v10])}); } else { com.newgrounds.Logger.logError('No rating named "' + v10 + '" in save group "' + this._group.__get__name() + '".'); } } (v4.__get__secureParameters()).ratings = v7; if (typeof this._encodedData == 'string') { v4.addFile('file', this._encodedData, 'file'); } else { v4.addFile('file', com.newgrounds.encoders.json.JSON.encode(this._encodedData), 'file'); } if (this.__get__iconLoaded()) { v4.addFile('thumbnail', this._encodedIcon, 'thumbnail'); } v4.addEventListener(com.newgrounds.APIEvent.COMMAND_COMPLETE, {'target': this, 'func': this.onSaveComplete}); (this._group.__get__connection()).sendCommand(v4); }; v2.encodeData = function (encode) { this._encoderQueue = []; this._encoding = encode; if (encode) { this._encodedData = this._data; this.preEncodeObject(this, '_encodedData'); } else { this.preEncodeObject(this, '_data'); } this.encodeObject(); }; v2.preEncodeObject = function (parent, property) { var v3 = parent[property]; var v5; try { if (this._encoding) { v5 = v3 instanceof flash.display.BitmapData; } else { v5 = v3.type == '__bitmap'; } } var v2 = v3; var v8; if (v5) { this._encoderQueue.push({'parent': parent, 'property': property}); } else { if (typeof v3 == 'object' && !v8) { if (this._encoding) { if (v3 instanceof Array) { v2 = []; } else { v2 = {}; } for (var v4 in v3) { v2[v4] = v3[v4]; } parent[property] = v2; } for (v4 in v2) { this.preEncodeObject(v2, v4); } } } }; v2.encodeObject = function () { if (!this._encoderQueue.length) { if (this._encoding) { this.doSave(); } else { this._dataLoaded = true; this.checkLoadComplete(); } return undefined; } var v6 = this._encoderQueue.pop(); var v4 = v6.parent; var v3 = v6.property; var v2 = v4[v3]; var v5; if (this._encoding) { v5 = {'type': '__bitmap', 'width': v2.width, 'height': v2.height, 'transparent': v2.transparent}; v4[v3] = v5; this._encodingParent = v5; this._encodingProperty = 'data'; com.newgrounds.SaveFile.DATA_IMAGE_SCANNER.__set__encodeAlpha(v2.transparent); com.newgrounds.SaveFile.DATA_IMAGE_SCANNER.encode(flash.display.BitmapData(v2), this.encodeBitmapComplete, this); } else { this._encodingParent = v4; this._encodingProperty = v3; com.newgrounds.SaveFile.DATA_IMAGE_SCANNER.__set__encodeAlpha(v2.transparent); com.newgrounds.SaveFile.DATA_IMAGE_SCANNER.decode(String(v2.data), this.encodeBitmapComplete, this); } }; v2.encodeBitmapComplete = function (data) { this._encodingParent[this._encodingProperty] = data; this.encodeObject(); }; v2.load = function () { com.newgrounds.SaveFile._currentFile = this; this._dataLoaded = false; this._data = null; if (!this.__get__iconLoaded()) { this._iconLoader.addEventListener(com.newgrounds.APIEvent.ICON_LOADED, {'target': this, 'func': this.onIconLoaded}); this._iconLoader.load(); } this._dataLoader = new LoadVars(); var file = this; this._dataLoader.onData = function (data) { file.onDataLoaded(data); }; this._dataLoader.load(this._dataURL + '&random=' + Math.random()); }; v2.onIconLoaded = function (event) { if (!event.__get__success() && this._iconLoader.__get__url()) { com.newgrounds.Logger.logWarning('Unable to load the icon for this save file.'); } this._iconLoader.removeEventListener(com.newgrounds.APIEvent.ICON_LOADED, this.onIconLoaded); this.checkLoadComplete(); }; v2.checkLoadComplete = function () { if (this._dataLoaded && this.__get__iconLoaded()) { com.newgrounds.Logger.logMessage('Data loaded.'); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this)); } }; v2.onDataLoaded = function (data) { try { if (data) { if (data.charAt(0) == '{') { this._data = com.newgrounds.encoders.json.JSON.decode(String(data)); } else { this._data = String(data); } this.encodeData(false); } } catch (v0) { if (Error(v0) != null) { var error = Error(v0); com.newgrounds.Logger.logError('Error while loading data:', error); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this, com.newgrounds.APIEvent.ERROR_BAD_FILE)); } else { throw v0; } } }; v2.onDataError = function (error) { com.newgrounds.Logger.logError('Unable to load data:', error); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_LOADED, this, com.newgrounds.APIEvent.ERROR_BAD_FILE)); }; v2.onSaveComplete = function (event) { if (event.__get__success()) { com.newgrounds.Logger.logMessage('File "' + this._name + '" saved!'); if (event.__get__data()) { this._id = (event.__get__data()).save_id; this._dataURL = unescape((event.__get__data()).file_url); } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, this)); } else { com.newgrounds.Logger.logError('Error saving file "' + this._name + '":', event.__get__error()); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_SAVED, this, event.__get__error())); } }; v2.sendVote = function (ratingName, vote) { var v2 = this._group.getRating(ratingName); if (!v2) { com.newgrounds.Logger.logError('No save rating named "' + ratingName + '" exists for this save group.'); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, {}, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT)); return undefined; } vote = v2.validateValue(vote); if (isNaN(vote)) { com.newgrounds.Logger.logError('Invalid vote (' + vote + '). ' + ratingName + ' allows a range of ' + v2.__get__minimum() + '-' + v2.__get__maximum() + '.'); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, {}, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT)); return undefined; } com.newgrounds.Logger.logMessage('Voting ' + vote + ' for ' + ratingName + ' on ' + this._name + '...'); (this._group.__get__connection()).sendSimpleCommand('rateSaveFile', {'target': this, 'func': this.onVoteComplete}, null, {'group': this._group.__get__id(), 'save_id': this._id, 'rating_id': v2.__get__id(), 'vote': vote}); }; v2.onVoteComplete = function (event) { var v2 = event.__get__error(); if ((event.__get__data()).already_voted) { com.newgrounds.Logger.logError('Vote failed. You\'ve already voted on this rating today.'); v2 = com.newgrounds.APIEvent.ERROR_ALREADY_VOTED; } if (v2 == com.newgrounds.APIEvent.ERROR_NONE) { var v3 = this._group.getRatingById((event.__get__data()).rating_id); if (v3) { this._ratings[v3.__get__name()] = v3.validateValue((event.__get__data()).score); } com.newgrounds.Logger.logMessage('Vote complete!'); } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.VOTE_COMPLETE, this, v2)); }; v2.onFileDeleted = function (event) { if (event.__get__success()) { this._id = 0; } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.FILE_DELETED, this, event.__get__error())); }; v2.clone = function () { var v3 = new com.newgrounds.SaveFile(this._group); v3._data = this._data; v3._description = this._description; v3._draft = this._draft; v3._fileSize = this._fileSize; v3._iconLoader.__set__bitmapData(this._iconLoader.bitmapData); var v2; for (v2 in this._keys) { v3._keys[v2] = this._keys[v2]; } for (v2 in this._ratings) { v3._ratings[v2] = this._ratings[v2]; } for (v2 in this._numVotes) { v3._numVotes[v2] = this._numVotes[v2]; } v3._name = this._name; return v3; }; v1.ICON_WIDTH = 90; v1.ICON_HEIGHT = 90; v1.DEFAULT_ICON = new flash.display.BitmapData(com.newgrounds.SaveFile.ICON_WIDTH, com.newgrounds.SaveFile.ICON_HEIGHT, false, 0); v1.STATUS_PRIVATE = 0; v1.STATUS_SHARED = 1; v1.STATUS_UNAPPROVED = 2; v1.STATUS_APPROVED = 3; v1._imageFilePath = ''; v1._saveFilePath = ''; v1.ICON_IMAGE_SCANNER = new com.newgrounds.encoders.ImageScanner(); v1.DATA_IMAGE_SCANNER = new com.newgrounds.encoders.ImageScanner(64, 6); v2.addProperty('authorId', v2.__get__authorId, function () {}); v2.addProperty('authorName', v2.__get__authorName, function () {}); v2.addProperty('bytesLoaded', v2.__get__bytesLoaded, function () {}); v2.addProperty('bytesTotal', v2.__get__bytesTotal, function () {}); v2.addProperty('createdDate', v2.__get__createdDate, function () {}); v1.addProperty('currentFile', v1.__get__currentFile, function () {}); v2.addProperty('data', v2.__get__data, v2.__set__data); v2.addProperty('description', v2.__get__description, v2.__set__description); v2.addProperty('draft', v2.__get__draft, v2.__set__draft); v2.addProperty('group', v2.__get__group, function () {}); v2.addProperty('icon', v2.__get__icon, v2.__set__icon); v2.addProperty('iconLoaded', v2.__get__iconLoaded, function () {}); v2.addProperty('id', v2.__get__id, function () {}); v2.addProperty('keys', v2.__get__keys, function () {}); v2.addProperty('name', v2.__get__name, v2.__set__name); v2.addProperty('numVotes', v2.__get__numVotes, function () {}); v2.addProperty('ratings', v2.__get__ratings, function () {}); v2.addProperty('readOnly', v2.__get__readOnly, function () {}); v2.addProperty('updatedDate', v2.__get__updatedDate, function () {}); v2.addProperty('views', v2.__get__views, function () {}); ASSetPropFlags(com.newgrounds.SaveFile.prototype, null, 1); } #endinitclip } movieClip 50 __Packages.com.newgrounds.SaveGroup { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.SaveGroup) { var v1 = function (connection, name, id, type, keys, ratings) { this._connection = connection; this._id = id; this._name = name; this._type = type; this._keysArray = keys; this._ratingsArray = ratings; this._keys = new Object(); this._ratings = new Object(); var v11; for (var v7 in keys) { var v2 = keys[v7]; this._keys[v2.__get__name()] = v2; } for (var v6 in ratings) { var v3 = ratings[v6]; this._ratings[v3.__get__name()] = v3; } }; com.newgrounds.SaveGroup = v1; var v2 = v1.prototype; v2.__get__connection = function () { return this._connection; }; v2.__get__name = function () { return this._name; }; v2.__get__type = function () { return this._type; }; v2.__get__id = function () { return this._id; }; v2.__get__keys = function () { return this._keysArray; }; v2.__get__ratings = function () { return this._ratingsArray; }; v2.getKey = function (name) { return this._keys[name]; }; v2.getRating = function (name) { return this._ratings[name]; }; v2.getKeyById = function (id) { for (var v4 in this._keys) { var v2 = this._keys[v4]; if (v2.__get__id() == id) { return v2; } } return null; }; v2.getRatingById = function (id) { for (var v4 in this._ratings) { var v2 = this._ratings[v4]; if (v2.__get__id() == id) { return v2; } } return null; }; v2.toString = function () { return 'SaveGroup: ' + this.__get__name() + ' Keys: ' + this._keysArray + ' Ratings: ' + this._ratingsArray; }; v1.TYPE_SYSTEM = 0; v1.TYPE_PRIVATE = 1; v1.TYPE_PUBLIC = 2; v1.TYPE_MODERATED = 3; v2.addProperty('connection', v2.__get__connection, function () {}); v2.addProperty('id', v2.__get__id, function () {}); v2.addProperty('keys', v2.__get__keys, function () {}); v2.addProperty('name', v2.__get__name, function () {}); v2.addProperty('ratings', v2.__get__ratings, function () {}); v2.addProperty('type', v2.__get__type, function () {}); ASSetPropFlags(com.newgrounds.SaveGroup.prototype, null, 1); } #endinitclip } movieClip 48 __Packages.com.newgrounds.SaveKey { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.SaveKey) { var v1 = function (name, id, type) { this._name = name; this._id = id; this._type = type; }; com.newgrounds.SaveKey = v1; var v2 = v1.prototype; v2.__get__name = function () { return this._name; }; v2.__get__id = function () { return this._id; }; v2.__get__type = function () { return this._type; }; v2.validateValue = function (value) { switch (this._type) { return null; case com.newgrounds.SaveKey.TYPE_INTEGER: value = Number(value); if (!isNaN(value)) { var v3 = int(value); if (v3 != value) { com.newgrounds.Logger.logWarning('Float value ' + value + ' given for integer key "' + this._name + '". Clamping to ' + v3 + '.'); } return v3; } return null; case com.newgrounds.SaveKey.TYPE_FLOAT: value = Number(value); if (!isNaN(value)) { return isNaN(Number(value)); } return null; case com.newgrounds.SaveKey.TYPE_BOOLEAN: return Boolean(value) && int(value) != 0; return null; case com.newgrounds.SaveKey.TYPE_STRING: return value ? value.toString() : ''; return null; } return null; }; v2.toString = function () { return this._name; }; v1.TYPE_FLOAT = 1; v1.TYPE_INTEGER = 2; v1.TYPE_STRING = 3; v1.TYPE_BOOLEAN = 4; v2.addProperty('id', v2.__get__id, function () {}); v2.addProperty('name', v2.__get__name, function () {}); v2.addProperty('type', v2.__get__type, function () {}); ASSetPropFlags(com.newgrounds.SaveKey.prototype, null, 1); } #endinitclip } movieClip 49 __Packages.com.newgrounds.SaveRating { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.SaveRating) { var v1 = function (name, id, isFloat, minimum, maximum) { this._name = name; this._id = id; this._isFloat = isFloat; this._minimum = minimum; this._maximum = maximum; }; com.newgrounds.SaveRating = v1; var v2 = v1.prototype; v2.__get__name = function () { return this._name; }; v2.__get__id = function () { return this._id; }; v2.__get__isFloat = function () { return this._isFloat; }; v2.__get__minimum = function () { return this._minimum; }; v2.__get__maximum = function () { return this._maximum; }; v2.validateValue = function (value) { var v2 = Number(value); if (isNaN(v2)) { com.newgrounds.Logger.logError('Invalid value for rating "' + this._name + '".'); return NaN; } if (v2 < this._minimum) { com.newgrounds.Logger.logWarning(v2 + ' is out of acceptable range for rating "' + this._name + '". Clamping to ' + this._minimum + '.'); return this._minimum; } if (v2 > this._maximum) { com.newgrounds.Logger.logWarning(v2 + ' is out of acceptable range for rating "' + this._name + '". Clamping to ' + this._maximum + '.'); return this._maximum; } if (!this.__get__isFloat()) { var v3 = int(v2); if (v3 != v2) { com.newgrounds.Logger.logWarning('Float value ' + v2 + ' given for integer rating "' + this._name + '". Clamping to ' + v3 + '.'); } return v3; } return v2; }; v2.toString = function () { return this._name; }; v2.addProperty('id', v2.__get__id, function () {}); v2.addProperty('isFloat', v2.__get__isFloat, function () {}); v2.addProperty('maximum', v2.__get__maximum, function () {}); v2.addProperty('minimum', v2.__get__minimum, function () {}); v2.addProperty('name', v2.__get__name, function () {}); ASSetPropFlags(com.newgrounds.SaveRating.prototype, null, 1); } #endinitclip } movieClip 44 __Packages.com.newgrounds.BitmapLoader { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.BitmapLoader) { var v1 = function (defaultBitmap, url) { super(); this._bitmapData = defaultBitmap; this._url = url; }; com.newgrounds.BitmapLoader = v1; com.newgrounds.BitmapLoader extends com.newgrounds.APIEventDispatcher; var v2 = v1.prototype; v2.__get__url = function () { return this._url; }; v2.__set__url = function (v) { this._loaded = false; this._url = v; return this.__get__url(); }; v2.__get__bitmapData = function () { return this._bitmapData; }; v2.__set__bitmapData = function (v) { this._bitmapData = v; this._loaded = true; return this.__get__bitmapData(); }; v2.__get__loaded = function () { return this._loaded; }; v2.disposeLoader = function () { if (this._loader) { if (this._loaderClip._parent == _root) { this._loader.unloadClip(this._loaderClip.bitmap); this._loaderClip.removeMovieClip(); } this._loader = null; this._loaderClip = null; } }; v2.load = function () { if (!this._url || this._url == '') { this.onLoadComplete(); return undefined; } this._loaded = false; if (this._bitmapData) { this._bitmapData.dispose(); this._bitmapData = null; } this.disposeLoader(); this.attachBitmap(null); }; v2.attachBitmap = function (parent) { if (!parent) { parent = _root; } var v5 = parent.getNextHighestDepth(); var v3 = parent.createEmptyMovieClip('__bitmap' + v5, v5); if (!this._loaded && this._url && this._url != '') { v3.createEmptyMovieClip('bitmap', 0); this._loader = new MovieClipLoader(); this._loaderClip = v3; if (parent == _root) { this._loaderClip._visible = false; } var thisObj = this; this._loaderClip.onEnterFrame = function () { thisObj.pollLoad(); }; this._loader.addListener({'onLoadError': function () { thisObj.onLoadComplete(); }}); this._loader.loadClip(this._url, v3.bitmap); return v3; } v3.attachBitmap(this._bitmapData, 0); return v3; }; v2.pollLoad = function () { if (this._loaderClip._width) { this.onLoadComplete(); } }; v2.onLoadComplete = function () { var v2; if (this._loader && this._loaderClip && this._loaderClip._width) { try { this._loaderClip.onEnterFrame = null; v2 = new flash.display.BitmapData(this._loaderClip._width, this._loaderClip._height, true, 0); v2.draw(this._loaderClip); this._bitmapData = v2; this._loaded = true; } catch (error) { if (v2) { v2.dispose(); } } } this.disposeLoader(); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.ICON_LOADED, this, this._loaded ? null : com.newgrounds.APIEvent.ERROR_BAD_FILE)); }; v1._cacheSeed = 0; v2._loaded = true; v2.addProperty('bitmapData', v2.__get__bitmapData, v2.__set__bitmapData); v2.addProperty('loaded', v2.__get__loaded, function () {}); v2.addProperty('url', v2.__get__url, v2.__set__url); ASSetPropFlags(com.newgrounds.BitmapLoader.prototype, null, 1); } #endinitclip } movieClip 53 __Packages.com.newgrounds.SaveQuery { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.SaveQuery) { var v1 = function (group) { super(); this._group = group; this._connection = group.connection; this.reset(); }; com.newgrounds.SaveQuery = v1; com.newgrounds.SaveQuery extends com.newgrounds.APIEventDispatcher; var v2 = v1.prototype; v2.__get__group = function () { return this._group; }; v2.__get__resultsPerPage = function () { return this._resultsPerPage; }; v2.__set__resultsPerPage = function (val) { this._resultsPerPage = Math.min(Math.max(val, 1), 100); return this.__get__resultsPerPage(); }; v2.__get__page = function () { return this._page; }; v2.__set__page = function (val) { this._page = Math.max(val, 1); return this.__get__page(); }; v2.prevPage = function () { this.__set__page(this.__get__page() - 1); }; v2.nextPage = function () { this.__set__page(this.__get__page() + 1); }; v2.__get__isRandomized = function () { return this._isRandomized; }; v2.__set__isRandomized = function (val) { this._isRandomized = val; return this.__get__isRandomized(); }; v2.__get__files = function () { return this._files; }; v2.reset = function () { this._page = 1; this._resultsPerPage = 10; this._isRandomized = false; this._lookupKeys = []; this._lookupRatings = []; this._fileConditions = []; this._keyConditions = []; this._ratingConditions = []; this._sortFields = []; this._files = []; this.includeAllFields(); }; v2.clone = function () { var v2 = new com.newgrounds.SaveQuery(this._group); v2._page = this._page; v2._resultsPerPage = this._resultsPerPage; v2._isRandomized = this._isRandomized; v2._lookupKeys = this._lookupKeys.concat(); v2._lookupRatings = this._lookupRatings.concat(); v2._fileConditions = this._fileConditions.concat(); v2._keyConditions = this._keyConditions.concat(); v2._ratingConditions = this._ratingConditions.concat(); return v2; }; v2.includeAllFields = function () { for (var v5 in this._group.__get__keys()) { var v2 = (this._group.__get__keys())[v5]; this._lookupKeys.push(v2.__get__id()); } for (var v4 in this._group.__get__ratings()) { var v3 = (this._group.__get__ratings())[v4]; this._lookupRatings.push(v3.__get__id()); } }; v2.addCondition = function (field, operator, value) { var v2; v2 = 0; while (v2 < com.newgrounds.SaveQuery.FILE_FIELDS.length) { if (com.newgrounds.SaveQuery.FILE_FIELDS[v2] == field) { break; } ++v2; } if (v2 == com.newgrounds.SaveQuery.FILE_FIELDS.length) { v2 = -1; } if (v2 >= 0) { this._fileConditions.push({'field': v2, 'operator': operator, 'value': value}); } else { var v4 = this._group.getKey(field); if (v4) { value = v4.validateValue(value); this._keyConditions.push({'key_id': v4.__get__id(), 'operator': operator, 'value': value}); return undefined; } var v3 = field.split('.'); var v6 = this._group.getRating(v3[0]); if (v6) { if (v3[1] != 'votes') { value = v6.validateValue(value); } this._ratingConditions.push({'rating_id': v6.__get__id(), 'operator': operator, 'value': value, 'column': v3[1] ? v3[1] : 'score'}); return undefined; } com.newgrounds.Logger.logError('The save group "' + this._group.__get__name() + '" does not have a field named "' + field + '".'); } }; v2.sortOn = function (field, sortDescending) { if (sortDescending == undefined) { sortDescending = false; } var v2; v2 = 0; while (v2 < com.newgrounds.SaveQuery.FILE_FIELDS.length) { if (com.newgrounds.SaveQuery.FILE_FIELDS[v2] == field) { break; } ++v2; } if (v2 == com.newgrounds.SaveQuery.FILE_FIELDS.length) { v2 = -1; } if (v2 >= 0) { this._sortFields.push({'table': com.newgrounds.SaveQuery.TABLE_FILES, 'field': v2, 'desc': sortDescending}); } else { var v5 = this._group.getKey(field); if (v5) { this._sortFields.push({'table': com.newgrounds.SaveQuery.TABLE_KEYS, 'field': v5.__get__id(), 'desc': sortDescending}); return undefined; } var v3 = field.split('.'); var v6 = this._group.getRating(v3[0]); if (v6) { this._sortFields.push({'table': com.newgrounds.SaveQuery.TABLE_RATINGS, 'field': v6.__get__id(), 'desc': sortDescending, 'extra': v3[1] ? v3[1] : 'score'}); return undefined; } com.newgrounds.Logger.logError('The save group "' + this._group.__get__name() + '" does not have a field named "' + field + '".'); } }; v2.execute = function () { var v5 = {}; v5.page = this._page; v5.num_results = this._resultsPerPage; if (this._isRandomized) { v5.randomize = 1; } if (this._lookupKeys && this._lookupKeys.length) { v5.lookup_keys = this._lookupKeys; } if (this._lookupRatings && this._lookupRatings.length) { v5.lookup_ratings = this._lookupRatings; } if (this._fileConditions && this._fileConditions.length) { v5.file_conditions = this._fileConditions; } if (this._keyConditions && this._keyConditions.length) { v5.key_conditions = this._keyConditions; } if (this._ratingConditions && this._ratingConditions.length) { v5.rating_conditions = this._ratingConditions; } if (this._sortFields && this._sortFields.length) { v5.sort_conditions = this._sortFields; } this._connection.sendSimpleCommand('lookupSaveFiles', {'target': this, 'func': this.onQueryComplete}, {'publisher_id': this._connection.publisherId, 'group_id': this._group.__get__id(), 'query': v5}); }; v2.onQueryComplete = function (event) { if (event.__get__success()) { var v4 = event.__get__data(); this._files = []; if (v4.files) { var v2 = 0; while (v2 < v4.files.length) { var v3 = com.newgrounds.SaveFile.fromObject(this._group, v4.files[v2]); if (v3) { this._files.push(v3); } ++v2; } } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.QUERY_COMPLETE, this)); } else { com.newgrounds.Logger.logError('Query failed: ' + event.__get__error()); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.QUERY_COMPLETE, this, event.__get__error())); } }; v1.FILE_ID = 'fileId'; v1.AUTHOR_ID = 'authorId'; v1.AUTHOR_NAME = 'authorName'; v1.FILE_NAME = 'fileName'; v1.CREATED_ON = 'createdOn'; v1.UPDATED_ON = 'updatedOn'; v1.FILE_VIEWS = 'fileViews'; v1.FILE_STATUS = 'fileStatus'; v1.FILE_FIELDS = [com.newgrounds.SaveQuery.FILE_ID, com.newgrounds.SaveQuery.AUTHOR_ID, com.newgrounds.SaveQuery.AUTHOR_NAME, com.newgrounds.SaveQuery.FILE_NAME, com.newgrounds.SaveQuery.CREATED_ON, com.newgrounds.SaveQuery.UPDATED_ON, com.newgrounds.SaveQuery.FILE_VIEWS, com.newgrounds.SaveQuery.FILE_STATUS]; v1.OPERATOR_EQUAL = '='; v1.OPERATOR_LESS_THAN = '<'; v1.OPERATOR_GREATER_THAN = '>'; v1.OPERATOR_NOT_EQUAL = '!='; v1.OPERATOR_LESS_OR_EQUAL = '<='; v1.OPERATOR_GREATER_OR_EQUAL = '>='; v1.OPERATOR_CONTAINS = '*'; v1.OPERATOR_NOT_CONTAINS = '!*'; v1.OPERATOR_NOT_BEGINS_WITH = '!*='; v1.OPERATOR_NOT_ENDS_WITH = '!=*'; v1.OPERATOR_BEGINS_WITH = '*='; v1.OPERATOR_ENDS_WITH = '=*'; v1.TABLE_FILES = 1; v1.TABLE_KEYS = 2; v1.TABLE_RATINGS = 3; v2._page = 1; v2._resultsPerPage = 10; v2._isRandomized = false; v2.addProperty('files', v2.__get__files, function () {}); v2.addProperty('group', v2.__get__group, function () {}); v2.addProperty('isRandomized', v2.__get__isRandomized, v2.__set__isRandomized); v2.addProperty('page', v2.__get__page, v2.__set__page); v2.addProperty('resultsPerPage', v2.__get__resultsPerPage, v2.__set__resultsPerPage); ASSetPropFlags(com.newgrounds.SaveQuery.prototype, null, 1); } #endinitclip } movieClip 45 __Packages.com.newgrounds.Medal { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.Medal) { var v1 = function (connection, id, name, description, secret, unlocked, value, difficultyId, iconURL) { super(); this._connection = connection; this._id = id; this._name = name; this._description = description; this._secret = secret; this._unlocked = unlocked; this._value = value; this._difficulty = com.newgrounds.Medal.DIFFICULTIES[difficultyId]; this._iconLoader = new com.newgrounds.BitmapLoader(com.newgrounds.Medal.DEFAULT_ICON, iconURL); this._iconLoader.load(); }; com.newgrounds.Medal = v1; com.newgrounds.Medal extends com.newgrounds.APIEventDispatcher; var v2 = v1.prototype; v2.__get__difficulty = function () { return this._difficulty; }; v2.__get__icon = function () { return this._iconLoader.__get__bitmapData(); }; v2.__get__id = function () { return this._id; }; v2.__get__name = function () { return this._name; }; v2.__get__description = function () { return this._description; }; v2.__get__secret = function () { return this._secret; }; v2.__get__unlocked = function () { return this._unlocked; }; v2.__get__value = function () { return this._value; }; v2.toString = function () { if (!this._unlocked) { return 'Medal: ' + this._name + '\t\t(' + 'locked, ' + this._value + 'pts, ' + this._difficulty + ')'; } return 'Medal: ' + this._name + '\t\t(' + 'unlocked, ' + this._value + 'pts, ' + this._difficulty + ')'; }; v2.attachIcon = function (parent) { return this._iconLoader.attachBitmap(parent); }; v2.unlock = function () { if (this._unlocked) { com.newgrounds.Logger.logWarning('Medal "' + this._name + '" is already unlocked.'); return undefined; } com.newgrounds.Logger.logMessage('Unlocking medal "' + this.__get__name() + '"...'); this._unlocked = true; if (this._connection.__get__hasUserSession()) { this._connection.sendSimpleCommand('unlockMedal', {'target': this, 'func': this.onUnlockConfirmed}, null, {'medal_id': this.__get__id()}); } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.MEDAL_UNLOCKED, this)); }; v2.setUnlocked = function (unlocked) { this._unlocked = unlocked; }; v2.onUnlockConfirmed = function (event) { if (event.__get__success()) { com.newgrounds.Logger.logMessage('Medal "' + this.__get__name() + '" unlocked.'); } else { com.newgrounds.Logger.logError('Failed to unlock "' + this.__get__name() + '"!'); } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.MEDAL_UNLOCK_CONFIRMED, this, event.__get__error())); }; v1.ICON_WIDTH = 50; v1.ICON_HEIGHT = 50; v1.DEFAULT_ICON = flash.display.BitmapData.loadBitmap('DefaultMedalIcon'); v1.DIFFICULTY_EASY = 'Easy'; v1.DIFFICULTY_MODERATE = 'Moderate'; v1.DIFFICULTY_CHALLENGING = 'Challenging'; v1.DIFFICULTY_DIFFICULT = 'Difficult'; v1.DIFFICULTY_BRUTAL = 'Brutal'; v1.DIFFICULTIES = ['Unknown', com.newgrounds.Medal.DIFFICULTY_EASY, com.newgrounds.Medal.DIFFICULTY_MODERATE, com.newgrounds.Medal.DIFFICULTY_CHALLENGING, com.newgrounds.Medal.DIFFICULTY_DIFFICULT, com.newgrounds.Medal.DIFFICULTY_BRUTAL]; v2.addProperty('description', v2.__get__description, function () {}); v2.addProperty('difficulty', v2.__get__difficulty, function () {}); v2.addProperty('icon', v2.__get__icon, function () {}); v2.addProperty('id', v2.__get__id, function () {}); v2.addProperty('name', v2.__get__name, function () {}); v2.addProperty('secret', v2.__get__secret, function () {}); v2.addProperty('unlocked', v2.__get__unlocked, function () {}); v2.addProperty('value', v2.__get__value, function () {}); ASSetPropFlags(com.newgrounds.Medal.prototype, null, 1); } #endinitclip } movieClip 47 __Packages.com.newgrounds.ScoreBoard { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.ScoreBoard) { var v1 = function (connection, name, id) { super(); this._connection = connection; this._name = name; this._id = id; }; com.newgrounds.ScoreBoard = v1; com.newgrounds.ScoreBoard extends com.newgrounds.APIEventDispatcher; var v2 = v1.prototype; v2.__get__name = function () { return this._name; }; v2.__get__scores = function () { return this._scores; }; v2.__get__period = function () { return this._period; }; v2.__set__period = function (val) { this._period = val; return this.__get__period(); }; v2.__get__firstResult = function () { return this._firstResult; }; v2.__set__firstResult = function (val) { this._firstResult = Math.max(1, val); return this.__get__firstResult(); }; v2.__get__numResults = function () { return this._numResults; }; v2.__set__numResults = function (val) { this._numResults = val; return this.__get__numResults(); }; v2.__get__tag = function () { return this._tag; }; v2.__set__tag = function (val) { this._tag = val; return this.__get__tag(); }; v2.__get__page = function () { return Math.ceil((this._firstResult - 1) / this._numResults) + 1; }; v2.prevPage = function () { if (this.__get__firstResult() > this._numResults) { this.firstResult -= this._numResults; } }; v2.nextPage = function () { this.firstResult += this._numResults; }; v2.loadScores = function () { this._connection.sendSimpleCommand('loadScores', {'target': this, 'func': this.onScoresLoaded}, {'publisher_id': this._connection.publisherId, 'board': this._id, 'page': (this._firstResult - 1) / this._numResults + 1, 'num_results': this._numResults, 'period': this._period, 'tag': this._tag}); }; v2.postScore = function (numericScore, tag) { if (tag == undefined) { tag = null; } if (isNaN(numericScore)) { com.newgrounds.Logger.logError('Cannot post invalid score: ' + numericScore); this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORE_POSTED, null, com.newgrounds.APIEvent.ERROR_INVALID_ARGUMENT)); return undefined; } com.newgrounds.Logger.logMessage('Posting a score of ' + numericScore + ' by ' + this._connection.username + ' to scoreboard "' + this._name + '"...'); this._connection.sendSimpleCommand('postScore', {'target': this, 'func': this.onScorePosted}, null, {'user_name': this._connection.username, 'board': this._id, 'value': numericScore, 'tag': tag}); }; v2.onScoresLoaded = function (event) { var v4 = event.__get__data(); this._scores = []; var v5; if (v4.first_result) { v5 = v4.first_result; } else { v5 = this._firstResult; } if (v4.scores) { var v3 = 0; while (v3 < v4.scores.length) { var v2 = v4.scores[v3]; if (v2) { this._scores[v3] = new com.newgrounds.Score(v5, v2.username, v2.value, v2.numeric_value, v2.tag); } v3++; v5++; } } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORES_LOADED, this)); }; v2.onScorePosted = function (event) { if (event.__get__success()) { com.newgrounds.Logger.logMessage('Score posted!'); var v4 = event.__get__data(); var v2 = {}; v2.score = v4.value; v2.scoreBoard = this; } else { com.newgrounds.Logger.logError('Error posting score: ' + event.__get__error()); } this.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.SCORE_POSTED, storedv2, event.__get__error())); }; v2.toString = function () { return 'Scoreboard: ' + this._name; }; v1.TODAY = 'Today'; v1.THIS_WEEK = 'This Week'; v1.THIS_MONTH = 'This Month'; v1.THIS_YEAR = 'This Year'; v1.ALL_TIME = 'All-Time'; v2._period = com.newgrounds.ScoreBoard.ALL_TIME; v2._firstResult = 1; v2._numResults = 10; v2.addProperty('firstResult', v2.__get__firstResult, v2.__set__firstResult); v2.addProperty('name', v2.__get__name, function () {}); v2.addProperty('numResults', v2.__get__numResults, v2.__set__numResults); v2.addProperty('page', v2.__get__page, function () {}); v2.addProperty('period', v2.__get__period, v2.__set__period); v2.addProperty('scores', v2.__get__scores, function () {}); v2.addProperty('tag', v2.__get__tag, v2.__set__tag); ASSetPropFlags(com.newgrounds.ScoreBoard.prototype, null, 1); } #endinitclip } movieClip 36 __Packages.com.newgrounds.Logger { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.Logger) { var v1 = function () {}; com.newgrounds.Logger = v1; var v2 = v1.prototype; v1.logInternal = function () { var v2 = arguments; com.newgrounds.Logger.log(com.newgrounds.Logger.PRIORITY_INTERNAL, v2); }; v1.logMessage = function () { var v2 = arguments; com.newgrounds.Logger.log(com.newgrounds.Logger.PRIORITY_MESSAGE, v2); }; v1.logWarning = function () { var v2 = arguments; com.newgrounds.Logger.log(com.newgrounds.Logger.PRIORITY_WARNING, v2); }; v1.logError = function () { var v2 = arguments; com.newgrounds.Logger.log(com.newgrounds.Logger.PRIORITY_ERROR, v2); }; v1.log = function (priority, messages) { if (priority == undefined) { priority = com.newgrounds.Logger.PRIORITY_MESSAGE; } if (messages == undefined) { messages = null; } if (priority >= com.newgrounds.Logger._messageLevel) { var v1 = 0; while (v1 < messages.length) { trace(com.newgrounds.Logger.HEADER + messages[v1]); com.newgrounds.Logger._eventDispatcher.dispatchEvent(new com.newgrounds.APIEvent(com.newgrounds.APIEvent.LOG, messages[v1])); ++v1; } } if (priority >= com.newgrounds.Logger._throwLevel) { throw new Error(messages.join('\n')); } }; v1.addEventListener = function (event, listener) { com.newgrounds.Logger._eventDispatcher.addEventListener(event, listener, false, 0, false); }; v1.PRIORITY_INTERNAL = 0; v1.PRIORITY_MESSAGE = 1; v1.PRIORITY_WARNING = 2; v1.PRIORITY_ERROR = 3; v1.PRIORITY_MAX = 4; v1.HEADER = '[Newgrounds API] :: '; v1._eventDispatcher = new com.newgrounds.EventDispatcher(); v1._messageLevel = com.newgrounds.Logger.PRIORITY_MESSAGE; v1._throwLevel = com.newgrounds.Logger.PRIORITY_MAX; ASSetPropFlags(com.newgrounds.Logger.prototype, null, 1); } #endinitclip } movieClip 55 __Packages.com.newgrounds.components.FlashAdBase { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.components) { _global.com.newgrounds.components = new Object(); } if (!_global.com.newgrounds.components.FlashAdBase) { var v1 = function () { super(); try { System.security.allowDomain('server.cpmstar.com'); System.security.allowInsecureDomain('server.cpmstar.com'); } this.gotoAndStop('idle'); this._x = int(this._x); this._y = int(this._y); this.stop(); if (this.__get___newgroundsButton()) { (this.__get___newgroundsButton()).onRelease = this.onNGClick; } this.onUnload = this.removeAd; var v4 = this; this._adListener = {'onLoadError': function (target, error, httpStatus) { target._parent.onAdError(target, error, httpStatus); }}; if (this.__get__fullScreen()) { this.drawFullScreenRect(); } if (com.newgrounds.API.__get__adFeedURL()) { this.loadAdFeed(); } else { com.newgrounds.API.addEventListener(com.newgrounds.APIEvent.API_CONNECTED, {'target': this, 'func': this.loadAdFeed}); } }; com.newgrounds.components.FlashAdBase = v1; com.newgrounds.components.FlashAdBase extends MovieClip; var v2 = v1.prototype; v2.__get___adContainer = function () { return this.adContainer; }; v2.__get___newgroundsButton = function () { return this.newgroundsButton; }; v2.__get__fullScreen = function () { return this._fullScreen; }; v2.__set__fullScreen = function (v) { this._fullScreen = v; if (v) { this.drawFullScreenRect(); } else { this.clear(); } return this.__get__fullScreen(); }; v2.__get__showBorder = function () { return this._showBorder; }; v2.__set__showBorder = function (value) { this._showBorder = value; if (this._showBorder) { if (this._ad) { var v2 = this._ad.getProgress(this.__get___adContainer()); if (v2.bytesLoaded >= v2.bytesTotal) { this.gotoAndStop('loaded'); } else { this.gotoAndStop('loading'); } } else { this.gotoAndStop('idle'); } } else { this.gotoAndStop('noBorder'); } return this.__get__showBorder(); }; v2.loadAdFeed = function (event) { if (event == undefined) { event = null; } this._adFeedLoader = new LoadVars(); var target = this; this._adFeedLoader.onData = function (data) { target.onAdFeedLoaded(data); }; this._adFeedLoader.load(com.newgrounds.API.__get__adFeedURL(), this._adFeedLoader); }; v2.onAdFeedLoaded = function (data) { if (data && data != '') { this.loadAd(data); } else { this.onAdError(); } }; v2.loadAd = function (adURL) { if (this.adType != this.VIDEO_ADS) { if (adURL.indexOf('?') >= 0) { adURL += '&'; } else { adURL += '?'; } adURL += 'blockoverlays=1'; } this._ad = new MovieClipLoader(); this._ad.addListener(this._adListener); (this.__get___adContainer())._lockroot = true; this._ad.loadClip(adURL, this.__get___adContainer()); }; v2.removeAd = function () { this._adFeedLoader.onData = null; this._adFeedLoader = null; this._ad.removeListener(this._adListener); if (this.__get___adContainer()) { this._ad.unloadClip(this.__get___adContainer()); } this._ad = null; }; v2.onAdError = function (target, error, httpStatus) { com.newgrounds.Logger.logError('Unable to load ad.'); this.removeAd(); }; v2.onNGClick = function () { com.newgrounds.API.loadNewgrounds(); }; v2.drawFullScreenRect = function () { this._x = (Stage.width - this._width) / 2; this._y = (Stage.height - this._height) / 2; this.beginFill(0); this.moveTo(-Stage.width, -Stage.height); this.lineTo(Stage.width, -Stage.height); this.lineTo(Stage.width, Stage.height); this.lineTo(-Stage.width, Stage.height); this.lineTo(-Stage.width, -Stage.height); this.endFill(); }; v2._showBorder = true; v2.adType = com.newgrounds.components.FlashAdBase.prototype.VIDEO_ADS; v2.VIDEO_ADS = 'Video'; v2.SIMPLE_ADS = 'Simple'; v2.addProperty('_adContainer', v2.__get___adContainer, function () {}); v2.addProperty('_newgroundsButton', v2.__get___newgroundsButton, function () {}); v2.addProperty('fullScreen', v2.__get__fullScreen, v2.__set__fullScreen); v2.addProperty('showBorder', v2.__get__showBorder, v2.__set__showBorder); ASSetPropFlags(com.newgrounds.components.FlashAdBase.prototype, null, 1); } #endinitclip } movieClip 30 __Packages.com.newgrounds.shims.APIShim { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.shims) { _global.com.newgrounds.shims = new Object(); } if (!_global.com.newgrounds.shims.APIShim) { var v1 = function () { super(); }; com.newgrounds.shims.APIShim = v1; com.newgrounds.shims.APIShim extends MovieClip; var v2 = v1.prototype; ASSetPropFlags(com.newgrounds.shims.APIShim.prototype, null, 1); } #endinitclip } movieClip 38 __Packages.com.newgrounds.encoders.json.JSON { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.encoders) { _global.com.newgrounds.encoders = new Object(); } if (!_global.com.newgrounds.encoders.json) { _global.com.newgrounds.encoders.json = new Object(); } if (!_global.com.newgrounds.encoders.json.JSON) { var v1 = function () {}; com.newgrounds.encoders.json.JSON = v1; var v2 = v1.prototype; v1.encode = function (arg, noquotes) { var v3; var v2; var v6; var v1 = ''; var v4; if (arg.isSServerVar()) { var v8 = 'sservervariable'; } else { var v8 = typeof arg; } switch (v8) { return 'null'; case 'sservervariable': return '?' + arg.getEncodedValue(); break; case 'object': if (arg) { if (arg instanceof Array) { v2 = 0; while (v2 < arg.length) { v4 = com.newgrounds.encoders.json.JSON.encode(arg[v2]); if (v1) { v1 += ','; } v1 += v4; ++v2; } return '[' + v1 + ']'; } else { if (typeof arg.toString != 'undefined') { for (v2 in arg) { v4 = arg[v2]; if (typeof v4 != 'undefined' && typeof v4 != 'function') { v4 = com.newgrounds.encoders.json.JSON.encode(v4); if (v1) { v1 += ','; } v1 += com.newgrounds.encoders.json.JSON.encode(v2) + ':' + v4; } } return '{' + v1 + '}'; } } } return 'null'; case 'number': return isFinite(arg) ? String(arg) : 'null'; case 'string': v6 = arg.length; if (noquotes) { var v7 = ''; } else { var v7 = '"'; } v1 = v7; v2 = 0; while (v2 < v6) { v3 = arg.charAt(v2); if (v3 >= ' ') { if (v3 == '\\' || v3 == '"') { v1 += '\\'; } v1 += v3; } else { switch (v3) { case '\b': v1 += '\\b'; break; case '\f': v1 += '\\f'; break; case '\n': v1 += '\\n'; break; case '\r': v1 += '\\r'; break; case '\t': v1 += '\\t'; break; default: v3 = v3.charCodeAt(); v1 += '\\u00' + (Math.floor(v3 / 16)).toString(16) + (v3 % 16).toString(16); } } v2 += 1; } return v1 + v7; case 'boolean': return String(arg); default: return 'null'; } }; v1.background_encode = function (arg, callback) { if (com.newgrounds.encoders.json.JSON.busy) { trace('[Newgrounds Encoder] :: Cannot encode a new file until the previous file is completed'); return false; } else { if (!callback) { trace('[Newgrounds Encoder] :: Missing a callback function, skipping encode'); return false; } } com.newgrounds.encoders.json.JSON.busy = true; var v2 = new Date(); com.newgrounds.encoders.json.JSON.start = v2.getTime(); com.newgrounds.encoders.json.JSON.cache = {'busy': false, 'complete': false, 'arg': arg, 'target': arg, 'parents': [], 'encoded': '', 'callback': callback, 'encode_chunk': function () { com.newgrounds.encoders.json.JSON.encode_chunk(); }}; if (com.newgrounds.encoders.json.JSON.getType(arg) == 'object') { com.newgrounds.encoders.json.JSON.cache.encoded = '{'; com.newgrounds.encoders.json.JSON.interval = setInterval(com.newgrounds.encoders.json.JSON.cache, 'encode_chunk', 25); return true; } if (com.newgrounds.encoders.json.JSON.getType(arg) == 'array') { com.newgrounds.encoders.json.JSON.cache.encoded = '['; } com.newgrounds.encoders.json.JSON.interval = setInterval(com.newgrounds.encoders.json.JSON.cache, 'encode_chunk', 25); return true; }; v1.background_decode = function (arg, callback) { if (com.newgrounds.encoders.json.JSON.busy) { trace('[Newgrounds Encoder] :: Cannot decode a new file until the previous file is completed'); return false; } else { if (!callback) { trace('[Newgrounds Encoder] :: Missing a callback function, skipping decode'); return false; } } com.newgrounds.encoders.json.JSON.busy = true; var v1 = new Date(); com.newgrounds.encoders.json.JSON.start = v1.getTime(); com.newgrounds.encoders.json.JSON.cache = {'busy': false, 'callback': callback, 'complete': false, 'arg': arg, 'pos': 0, 'parents': ['root'], 'target': null, 'scratch': '', 'decode_chunk': function () { com.newgrounds.encoders.json.JSON.decode_chunk(); }}; com.newgrounds.encoders.json.JSON.interval = setInterval(com.newgrounds.encoders.json.JSON.cache, 'decode_chunk', 25); return true; }; v1.decode = function (text) { var at = 0; var ch = ' '; var _value; var _error = function (m) { throw {'name': 'JSONError', 'message': m, 'at': at - 1, 'text': text}; }; var _next = function () { ch = text.charAt(at); at += 1; return ch; }; var _white = function () { while (ch) { if (ch <= ' ') { _next(); } else { if (ch == '/') { switch (_next()) { case '/': for (;;) { if (!(_next() && ch != '\n' && ch != '\r')) break; } break; case '*': _next(); for (;;) { if (ch) { if (ch == '*') { if (_next() == '/') { _next(); break; } } else { _next(); } continue; } _error('Unterminated comment'); } break; default: _error('Syntax error'); } } else { break; } } } }; var _string = function () { var v4; var v1 = ''; var v3; var v2; var v5 = false; if (ch == '"') { while (_next()) { if (ch == '"') { _next(); return v1; } else { if (ch == '\\') { switch (_next()) { case 'b': v1 += '\b'; break; case 'f': v1 += '\f'; break; case 'n': v1 += '\n'; break; case 'r': v1 += '\r'; break; case 't': v1 += '\t'; break; case 'u': v2 = 0; v4 = 0; while (v4 < 4) { v3 = parseInt(_next(), 16); if (!isFinite(v3)) { v5 = true; break; } v2 = v2 * 16 + v3; v4 += 1; } if (v5) { v5 = false; } else { v1 += String.fromCharCode(v2); break; default: v1 += ch; } } } else { v1 += ch; } } } } _error('Bad string'); }; var _array = function () { var v1 = []; if (ch == '[') { _next(); _white(); if (ch == ']') { _next(); return v1; } while (ch) { v1.push(_value()); _white(); if (ch == ']') { _next(); return v1; } else { if (ch != ',') { break; } } _next(); _white(); } } _error('Bad array'); }; var _object = function () { var v2; var v1 = {}; if (ch == '{') { _next(); _white(); if (ch == '}') { _next(); return v1; } while (ch) { v2 = _string(); _white(); if (ch != ':') { break; } _next(); v1[v2] = _value(); _white(); if (ch == '}') { _next(); return v1; } else { if (ch != ',') { break; } } _next(); _white(); } } _error('Bad object'); }; var _number = function () { var v1 = ''; var v2; if (ch == '-') { v1 = '-'; _next(); } for (;;) { if (!(ch >= '0' && ch <= '9')) break; v1 += ch; _next(); } if (ch == '.') { v1 += '.'; for (;;) { if (!(_next() && ch >= '0' && ch <= '9')) break; v1 += ch; } } v2 = 1 * v1; if (!isFinite(v2)) { _error('Bad number'); } else { return v2; } }; var _word = function () { switch (ch) { case 't': if (_next() == 'r' && _next() == 'u' && _next() == 'e') { _next(); return true; } break; case 'f': if (_next() == 'a' && _next() == 'l' && _next() == 's' && _next() == 'e') { _next(); return false; } break; case 'n': if (_next() == 'u' && _next() == 'l' && _next() == 'l') { _next(); return null; } } _error('Syntax error'); }; _value = function () { _white(); switch (ch) { case '{': return _object(); case '[': return _array(); case '"': return _string(); case '-': return _number(); } return (ch >= '0' && ch <= '9') ? _number() : _word(); }; return _value(); }; v1.getType = function (v) { if (v instanceof Array) { return 'array'; } else { return typeof v; } }; v1.decode_chunk = function () { if (!com.newgrounds.encoders.json.JSON.cache.busy && !com.newgrounds.encoders.json.JSON.cache.complete) { com.newgrounds.encoders.json.JSON.cache.busy = true; var v1 = 0; while (v1 < com.newgrounds.encoders.json.JSON.decode_chunks) { com.newgrounds.encoders.json.JSON.chunk_decoder(); if (com.newgrounds.encoders.json.JSON.cache.complete) { break; } ++v1; } trace(Math.round((com.newgrounds.encoders.json.JSON.cache.pos / com.newgrounds.encoders.json.JSON.cache.arg.length) * 100) + '% decoded'); com.newgrounds.encoders.json.JSON.cache.busy = false; } if (com.newgrounds.encoders.json.JSON.cache.complete) { var v2 = new Date(); com.newgrounds.encoders.json.JSON.busy = false; clearInterval(com.newgrounds.encoders.json.JSON.interval); com.newgrounds.encoders.json.JSON.cache.callback(com.newgrounds.encoders.json.JSON.cache.root, v2.getTime() - com.newgrounds.encoders.json.JSON.start); com.newgrounds.encoders.json.JSON.cache.arg = ''; } }; v1.encode_chunk = function () { if (!com.newgrounds.encoders.json.JSON.cache.busy && !com.newgrounds.encoders.json.JSON.cache.complete) { com.newgrounds.encoders.json.JSON.cache.busy = true; var v1 = 0; while (v1 < com.newgrounds.encoders.json.JSON.encode_chunks) { com.newgrounds.encoders.json.JSON.chunk_encoder(); if (com.newgrounds.encoders.json.JSON.cache.complete) { break; } ++v1; } com.newgrounds.encoders.json.JSON.cache.busy = false; } if (com.newgrounds.encoders.json.JSON.cache.complete) { var v3 = new Date(); var v2 = v3.getTime(); com.newgrounds.encoders.json.JSON.busy = false; clearInterval(com.newgrounds.encoders.json.JSON.interval); com.newgrounds.encoders.json.JSON.cache.callback(com.newgrounds.encoders.json.JSON.cache.encoded, v2 - com.newgrounds.encoders.json.JSON.start); com.newgrounds.encoders.json.JSON.cache.encoded = ''; } }; v1.chunk_decoder = function () { function _object() { var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (!com.newgrounds.encoders.json.JSON.cache.mode) { com.newgrounds.encoders.json.JSON.cache.mode = 'object'; ++com.newgrounds.encoders.json.JSON.cache.pos; v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (v1 != '"') { throw 'Malformed object key in encoded string. Keys must be wrapped in quotes ("")'; } com.newgrounds.encoders.json.JSON.cache.scratch = ''; _setTargetValue({}); } else { if (v1 == ',') { ++com.newgrounds.encoders.json.JSON.cache.pos; v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (v1 != '"') { throw 'Malformed object key in encoded string. Keys must be wrapped in quotes ("")'; } com.newgrounds.encoders.json.JSON.cache.scratch = ''; } else { if (v1 == '}') { _useParent(); } else { if (v1 == '"') { ++com.newgrounds.encoders.json.JSON.cache.pos; v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (v1 != ':') { throw 'Malformed object notation. Object keys and values must be separated by colons(:)'; } _addParent(com.newgrounds.encoders.json.JSON.cache.scratch); com.newgrounds.encoders.json.JSON.cache.mode = null; } else { if (v1 == '\\') { ++com.newgrounds.encoders.json.JSON.cache.pos; v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); } com.newgrounds.encoders.json.JSON.cache.scratch += v1; } } } } ++com.newgrounds.encoders.json.JSON.cache.pos; } function _array() { var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (!com.newgrounds.encoders.json.JSON.cache.mode) { com.newgrounds.encoders.json.JSON.cache.mode = 'array'; ++com.newgrounds.encoders.json.JSON.cache.pos; v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); _setTargetValue([]); if (v1 != ']') { _addArrayKey(); } else { _useParent(); } return undefined; } else { if (v1 == ',') { _addArrayKey(); } else { if (v1 == ']') { _useParent(); } } } ++com.newgrounds.encoders.json.JSON.cache.pos; } function _boolean() { var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (v1 == 't') { _setTargetValue(true); com.newgrounds.encoders.json.JSON.cache.pos += 3; } else { if (v1 == 'f') { _setTargetValue(false); com.newgrounds.encoders.json.JSON.cache.pos += 4; } else { throw 'Bool values must be true or false'; } } _useParent(); } function _null() { var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (v1 == 'n') { _setTargetValue(null); com.newgrounds.encoders.json.JSON.cache.pos += 2; } else { throw 'Null values must be null'; } _useParent(); } function _string() { var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); if (!com.newgrounds.encoders.json.JSON.cache.mode) { if (v1 != '"') { throw 'Strings must be wrapped in quotes ("")'; } com.newgrounds.encoders.json.JSON.cache.scratch = ''; com.newgrounds.encoders.json.JSON.cache.mode = 'string'; } else { if (v1 == '"') { _setTargetValue(com.newgrounds.encoders.json.JSON.cache.scratch); _useParent(); } else { if (v1 == '\\') { ++com.newgrounds.encoders.json.JSON.cache.pos; v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); switch (v1) { case 'n': v1 = '\n'; break; case 'r': v1 = '\n'; break; case 't': v1 = '\t'; break; case 'u': v1 = '\\' + v1; } } com.newgrounds.encoders.json.JSON.cache.scratch += v1; } } ++com.newgrounds.encoders.json.JSON.cache.pos; } function _number() { var v1 = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); var v2 = '01234567890.-'; if (!com.newgrounds.encoders.json.JSON.cache.mode) { com.newgrounds.encoders.json.JSON.cache.mode = 'number'; com.newgrounds.encoders.json.JSON.cache.scratch = ''; } if (v2.indexOf(v1) < 0) { _setTargetValue(Number(com.newgrounds.encoders.json.JSON.cache.scratch)); _useParent(); } else { com.newgrounds.encoders.json.JSON.cache.scratch += v1; ++com.newgrounds.encoders.json.JSON.cache.pos; } } function _setTargetValue(newval) { var v2 = (_getParent()).obj; var v1 = com.newgrounds.encoders.json.JSON.cache.parents[com.newgrounds.encoders.json.JSON.cache.parents.length - 1]; v2[v1] = newval; } function _useParent() { com.newgrounds.encoders.json.JSON.cache.mode = com.newgrounds.encoders.json.JSON.getType((_getParent()).obj); com.newgrounds.encoders.json.JSON.cache.parents.pop(); } function _getParent() { var v2 = com.newgrounds.encoders.json.JSON.cache; var v1 = 0; while (v1 < com.newgrounds.encoders.json.JSON.cache.parents.length - 1) { v2 = v2[com.newgrounds.encoders.json.JSON.cache.parents[v1]]; ++v1; } return {'obj': v2, 'name': com.newgrounds.encoders.json.JSON.cache.parents[v1]}; } function _getCurrent() { var v2 = com.newgrounds.encoders.json.JSON.cache; var v1 = 0; while (v1 < com.newgrounds.encoders.json.JSON.cache.parents.length) { v2 = v2[com.newgrounds.encoders.json.JSON.cache.parents[v1]]; ++v1; } return {'obj': v2, 'name': com.newgrounds.encoders.json.JSON.cache.parents[v1]}; } function _addParent(child) { com.newgrounds.encoders.json.JSON.cache.parents.push(child); } function _addArrayKey() { var v1 = (_getCurrent()).obj.length; com.newgrounds.encoders.json.JSON.cache.parents.push(v1); com.newgrounds.encoders.json.JSON.cache.mode = null; } if (com.newgrounds.encoders.json.JSON.cache.pos >= com.newgrounds.encoders.json.JSON.cache.arg.length) { com.newgrounds.encoders.json.JSON.cache.complete = true; return undefined; } else { if (com.newgrounds.encoders.json.JSON.cache.mode) { ('_' + com.newgrounds.encoders.json.JSON.cache.mode)(); } else { var char = com.newgrounds.encoders.json.JSON.cache.arg.charAt(com.newgrounds.encoders.json.JSON.cache.pos); switch (char) { case '{': _object(); break; case '[': _array(); break; case '"': _string(); break; case 'n': _null(); break; case 't': _boolean(); break; case 'f': _boolean(); break; default: _number(); } } } }; v1.chunk_encoder = function () { if (com.newgrounds.encoders.json.JSON.cache.complete) { return undefined; } var v2 = com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target); switch (v2) { case 'number': com.newgrounds.encoders.json.JSON.cache.encoded += com.newgrounds.encoders.json.JSON.cache.target; com.newgrounds.encoders.json.JSON.getParent(); break; case 'string': com.newgrounds.encoders.json.JSON.cache.encoded += '"' + (com.newgrounds.encoders.json.JSON.cache.target.split('"')).join('\\"') + '"'; com.newgrounds.encoders.json.JSON.getParent(); break; case 'boolean': com.newgrounds.encoders.json.JSON.cache.encoded += (com.newgrounds.encoders.json.JSON.cache.target == true) ? 'true' : 'false'; com.newgrounds.encoders.json.JSON.getParent(); break; case 'null': com.newgrounds.encoders.json.JSON.cache.encoded += 'null'; com.newgrounds.encoders.json.JSON.getParent(); break; case 'array': if (com.newgrounds.encoders.json.JSON.cache.target.length < 1) { com.newgrounds.encoders.json.JSON.cache.encoded += ']'; com.newgrounds.encoders.json.JSON.getParent(); } else { com.newgrounds.encoders.json.JSON.cache.parents.push(com.newgrounds.encoders.json.JSON.cache.target); com.newgrounds.encoders.json.JSON.cache.target = com.newgrounds.encoders.json.JSON.cache.target[0]; if (com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target) == 'array') { com.newgrounds.encoders.json.JSON.cache.encoded += '['; } else { if (com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target) == 'object') { com.newgrounds.encoders.json.JSON.cache.encoded += '{'; } } } break; case 'object': for (var v1 in com.newgrounds.encoders.json.JSON.cache.target) { break; } if (v1 === undefined) { com.newgrounds.encoders.json.JSON.cache.encoded += '}'; com.newgrounds.encoders.json.JSON.getParent(); } else { com.newgrounds.encoders.json.JSON.cache.parents.push(com.newgrounds.encoders.json.JSON.cache.target); com.newgrounds.encoders.json.JSON.cache.target = com.newgrounds.encoders.json.JSON.cache.target[v1]; com.newgrounds.encoders.json.JSON.cache.encoded += '"' + (v1.split('"')).join('\\"') + '":'; if (com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target) == 'array') { com.newgrounds.encoders.json.JSON.cache.encoded += '['; } else { if (com.newgrounds.encoders.json.JSON.getType(com.newgrounds.encoders.json.JSON.cache.target) == 'object') { com.newgrounds.encoders.json.JSON.cache.encoded += '{'; } } } break; default: com.newgrounds.encoders.json.JSON.cache.encoded += 'null'; com.newgrounds.encoders.json.JSON.getParent(); } }; v1.getParent = function () { if (com.newgrounds.encoders.json.JSON.cache.parents.length > 0) { var v1 = com.newgrounds.encoders.json.JSON.cache.parents.pop(); if (com.newgrounds.encoders.json.JSON.getType(v1) == 'array') { v1.shift(); } else { for (var v3 in v1) { delete v1[v3]; break; } } if (com.newgrounds.encoders.json.JSON.getType(v1) == 'object' or com.newgrounds.encoders.json.JSON.getType(v1) == 'array') { for (var v2 in v1) { break; } if (v2 !== undefined) { com.newgrounds.encoders.json.JSON.cache.encoded += ','; } } com.newgrounds.encoders.json.JSON.cache.target = v1; } else { com.newgrounds.encoders.json.JSON.cache.complete = true; } }; v1.encode_chunks = 20000; v1.decode_chunks = 20000; v1.busy = false; ASSetPropFlags(com.newgrounds.encoders.json.JSON.prototype, null, 1); } #endinitclip } movieClip 41 __Packages.com.newgrounds.crypto.MD5 { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.crypto) { _global.com.newgrounds.crypto = new Object(); } if (!_global.com.newgrounds.crypto.MD5) { var v1 = function () {}; com.newgrounds.crypto.MD5 = v1; var v2 = v1.prototype; v1.hash = function (src) { return com.newgrounds.crypto.MD5.hex_md5(src); }; v1.hex_md5 = function (src) { return com.newgrounds.crypto.MD5.binl2hex(com.newgrounds.crypto.MD5.core_md5(com.newgrounds.crypto.MD5.str2binl(src), src.length * 8)); }; v1.core_md5 = function (x, len) { x[len >> 5] |= 128 << len % 32; x[(len + 64 >>> 9 << 4) + 14] = len; var v4 = 1732584193; var v3 = -271733879; var v2 = -1732584194; var v1 = 271733878; var v5 = 0; while (v5 < x.length) { var v10 = v4; var v9 = v3; var v8 = v2; var v7 = v1; v4 = com.newgrounds.crypto.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 0], 7, -680876936); v1 = com.newgrounds.crypto.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 1], 12, -389564586); v2 = com.newgrounds.crypto.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 2], 17, 606105819); v3 = com.newgrounds.crypto.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 3], 22, -1044525330); v4 = com.newgrounds.crypto.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 4], 7, -176418897); v1 = com.newgrounds.crypto.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 5], 12, 1200080426); v2 = com.newgrounds.crypto.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 6], 17, -1473231341); v3 = com.newgrounds.crypto.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 7], 22, -45705983); v4 = com.newgrounds.crypto.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 8], 7, 1770035416); v1 = com.newgrounds.crypto.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 9], 12, -1958414417); v2 = com.newgrounds.crypto.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 10], 17, -42063); v3 = com.newgrounds.crypto.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 11], 22, -1990404162); v4 = com.newgrounds.crypto.MD5.md5_ff(v4, v3, v2, v1, x[v5 + 12], 7, 1804603682); v1 = com.newgrounds.crypto.MD5.md5_ff(v1, v4, v3, v2, x[v5 + 13], 12, -40341101); v2 = com.newgrounds.crypto.MD5.md5_ff(v2, v1, v4, v3, x[v5 + 14], 17, -1502002290); v3 = com.newgrounds.crypto.MD5.md5_ff(v3, v2, v1, v4, x[v5 + 15], 22, 1236535329); v4 = com.newgrounds.crypto.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 1], 5, -165796510); v1 = com.newgrounds.crypto.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 6], 9, -1069501632); v2 = com.newgrounds.crypto.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 11], 14, 643717713); v3 = com.newgrounds.crypto.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 0], 20, -373897302); v4 = com.newgrounds.crypto.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 5], 5, -701558691); v1 = com.newgrounds.crypto.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 10], 9, 38016083); v2 = com.newgrounds.crypto.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 15], 14, -660478335); v3 = com.newgrounds.crypto.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 4], 20, -405537848); v4 = com.newgrounds.crypto.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 9], 5, 568446438); v1 = com.newgrounds.crypto.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 14], 9, -1019803690); v2 = com.newgrounds.crypto.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 3], 14, -187363961); v3 = com.newgrounds.crypto.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 8], 20, 1163531501); v4 = com.newgrounds.crypto.MD5.md5_gg(v4, v3, v2, v1, x[v5 + 13], 5, -1444681467); v1 = com.newgrounds.crypto.MD5.md5_gg(v1, v4, v3, v2, x[v5 + 2], 9, -51403784); v2 = com.newgrounds.crypto.MD5.md5_gg(v2, v1, v4, v3, x[v5 + 7], 14, 1735328473); v3 = com.newgrounds.crypto.MD5.md5_gg(v3, v2, v1, v4, x[v5 + 12], 20, -1926607734); v4 = com.newgrounds.crypto.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 5], 4, -378558); v1 = com.newgrounds.crypto.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 8], 11, -2022574463); v2 = com.newgrounds.crypto.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 11], 16, 1839030562); v3 = com.newgrounds.crypto.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 14], 23, -35309556); v4 = com.newgrounds.crypto.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 1], 4, -1530992060); v1 = com.newgrounds.crypto.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 4], 11, 1272893353); v2 = com.newgrounds.crypto.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 7], 16, -155497632); v3 = com.newgrounds.crypto.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 10], 23, -1094730640); v4 = com.newgrounds.crypto.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 13], 4, 681279174); v1 = com.newgrounds.crypto.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 0], 11, -358537222); v2 = com.newgrounds.crypto.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 3], 16, -722521979); v3 = com.newgrounds.crypto.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 6], 23, 76029189); v4 = com.newgrounds.crypto.MD5.md5_hh(v4, v3, v2, v1, x[v5 + 9], 4, -640364487); v1 = com.newgrounds.crypto.MD5.md5_hh(v1, v4, v3, v2, x[v5 + 12], 11, -421815835); v2 = com.newgrounds.crypto.MD5.md5_hh(v2, v1, v4, v3, x[v5 + 15], 16, 530742520); v3 = com.newgrounds.crypto.MD5.md5_hh(v3, v2, v1, v4, x[v5 + 2], 23, -995338651); v4 = com.newgrounds.crypto.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 0], 6, -198630844); v1 = com.newgrounds.crypto.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 7], 10, 1126891415); v2 = com.newgrounds.crypto.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 14], 15, -1416354905); v3 = com.newgrounds.crypto.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 5], 21, -57434055); v4 = com.newgrounds.crypto.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 12], 6, 1700485571); v1 = com.newgrounds.crypto.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 3], 10, -1894986606); v2 = com.newgrounds.crypto.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 10], 15, -1051523); v3 = com.newgrounds.crypto.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 1], 21, -2054922799); v4 = com.newgrounds.crypto.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 8], 6, 1873313359); v1 = com.newgrounds.crypto.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 15], 10, -30611744); v2 = com.newgrounds.crypto.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 6], 15, -1560198380); v3 = com.newgrounds.crypto.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 13], 21, 1309151649); v4 = com.newgrounds.crypto.MD5.md5_ii(v4, v3, v2, v1, x[v5 + 4], 6, -145523070); v1 = com.newgrounds.crypto.MD5.md5_ii(v1, v4, v3, v2, x[v5 + 11], 10, -1120210379); v2 = com.newgrounds.crypto.MD5.md5_ii(v2, v1, v4, v3, x[v5 + 2], 15, 718787259); v3 = com.newgrounds.crypto.MD5.md5_ii(v3, v2, v1, v4, x[v5 + 9], 21, -343485551); v4 = com.newgrounds.crypto.MD5.safe_add(v4, v10); v3 = com.newgrounds.crypto.MD5.safe_add(v3, v9); v2 = com.newgrounds.crypto.MD5.safe_add(v2, v8); v1 = com.newgrounds.crypto.MD5.safe_add(v1, v7); v5 += 16; } return new Array(v4, v3, v2, v1); }; v1.md5_cmn = function (q, a, b, x, s, t) { return com.newgrounds.crypto.MD5.safe_add(com.newgrounds.crypto.MD5.bit_rol(com.newgrounds.crypto.MD5.safe_add(com.newgrounds.crypto.MD5.safe_add(a, q), com.newgrounds.crypto.MD5.safe_add(x, t)), s), b); }; v1.md5_ff = function (a, b, c, d, x, s, t) { return com.newgrounds.crypto.MD5.md5_cmn(b & c | ~b & d, a, b, x, s, t); }; v1.md5_gg = function (a, b, c, d, x, s, t) { return com.newgrounds.crypto.MD5.md5_cmn(b & d | c & ~d, a, b, x, s, t); }; v1.md5_hh = function (a, b, c, d, x, s, t) { return com.newgrounds.crypto.MD5.md5_cmn(b ^ c ^ d, a, b, x, s, t); }; v1.md5_ii = function (a, b, c, d, x, s, t) { return com.newgrounds.crypto.MD5.md5_cmn(c ^ (b | ~d), a, b, x, s, t); }; v1.bit_rol = function (num, cnt) { return num << cnt | num >>> 32 - cnt; }; v1.safe_add = function (x, y) { var v1 = (x & 65535) + (y & 65535); var v2 = (x >> 16) + (y >> 16) + (v1 >> 16); return v2 << 16 | v1 & 65535; }; v1.str2binl = function (str) { var v3 = new Array(); var v4 = 255; var v1 = 0; while (v1 < str.length * 8) { v3[v1 >> 5] |= (str.charCodeAt(v1 / 8) & v4) << v1 % 32; v1 += 8; } return v3; }; v1.binl2hex = function (binarray) { var v4 = new String(''); var v3 = new String('0123456789abcdef'); var v1 = 0; while (v1 < binarray.length * 4) { v4 += v3.charAt(binarray[v1 >> 2] >> (v1 % 4) * 8 + 4 & 15) + v3.charAt(binarray[v1 >> 2] >> (v1 % 4) * 8 & 15); ++v1; } return v4; }; ASSetPropFlags(com.newgrounds.crypto.MD5.prototype, null, 1); } #endinitclip } movieClip 42 __Packages.com.newgrounds.crypto.RC4 { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.crypto) { _global.com.newgrounds.crypto = new Object(); } if (!_global.com.newgrounds.crypto.RC4) { var v1 = function () {}; com.newgrounds.crypto.RC4 = v1; var v2 = v1.prototype; v1.encrypt = function (src, key) { var v3 = com.newgrounds.crypto.RC4.strToChars(src); var v1 = com.newgrounds.crypto.RC4.strToChars(key); var v2 = com.newgrounds.crypto.RC4.calculate(v3, v1); return com.newgrounds.crypto.RC4.charsToHex(v2); }; v1.encryptbin = function (src, key) { var v3 = com.newgrounds.crypto.RC4.strToChars(src); var v1 = com.newgrounds.crypto.RC4.strToChars(key); var v2 = com.newgrounds.crypto.RC4.calculate(v3, v1); return v2; }; v1.decrypt = function (src, key) { var v3 = com.newgrounds.crypto.RC4.hexToChars(src); var v1 = com.newgrounds.crypto.RC4.strToChars(key); var v2 = com.newgrounds.crypto.RC4.calculate(v3, v1); return com.newgrounds.crypto.RC4.charsToStr(v2); }; v1.initialize = function (pwd) { var v2 = 0; var v3; var v4 = pwd.length; var v1 = 0; while (v1 <= 255) { com.newgrounds.crypto.RC4.mykey[v1] = pwd[v1 % v4]; com.newgrounds.crypto.RC4.sbox[v1] = v1; ++v1; } v1 = 0; while (v1 <= 255) { v2 = (v2 + com.newgrounds.crypto.RC4.sbox[v1] + com.newgrounds.crypto.RC4.mykey[v1]) % 256; v3 = com.newgrounds.crypto.RC4.sbox[v1]; com.newgrounds.crypto.RC4.sbox[v1] = com.newgrounds.crypto.RC4.sbox[v2]; com.newgrounds.crypto.RC4.sbox[v2] = v3; ++v1; } }; v1.calculate = function (plaintxt, psw) { com.newgrounds.crypto.RC4.initialize(psw); var v1 = 0; var v2 = 0; var v9 = new Array(); var v7; var v5; var v6; var v3 = 0; while (v3 < plaintxt.length) { v1 = (v1 + 1) % 256; v2 = (v2 + com.newgrounds.crypto.RC4.sbox[v1]) % 256; v5 = com.newgrounds.crypto.RC4.sbox[v1]; com.newgrounds.crypto.RC4.sbox[v1] = com.newgrounds.crypto.RC4.sbox[v2]; com.newgrounds.crypto.RC4.sbox[v2] = v5; var v4 = (com.newgrounds.crypto.RC4.sbox[v1] + com.newgrounds.crypto.RC4.sbox[v2]) % 256; v7 = com.newgrounds.crypto.RC4.sbox[v4]; v6 = plaintxt[v3] ^ v7; v9.push(v6); ++v3; } return v9; }; v1.charsToHex = function (chars) { var v4 = new String(''); var v3 = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'); var v1 = 0; while (v1 < chars.length) { v4 += v3[chars[v1] >> 4] + v3[chars[v1] & 15]; ++v1; } return v4; }; v1.hexToChars = function (hex) { var v3 = new Array(); var v1 = (hex.substr(0, 2) == '0x') ? 2 : 0; while (v1 < hex.length) { v3.push(parseInt(hex.substr(v1, 2), 16)); v1 += 2; } return v3; }; v1.charsToStr = function (chars) { var v3 = new String(''); var v1 = 0; while (v1 < chars.length) { v3 += String.fromCharCode(chars[v1]); ++v1; } return v3; }; v1.strToChars = function (str) { var v3 = new Array(); var v1 = 0; while (v1 < str.length) { v3.push(str.charCodeAt(v1)); ++v1; } return v3; }; v1.sbox = new Array(255); v1.mykey = new Array(255); ASSetPropFlags(com.newgrounds.crypto.RC4.prototype, null, 1); } #endinitclip } movieClip 46 __Packages.com.newgrounds.Score { #initclip if (!_global.com) { _global.com = new Object(); } if (!_global.com.newgrounds) { _global.com.newgrounds = new Object(); } if (!_global.com.newgrounds.Score) { var v1 = function (rank, username, score, numericValue, tag) { this._rank = rank; this._username = username; this._score = score; this._numericValue = numericValue; this._tag = tag; }; com.newgrounds.Score = v1; var v2 = v1.prototype; v2.__get__numericValue = function () { return this._numericValue; }; v2.__get__rank = function () { return this._rank; }; v2.__get__score = function () { return this._score; }; v2.__get__tag = function () { return this._tag; }; v2.__get__username = function () { return this._username; }; v2.toString = function () { return this._rank + '.\t' + this._username + '\t' + this._score; }; v2.addProperty('numericValue', v2.__get__numericValue, function () {}); v2.addProperty('rank', v2.__get__rank, function () {}); v2.addProperty('score', v2.__get__score, function () {}); v2.addProperty('tag', v2.__get__tag, function () {}); v2.addProperty('username', v2.__get__username, function () {}); ASSetPropFlags(com.newgrounds.Score.prototype, null, 1); } #endinitclip } movieClip 98 { } frame 3 { onEnterFrame = undefined; stop(); } movieClip 100 { } movieClip 102 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } instance of movieClip 102 { onClipEvent (release) { hover = true; getURL('https://www.facebook.com/DeadtoastCom', '_blank'); com.newgrounds.API.logCustomEvent('Preloader_Facebook'); } onClipEvent (press) { buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; } } movieClip 105 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } instance of movieClip 105 { onClipEvent (release) { hover = true; getURL('http://www.deadtoast.com', '_blank'); com.newgrounds.API.logCustomEvent('Preloader_com_Weblink'); } onClipEvent (press) { buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; } } movieClip 107 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } instance of movieClip 107 { onClipEvent (release) { hover = true; getURL('https://twitter.com/deadtoast_com', '_blank'); com.newgrounds.API.logCustomEvent('Preloader_Twitter'); } onClipEvent (press) { buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; } } movieClip 113 { } movieClip 118 { frame 1 { _alpha = 0; } } movieClip 120 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 121 { frame 1 { stop(); } instance of movieClip 113 { onClipEvent (load) { if (!_root.disableAds()) { extraWaitTimer = 0; } else { extraWaitTimer = 90; } _xscale = 0; } onClipEvent (enterFrame) { ++extraWaitTimer; if (extraWaitTimer > 150) { extraWaitTimer = 150; } _xscale = (extraWaitTimer / 150) * 25 + (_root.getBytesLoaded() / _root.getBytesTotal()) * 75; if (_root.getBytesLoaded() == _root.getBytesTotal() && extraWaitTimer >= 150) { if (_root.disableAds()) { _root.gotoAndPlay(5); } _parent._alpha -= 5; if (_parent._alpha <= -20) { _parent.onEnterFrame = function () { this._alpha += 5; if (this._alpha >= 100) { this._alpha = 100; this.onEnterFrame = undefined; } }; _parent.gotoAndStop(2); } } } } instance of movieClip 120 { onClipEvent (release) { hover = true; _root.gotoAndPlay(5); } onClipEvent (press) { buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } } movieClip 123 { frame 1 { stop(); _visible = false; } instance of movieClip 87 APIConnector { onClipEvent (construct) { apiId = '36067:bYo4LG8a'; encryptionKey = 'mpcm7xEcgtrFmvOJrlLLUTBtpuie6hvT'; debugMode = 'Off'; movieVersion = '1'; connectorType = 'Flash Ad Only'; redirectOnNewVersion = false; redirectOnHostBlocked = false; adType = 'Video'; } } instance of movieClip 87 APIConnector { onClipEvent (construct) { apiId = '36067:bYo4LG8a'; encryptionKey = 'mpcm7xEcgtrFmvOJrlLLUTBtpuie6hvT'; debugMode = 'Off'; movieVersion = '1'; connectorType = 'Invisible'; redirectOnNewVersion = false; redirectOnHostBlocked = false; adType = 'Video'; } } } movieClip 125 attackHitBox { frame 1 { _visible = false; } frame 2 { stop(); } } movieClip 127 shadow { } movieClip 132 blueberry_splat { frame 1 { this.gotoAndStop(1 + random(4)); } } movieClip 135 breakBlockBit { } movieClip 141 { } movieClip 144 { } movieClip 145 butterfly { frame 1 { wing1.xScaleSpeed2 = 2; wing1.xScaleSpeed = 2; wing2._xscale = 40 + random(60); wing1._xscale = wing2._xscale; xSpeed2 = -3; xSpeed = -3; ySpeed = -2 - random(3); _yscale = 30 + random(20); _xscale = 30 + random(20); extraXSpeed = -4 + random(9); explodeXSpeed = -6 + random(12); explodeYSpeed = -4 - random(10); ranNr = 1 + random(5); wing1.gotoAndStop(ranNr); wing2.gotoAndStop(ranNr); onEnterFrame = function () { if (!_root.gamePause) { if (!_root.onScreen.hitTest(this)) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } if (wing1._xscale > 60) { wing1.xScaleSpeed = -60; } else { if (wing1._xscale < 40) { wing1.xScaleSpeed = 60; } } wing1.xScaleSpeed2 += (wing1.xScaleSpeed - wing1.xScaleSpeed2) * 0.1; wing1._xscale += wing1.xScaleSpeed2; wing1._rotation = -wing1.xScaleSpeed2 / 2; wing2._xscale = wing1._xscale; wing2._rotation = 180 - wing1._rotation; if (xSpeed2 > 2) { xSpeed = -3; } else { if (xSpeed2 < -2) { xSpeed = 3; } } xSpeed2 += (xSpeed - xSpeed2) * 0.05; explodeXSpeed *= 0.9; explodeYSpeed *= 0.9; _x = _x + (xSpeed2 + extraXSpeed + explodeXSpeed); _y = _y + (ySpeed + explodeYSpeed); _rotation = (xSpeed2 + extraXSpeed * 3) * 2; } }; } instance of movieClip 144 { onClipEvent (load) { _alpha = 80; } onClipEvent (enterFrame) { if (!_root.gamePause) { _yscale = _yscale * 0.8; _xscale = _yscale * 0.8; _alpha = _alpha * 0.8; if (_xscale <= 5) { this.swapDepths(_parent.getNextHighestDepth()); this.removeMovieClip(); } } } } } movieClip 147 camFocus { frame 1 { _visible = false; _name = 'cameraFocusZone' + _root.nrOfCameraFocusZones; ++_root.nrOfCameraFocusZones; beenEntered = false; if (focusPower != undefined) { focusPowerY = focusPower; focusPowerX = focusPowerY; } if (signalName == undefined) { active = true; } else { active = _root[signalName]; } if (!fromCombatZone && active && this.hitTest(_root.heroHitboxP1) || !fromCombatZone && active && this.hitTest(_root.heroHitboxP2)) { _root.cameraFocusX = this._x + focusOffsetX; _root.cameraFocusY = this._y + focusOffsetY; _root.cameraFocusPowerX = focusPowerX; _root.cameraFocusPowerY = focusPowerY; _root.cameraOvershootX = 0; _root.cameraOvershootY = 0; _root.gameCamera._x = _x + focusOffsetX; _root.gameCamera._y = _y + focusOffsetY; } onEnterFrame = function () { if (_root.cutscene) { if (!_root.gamePause) { if (!_root.combatZoneActive || this.fromCombatZone) { if (signalName != undefined) { active = _root[signalName]; } touchingP1 = this.hitTest(_root.heroHitboxP1); touchingP2 = this.hitTest(_root.heroHitboxP2); if (active && touchingP1 || active && touchingP2) { if (!beenEntered) { _root.cameraFocusX = this._x + focusOffsetX; _root.cameraFocusY = this._y + focusOffsetY; _root.cameraFocusPowerX = focusPowerX; _root.cameraFocusPowerY = focusPowerY; beenEntered = true; } } else { if (beenEntered) { inCameraZone = false; i = 0; while (i < _root.nrOfCameraFocusZones) { if (_root['cameraFocusZone' + i].active && _root['cameraFocusZone' + i].hitTest(_root.heroHitboxP1) || _root['cameraFocusZone' + i].active && _root['cameraFocusZone' + i].hitTest(_root.heroHitboxP2)) { i = _root.nrOfCameraFocusZones; inCameraZone = true; } ++i; } if (!inCameraZone) { _root.cameraFocusY = undefined; _root.cameraFocusX = _root.cameraFocusY; } beenEntered = false; } } } } } else { if (_root.nrOfPlayers == 2) { if (!_root.gamePause) { if (!_root.combatZoneActive || this.fromCombatZone) { if (signalName != undefined) { active = _root[signalName]; } touchingP1 = this.hitTest(_root.heroHitboxP1); touchingP2 = this.hitTest(_root.heroHitboxP2); if (active && touchingP1 && touchingP2 || active && touchingP1 && !_root.hero2Alive || active && touchingP2 && !_root.hero1Alive) { if (!beenEntered) { _root.cameraFocusX = this._x + focusOffsetX; _root.cameraFocusY = this._y + focusOffsetY; _root.cameraFocusPowerX = focusPowerX; _root.cameraFocusPowerY = focusPowerY; beenEntered = true; } } else { if (beenEntered) { inCameraZone = false; i = 0; while (i < _root.nrOfCameraFocusZones) { if (_root['cameraFocusZone' + i].active && _root['cameraFocusZone' + i].hitTest(_root.heroHitboxP1) && _root['cameraFocusZone' + i].hitTest(_root.heroHitboxP2)) { i = _root.nrOfCameraFocusZones; inCameraZone = true; } ++i; } if (!inCameraZone) { _root.cameraFocusY = undefined; _root.cameraFocusX = _root.cameraFocusY; } beenEntered = false; } } } } } else { if (!_root.gamePause) { if (!_root.combatZoneActive || this.fromCombatZone) { if (signalName != undefined) { active = _root[signalName]; } if (active && this.hitTest(_root.heroHitboxP1)) { if (!beenEntered) { _root.cameraFocusX = this._x + focusOffsetX; _root.cameraFocusY = this._y + focusOffsetY; _root.cameraFocusPowerX = focusPowerX; _root.cameraFocusPowerY = focusPowerY; beenEntered = true; } } else { if (beenEntered) { inCameraZone = false; i = 0; while (i < _root.nrOfCameraFocusZones) { if (_root['cameraFocusZone' + i].active && _root['cameraFocusZone' + i].hitTest(_root.heroHitboxP1)) { i = _root.nrOfCameraFocusZones; inCameraZone = true; } ++i; } if (!inCameraZone) { _root.cameraFocusY = undefined; _root.cameraFocusX = _root.cameraFocusY; } beenEntered = false; } } } } } } }; } } movieClip 149 camZoom { frame 1 { _visible = false; _name = 'cameraZone' + _root.nrOfCameraZones; ++_root.nrOfCameraZones; beenEntered = false; if (_root.nrOfPlayers == 2) { onEnterFrame = function () { if (!_root.gamePause) { if (this.hitTest(_root.heroHitboxP1) || this.hitTest(_root.heroHitboxP2)) { if (!beenEntered) { _root.cameraZoom = zoom; beenEntered = true; } } else { if (beenEntered) { inCameraZone = false; i = 0; while (i < _root.nrOfCameraZones) { if (_root['cameraZone' + i].hitTest(_root.heroHitboxP1) || _root['cameraZone' + i].hitTest(_root.heroHitboxP2)) { i = _root.nrOfCameraZones; inCameraZone = true; } ++i; } if (!inCameraZone) { _root.cameraZoom = 0; } beenEntered = false; } } } }; } else { onEnterFrame = function () { if (!_root.gamePause) { if (this.hitTest(_root.heroHitboxP1)) { if (!beenEntered) { _root.cameraZoom = zoom; beenEntered = true; } } else { if (beenEntered) { inCameraZone = false; i = 0; while (i < _root.nrOfCameraZones) { if (_root['cameraZone' + i].hitTest(_root.heroHitboxP1)) { i = _root.nrOfCameraZones; inCameraZone = true; } ++i; } if (!inCameraZone) { _root.cameraZoom = 0; } beenEntered = false; } } } }; } } } movieClip 153 chapterTitleScreen { frame 1 { timer = 0; onEnterFrame = function () { if (noSpawnBeam != true) { _root.heroP1._visible = false; _root.heroP2._visible = false; _root.heroSwordP1._visible = false; _root.heroSwordP2._visible = false; _root.heroShadowP1._visible = false; _root.heroShadowP2._visible = false; _root.heroP1._x = _root.startPoint._x + _root.startPoint._width / 2; _root.heroP1._y = _root.startPoint._y + _root.startPoint._height / 2; _root.heroP2._x = _root.startPoint._x - _root.startPoint._width / 2; _root.heroP2._y = _root.startPoint._y - _root.startPoint._height / 2; } ++timer; if (timer > 120) { _alpha = _alpha - 3; if (_alpha <= 0) { if (noSpawnBeam != true) { spawnBeamName = 'SB' + _root.getNextHighestDepth(); _root.attachMovie('spawnBeam', spawnBeamName, _root.getNextHighestDepth()); _root[spawnBeamName]._x = _root.startPoint._x; _root[spawnBeamName]._y = _root.startPoint._y + _root.startPoint._height / 2 + 5; _root.playSound('checkpoint_respawn'); _root.depthSort(_root[spawnBeamName]); _root.heroP1._visible = true; _root.heroP2._visible = true; _root.heroSwordP1._visible = true; _root.heroSwordP2._visible = true; _root.heroShadowP1._visible = true; _root.heroShadowP2._visible = true; } if (achievementNr != undefined) { _root.unlockAchievement(achievementNr); } this.swapDepths(_parent.getNextHighestDepth()); this.removeMovieClip(); } } }; } } movieClip 155 hitbox { frame 1 { _visible = false; } } movieClip 158 { frame 1 { stop(); } } movieClip 159 checkpoint { frame 1 { this._name = 'cp' + _root.nrOfCheckPoints; ++_root.nrOfCheckPoints; } } movieClip 162 chopIndicator { frame 1 { stop(); ySpeed = -1.5; startY = _y; _yscale = 0; _xscale = 0; _visible = false; _root.introBackground.cucumber.chopShadow._visible = false; _root.introBackground.cucumber.chopShadow._alpha = 150 - (startY - _y + 40) * 1.5; _root.introBackground.cucumber.chopShadow._width = startY - _y + 40; _root.introBackground.cucumber.chopShadow._height = startY - _y + 50; remove = false; _root.depthSortCustomY(this, _y + 70); onEnterFrame = function () { if (!_root.gamePause) { if (_visible) { _root.introBackground.cucumber.chopShadow._visible = true; _y = _y + ySpeed; if (_y < startY) { ySpeed += 0.2; } else { ySpeed -= 0.2; } _root.introBackground.cucumber.chopShadow._alpha = 150 - (startY - _y + 40) * 1.5; _root.introBackground.cucumber.chopShadow._width = startY - _y + 40; _root.introBackground.cucumber.chopShadow._height = startY - _y + 50; if (remove) { _yscale = _yscale + (-10 - _xscale) * 0.2; _xscale = _yscale + (-10 - _xscale) * 0.2; if (_xscale <= 0) { this._visible = false; } } else { _yscale = _yscale + (100 - _xscale) * 0.2; _xscale = _yscale + (100 - _xscale) * 0.2; } } } }; } } movieClip 165 { } movieClip 167 { } movieClip 168 { frame 1 { stop(); } frame 2 { function coconutFunction(obj) { obj._x += obj.xSpeed; obj._y += obj.ySpeed; obj.ySpeed += 1.3; obj._rotation += obj.rotSpeed; obj._alpha -= 4; } back.xSpeed = -8 + random(5); back.ySpeed = -12 - random(5); front.xSpeed = -5 + random(10); front.ySpeed = -12 - random(5); front.rotSpeed = 2; back.rotSpeed = -2.5; onEnterFrame = function () { if (!_root.gamePause) { coconutFunction(front); coconutFunction(back); _parent.shadow._alpha -= 10; if (back._alpha <= 0) { _parent.swapDepths(_parent._parent.getNextHighestDepth()); _parent.removeMovieClip(); } } }; } } movieClip 169 coconut { frame 1 { coconut._alpha = 0; shadow._alpha = 0; coconut.ySpeed = 0; coconut.rotSpeed = 0; onEnterFrame = function () { if (!_root.gamePause) { coconut.ySpeed += 1.5; coconut._y += coconut.ySpeed; coconut._alpha += 10; --recoverTimer; if (recoverTimer <= 0) { p = 1; while (p <= _root.nrOfPlayers) { if (_root['heroAttackHitboxP' + p].hitTest(hitbox)) { _root.playSound('nunchuck_hit_', 500, 0, 1 + random(4)); if (_root['heroAttackHitboxP' + p].damageMultiplier != 1) { _root.playSound('egg_hit_4', 500, 0); coconut.rotSpeed = 0; coconut._rotation = 0; coconut.gotoAndStop(2); _root.addStar(_parent._x + _x, _parent._y + _y - 30, 200); _root.chop.remove = true; _root.cutscene = true; _root.introTimer.pauseTimer = false; _root.heroP1.waypointX = _root.heroP1._x; _root.heroP1.waypointY = _root.heroP1._y; _root.heroP2.waypointX = _root.heroP2._x; _root.heroP2.waypointY = _root.heroP2._y; recoverTimer = 300; } else { _root.addStar(_parent._x + _x, _parent._y + _y - 30, 100); coconut.rotSpeed += 4; recoverTimer = 4; } } ++p; } } coconut.rotSpeed += -coconut._rotation / 30; coconut.rotSpeed /= 1.05; coconut._rotation += coconut.rotSpeed; if (coconut._rotation > 25) { coconut._rotation = 25; coconut.rotSpeed = 0; } else { if (coconut._rotation < -25) { coconut._rotation = -25; coconut.rotSpeed = 0; } } shadow._x = coconut._rotation * 0.5; shadow._width = coconut._width * 0.2 + 20; if (coconut._y >= 0) { coconut._y = 0; coconut.ySpeed *= -0.5; } if (coconut._alpha >= 100) { coconut._alpha = 100; } if (coconut._currentframe == 1) { shadow._alpha = 90 - coconut._y; } } }; } } movieClip 171 conveyorBeltLine { } movieClip 173 cucumberSlice { } movieClip 175 dirt { frame 1 { _root.depthSortCustomY(this, this._y + 5); } } movieClip 177 doorIn { } movieClip 179 doorInVertical { } movieClip 186 { frame 1 { stop(); } } movieClip 187 egg { frame 1 { egg.rotSpeed = 0; recoverTimer = 5; selfBeat = false; selfBeatTimer = 130 + random(40); nrOfHits = 1; if (sType == undefined) { sType = 1 + random(3); } if (fromArse == undefined) { fromArse = false; } else { if (fromArse) { _yscale = 0; _xscale = 0; } } if (nrOfBears == undefined) { nrOfBears = 1; } if (finalBoss == undefined) { finalBoss = false; } onEnterFrame = function () { if (!_root.gamePause) { if (_root.onScreen.hitTest(this)) { if (finalBoss) { if (_root.destroyAllEggs) { selfBeat = true; nrOfBears = 0; nrOfHits = 5; } } if (fromArse) { _yscale = _yscale + (100 - _xscale) * 0.1; _xscale = _yscale + (100 - _xscale) * 0.1; } if (!_root.cutscene) { --selfBeatTimer; } if (selfBeatTimer <= 0) { selfBeat = true; selfBeatTimer = 90; } --recoverTimer; if (recoverTimer <= 0) { p = 1; while (p <= _root.nrOfPlayers) { if (selfBeat || _root['heroAttackHitboxP' + p].hitTest(hitbox)) { _root.playSound('egg_hit_', _x, _y, nrOfHits); m = 0; while (m < _root['heroAttackHitboxP' + p].damageMultiplier) { if (_root['heroHitboxP' + p]._x < _x) { egg.rotSpeed += 4; } else { egg.rotSpeed -= 4; } if (!selfBeat && !finalBoss) { _root.addMultiplier(p); _root.giveScore(p, 10); } _root.addStar(_x, _y - 75, 200); if (nrOfHits >= 5) { _root.playSound('egg_hit_1', _x, _y); m = _root['heroAttackHitboxP' + p].damageMultiplier; e = 0; while (e <= 30) { newEggScaleName = 'ES' + _root.getNextHighestDepth(); _root.attachMovie('eggScales', newEggScaleName, _root.getNextHighestDepth()); _root[newEggScaleName]._x = _x - 50 + random(100); _root[newEggScaleName]._y = _y - random(125); ++e; } b = 0; while (b < nrOfBears) { _root.attachMovie('soldier', 'S' + _name + b, _root.getNextHighestDepth()); _root['S' + _name + b]._x = _x; _root['S' + _name + b]._y = _y; if (nrOfBears > 1) { _root['S' + _name + b]._x += -30 + random(60); _root['S' + _name + b]._y += -20 + random(20); } if (finalBoss) { _root['S' + _name + b].finalBoss = finalBoss; } _root['S' + _name + b].sType = sType; sType = 1 + random(3); if (restrictZoneName != undefined) { _root['S' + _name + b].restrictZoneName = restrictZoneName; } ++b; } _root.addSmoke(_x, _y - 50); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } e = 0; while (e <= 2 * nrOfHits) { newEggScaleName = 'ES' + _root.getNextHighestDepth(); _root.attachMovie('eggScales', newEggScaleName, _root.getNextHighestDepth()); _root[newEggScaleName]._x = _x - 50 + random(100); _root[newEggScaleName]._y = _y - random(125); ++e; } nrOfHits += 1; egg.gotoAndStop(nrOfHits); selfBeat = false; recoverTimer = 5; ++m; } } ++p; } } egg.rotSpeed += -egg._rotation / 30; egg.rotSpeed /= 1.05; egg._rotation += egg.rotSpeed; if (egg._rotation > 40) { egg._rotation = 40; egg.rotSpeed = 0; } else { if (egg._rotation < -40) { egg._rotation = -40; egg.rotSpeed = 0; } } shadow._x = egg._rotation * 1.2; shadow._width = egg._width * 0.8; _root.depthSort(this); } } }; } } movieClip 205 eggScales { frame 1 { xSpeed = -8 + random(16); ySpeed = -10 - random(3); _alpha = 150 + random(70); onEnterFrame = function () { if (!_root.gamePause) { _x = _x + xSpeed; _rotation = _rotation + xSpeed; ySpeed += 1; _y = _y + ySpeed; _alpha = _alpha - 10; if (_alpha <= 0) { this.swapDepths(_parent.getNextHighestDepth()); this.removeMovieClip(); } } }; gotoAndStop(2 + random(18)); } } movieClip 211 endCredits { frame 1 { timer = 0; _alpha = -200; stop(); onEnterFrame = function () { if (_alpha >= 100) { ++timer; } else { _alpha = _alpha + 3; } if (timer >= 120) { this.gotoAndStop(this._currentframe + 1); timer = 0; } }; } frame 5 { _root.gamePause = true; _root.hud.pauseScreen._visible = true; _root.hud.pauseScreen.gotoAndStop(4); this.removeMovieClip(); } } movieClip 213 fishHat { frame 1 { stop(); } frame 2 { ySpeed = -10; startY = _y; xSpeed = -_xscale * 0.05; distanceOfGround = 65; _root.attachMovie('shadow', _name + 'shadow', _root.getNextHighestDepth()); _root[_name + 'shadow']._x = _x; _root[_name + 'shadow']._y = startY + distanceOfGround + 20; _root[_name + 'shadow']._width = _width; _root[_name + 'shadow']._height = 10; _root.depthSortCustomY(_root[_name + 'shadow'], _root[_name + 'shadow']._y - 30); _root.depthSortCustomY(this, this._y + distanceOfGround); onEnterFrame = function () { if (!_root.gamePause) { ySpeed += 1; _rotation = _rotation + xSpeed; _x = _x + xSpeed; _y = _y + ySpeed; _root[_name + 'shadow']._x = _x; _root[_name + 'shadow']._y = startY + distanceOfGround + 20; if (_y > startY + distanceOfGround) { _rotation = 180; _y = startY + distanceOfGround; this.onEnterFrame = undefined; } if (restrictZoneName != undefined) { if (this._x + this._width / 2 > _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2 - this._width / 2; } else { if (this._x - this._width / 2 < _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2 + this._width / 2; } } } } }; } } movieClip 215 flash { } movieClip 217 { } movieClip 219 { } movieClip 222 { } movieClip 224 { } movieClip 225 { frame 1 { stop(); } instance wing1 of movieClip 217 { onClipEvent (enterFrame) { _rotation = _parent.ySpeed * 15; } } instance of movieClip 217 { onClipEvent (enterFrame) { _rotation = -_parent.wing1._rotation + 180; } } instance of movieClip 219 { onClipEvent (enterFrame) { _rotation = -20 - _parent.ySpeed * 5; } } instance of movieClip 219 { onClipEvent (enterFrame) { _rotation = _parent.ySpeed * 5; } } } movieClip 226 fly { frame 1 { fly.startY = fly._y; fly.ySpeed = 0; fly.ySpeed2 = -30; fly._y = -fly._height / 2; moveSpeed = 3.5 + 0.1 * random(20); moveAngle = -180 + random(360); if (!_root.hero2Alive) { closestHero = 1; } else { if (!_root.hero1Alive) { closestHero = 2; } else { closestHero = 1; } } tX = _x; tY = _y; tRot = 0; tRotSpeed = 1.2 + 0.01 * random(60); xSpeed = 0; ySpeed = 0; if (random(2) == 1) { stickTimer = 90; } else { stickTimer = 150; } stickToPlayer = false; readyToAttack = false; attackTimer = 30; ++_root.nrOfHatBirds; _alpha = 0; onEnterFrame = function () { if (!_root.gamePause) { if (_alpha < 100) { _alpha = _alpha + 10; } else { _alpha = 100; } if (!readyToAttack) { fly.ySpeed += (fly.ySpeed2 - fly.ySpeed) * 0.02; fly._y += fly.ySpeed; if (fly._y < fly.startY - 1) { fly.ySpeed2 = 30; } else { if (fly._y > fly.startY + 1) { fly.ySpeed2 = -30; } } } else { fly.ySpeed += (fly.ySpeed2 - fly.ySpeed) * 0.05; fly._y += fly.ySpeed; if (fly._y < fly.startY - 1) { fly.ySpeed2 = 60; } else { if (fly._y > fly.startY + 1) { fly.ySpeed2 = -60; } } } if (!_root['hero' + closestHero + 'Alive']) { _root.addStar(_x, _y + fly._y, 150); --_root.nrOfHatBirds; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } if (!readyToAttack && _root.nrOfPlayers == 2) { closestHero = 1; if (_root.getDist(_x, _y, _root.heroP2._x, _root.heroP2._y) < _root.getDist(_x, _y, _root.heroP1._x, _root.heroP1._y)) { closestHero = 2; } if (!_root.hero2Alive) { closestHero = 1; } else { if (!_root.hero1Alive) { closestHero = 2; } } } fly.beak._rotation = _root.getAngle(_x, _y, _root['heroP' + closestHero]._x, _root['heroP' + closestHero]._y) - 90; if (Math.sqrt((tX - _root['heroP' + closestHero]._x) * (tX - _root['heroP' + closestHero]._x) + (tY - _root['heroP' + closestHero]._y) * 2 * ((tY - _root['heroP' + closestHero]._y) * 2)) < 170) { stickToPlayer = true; } else { if (Math.sqrt((tX - _root['heroP' + closestHero]._x) * (tX - _root['heroP' + closestHero]._x) + (tY - _root['heroP' + closestHero]._y) * 2 * ((tY - _root['heroP' + closestHero]._y) * 2)) > 180) { stickToPlayer = false; } } if (!readyToAttack) { if (!stickToPlayer) { tRot = _root.getAngle(tX, tY, _root['heroP' + closestHero]._x, _root['heroP' + closestHero]._y) + 90; tX -= Math.sin(tRot * 0.0174532925199433) * moveSpeed; tY += Math.cos(tRot * 0.0174532925199433) * moveSpeed; } else { --stickTimer; tRot += tRotSpeed; tX = _root['heroP' + closestHero]._x + Math.sin(tRot * 0.0174532925199433) * 170; tY = _root['heroP' + closestHero]._y - Math.cos(tRot * 0.0174532925199433) * 85; if (stickTimer <= 0 && tY > _root['heroP' + closestHero]._y - 3 && tY < _root['heroP' + closestHero]._y + 3) { if (!playedChargeSound) { _root.playSound('bird_charge_1', _x, _y); playedChargeSound = true; } fly.gotoAndStop(2); readyToAttack = true; fly._rotation = _root.getAngle(_x, _y, _root['heroP' + closestHero]._x, _root['heroP' + closestHero]._y) - 90; } } } else { --attackTimer; fly.sparkleFlash._alpha = 30 + random(60); fly.sparkleFlash._rotation = -180 + random(360); if (attackTimer > 0) { tX = _root['heroP' + closestHero]._x + Math.sin(tRot * 0.0174532925199433) * 170; tY = _root['heroP' + closestHero]._y - Math.cos(tRot * 0.0174532925199433) * 85; _x = tX - 5 + random(10); _y = tY - 3 + random(6); fly._yscale += 0.7; fly._xscale = fly._yscale; } else { if (attackTimer <= 0 && attackTimer > -6) { tX = _root['heroP' + closestHero]._x + Math.sin(tRot * 0.0174532925199433) * 250; tY = _root['heroP' + closestHero]._y - Math.cos(tRot * 0.0174532925199433) * 85; } else { if (attackTimer < -6) { p = 1; while (p <= _root.nrOfPlayers) { if (hitbox.hitTest(_root['heroAttackHitboxP' + p])) { _root.addStar(_x, _y + fly._y, 150); --_root.nrOfHatBirds; _root.playSound('bird_hit_1', _x, _y); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } if (hitbox.hitTest(_root['heroHitboxP' + p])) { if (_x > _root['heroHitboxP' + p]._x) { _root.hurtHero(p, 1, 20); } else { _root.hurtHero(p, -1, 20); } --_root.nrOfHatBirds; _root.addStar(_root['heroP' + p]._x, _root['heroP' + p]._y + fly._y, 150); _root.playSound('bird_hit_1', _x, _y); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } ++p; } if (_root['heroP' + closestHero]._x < tX) { tX -= 10; } else { tX += 10; } _y = _root['heroP' + closestHero]._y; tY = _root['heroP' + closestHero]._y; } } } } fly._yscale = 100 + fly.ySpeed * 4; fly._xscale = 100 + (100 - fly._yscale); _x = _x + (tX - _x) * 0.18; _y = _y + (tY - _y) * 0.18; shadow._yscale = 73 - Math.abs(fly._y) * 0.9; shadow._xscale = shadow._yscale; _root.depthSort(this); } }; } } movieClip 228 gameCamera { frame 1 { function camControl() { var v5 = sX / this._width; var v4 = sY / this._height; _parent._x = cX - this._x * v5; _parent._y = cY - this._y * v4; _parent._xscale = 100 * v5; _parent._yscale = 100 * v4; _root.hud._xscale = this._xscale; _root.hud._yscale = this._yscale; _root.onScreen._x = this._x; _root.hud._x = _root.onScreen._x; _root.onScreen._y = this._y; _root.hud._y = _root.onScreen._y; } this._visible = false; Stage.scaleMode = 'noScale'; var cX = Stage.width / 2; var cY = Stage.height / 2; var sX = Stage.width; var sY = Stage.height; this.onEnterFrame = camControl; camControl(); } } movieClip 229 glitter { } movieClip 231 glitterSmoke { } movieClip 236 hairTufft { frame 1 { this.gotoAndStop(1 + random(4)); } } movieClip 239 { } movieClip 240 healthBar { frame 1 { if (maxHealth == undefined) { maxHealth = _parent.health; } bar._xscale = (maxHealth - _parent.health) * 100; _alpha = -10; onEnterFrame = function () { if (_parent.health != maxHealth) { _alpha = _alpha + (110 - _alpha) * 0.2; } bar._xscale = (_parent.health / maxHealth) * 100; if (_parent._xscale < 0) { this._xscale = -100; } else { this._xscale = 100; } if (adjustRotation) { _rotation = -_parent._rotation; } }; } } movieClip 243 { } movieClip 245 { } movieClip 246 heart { frame 1 { stop(); } instance of movieClip 243 { onClipEvent (load) { ySpeed = -10 - random(4); xSpeed = 3 + random(2); } onClipEvent (enterFrame) { if (!_root.gamePause) { ySpeed += 1; _x = _x + xSpeed; _y = _y + ySpeed; _rotation = _rotation + 1; } } } instance of movieClip 245 { onClipEvent (load) { ySpeed = -10 - random(4); xSpeed = -3 - random(2); } onClipEvent (enterFrame) { if (!_root.gamePause) { ySpeed += 1; _x = _x + xSpeed; _y = _y + ySpeed; _rotation = _rotation - 1; } } } } movieClip 248 { } movieClip 250 { } movieClip 252 { } movieClip 254 { } movieClip 255 { instance of movieClip 250 { onClipEvent (enterFrame) { if (!_root.gamePause) { _rotation = (100 - _root.hero1health) * -0.4 - _parent._rotation * ((1 - _root.hero1health / 100) * 0.6); } } } instance of movieClip 252 { onClipEvent (enterFrame) { if (!_root.gamePause) { _rotation = (100 - _root.hero1health) * 0.1 - _parent._rotation * ((1 - _root.hero1health / 100) * -0.1); } } } instance of movieClip 254 { onClipEvent (enterFrame) { if (!_root.gamePause) { _rotation = (100 - _root.hero1health) * 0.2 - _parent._rotation * ((1 - _root.hero1health / 100) * 0.2); } } } } movieClip 260 { frame 1 { stop(); } } movieClip 263 { } movieClip 264 { instance of movieClip 263 { onClipEvent (enterFrame) { if (!_root.gamePause) { _rotation = -((100 - _root.hero1health) * 0.2); } } } } movieClip 266 { } movieClip 267 hero1 { frame 1 { lowerBody.zSpeed = 0; upperBody.zSpeed = 0; upperBody.startY = upperBody._y; upperBody.hair.rotSpeed = 0; playedFootstepSound = true; onEnterFrame = function () { if (!_root.gamePause) { lowerBody.zSpeed += 2 * speedMultiplyer; lowerBody._y += lowerBody.zSpeed; if (lowerBody._y > 0) { lowerBody._y = 0; if (!playedFootstepSound) { _root.playSound('footstep_', _x, _y, 6); playedFootstepSound = true; } lowerBody.zSpeed = 0; if (_root.kUpP1 || _root.kDownP1 || _root.kRightP1 || _root.kLeftP1) { playedFootstepSound = false; lowerBody.zSpeed = -8; } } upperBody.zSpeed += (lowerBody._y + upperBody.startY - upperBody._y) / 2; upperBody.zSpeed /= 1.9; upperBody._y += upperBody.zSpeed; upperBody.hair.rotSpeed += (-Math.abs(xSpeed * 5) - upperBody.hair._rotation) / 5; upperBody.hair.rotSpeed /= 1.2; upperBody.hair._rotation += upperBody.hair.rotSpeed; if (upperBody._y > upperBody.startY + lowerBody._y + 3) { upperBody._y = upperBody.startY + lowerBody._y + 3; } middle._y = lowerBody._y - 15; middle._height = lowerBody._y - 15 - upperBody._y; } }; } } movieClip 272 { frame 1 { stop(); } } movieClip 277 teddington { frame 1 { stop(); } } movieClip 280 { } movieClip 283 { } movieClip 284 { instance glow of movieClip 283 { onClipEvent (load) { _alpha = 0; } onClipEvent (enterFrame) { if (_alpha > 0) { _alpha = _alpha - 13; _visible = true; } else { _visible = false; } } } } movieClip 285 { instance glow of movieClip 280 { onClipEvent (load) { _alpha = 0; } onClipEvent (enterFrame) { if (_alpha > 0) { _alpha = _alpha - 10; } } } } movieClip 286 hero1MegaTeddington { frame 1 { zSpeed = 0; upperBody.zSpeed = -2; upperBody.startY = upperBody._y; upperBody.hair.rotSpeed = 0; zPos = 0; playedFootstepSound = true; onEnterFrame = function () { if (!_root.gamePause) { if (upperBody._y > upperBody.startY + 3) { upperBody.zSpeed -= 0.3 * speedMultiplyer; } else { if (upperBody._y < upperBody.startY - 3) { upperBody.zSpeed += 0.3 * speedMultiplyer; } } if (upperBody.zSpeed > 2) { upperBody.zSpeed += (2 - upperBody.zSpeed) * 0.3; } else { if (upperBody.zSpeed < -2) { upperBody.zSpeed += (-2 - upperBody.zSpeed) * 0.3; } } upperBody._y += upperBody.zSpeed; upperBody.hair.rotSpeed += (-Math.abs(xSpeed * 5) - upperBody.hair._rotation) / 5; upperBody.hair.rotSpeed /= 1.2; upperBody.hair._rotation += upperBody.hair.rotSpeed; } }; } } movieClip 288 { } movieClip 290 { } movieClip 293 { } movieClip 295 { } movieClip 299 { frame 1 { stop(); } } movieClip 300 { instance of movieClip 293 { onClipEvent (enterFrame) { if (!_root.gamePause) { _yscale = _root.hero2health; _xscale = _root.hero2health; } } } instance of movieClip 295 { onClipEvent (enterFrame) { if (!_root.gamePause) { _rotation = -(100 - _root.hero2health) * 0.3; } } } instance of movieClip 295 { onClipEvent (enterFrame) { if (!_root.gamePause) { _rotation = (100 - _root.hero2health) * 0.3; } } } } movieClip 302 { } movieClip 303 hero2 { frame 1 { lowerBody.zSpeed = 0; upperBody.zSpeed = 0; upperBody.startY = upperBody._y; cape.rotSpeed = 0; playedFootstepSound = true; onEnterFrame = function () { if (!_root.gamePause) { lowerBody.zSpeed += 2 * speedMultiplyer; lowerBody._y += lowerBody.zSpeed; if (lowerBody._y > 0) { lowerBody._y = 0; if (!playedFootstepSound) { _root.playSound('footstep_', _x, _y, 6); playedFootstepSound = true; } lowerBody.zSpeed = 0; if (_root.kUpP2 || _root.kDownP2 || _root.kRightP2 || _root.kLeftP2) { playedFootstepSound = false; lowerBody.zSpeed = -8; } } upperBody.zSpeed += (lowerBody._y + upperBody.startY - upperBody._y) / 2; upperBody.zSpeed /= 1.9; upperBody._y += upperBody.zSpeed; cape.rotSpeed += (100 + Math.abs(xSpeed * 10) - cape._xscale) / 6; cape.rotSpeed /= 1.3; cape._xscale += cape.rotSpeed; cape._yscale = 150 - cape._xscale * 0.5; cape._rotation = (cape._xscale - 100) * 0.1; if (upperBody._y > upperBody.startY + lowerBody._y + 3) { upperBody._y = upperBody.startY + lowerBody._y + 3; } middle._y = lowerBody._y - 15; middle._height = lowerBody._y - 15 - upperBody._y; } }; } } movieClip 307 { frame 1 { stop(); } } movieClip 310 { } movieClip 313 { } movieClip 314 { instance swoosh of movieClip 307 { onClipEvent (load) { _alpha = 0; } } instance power of movieClip 310 { onClipEvent (load) { _alpha = 0; } } } movieClip 315 { } movieClip 316 heroSword { } // unknown tag 88 length 62 movieClip 320 { frame 1 { _visible = _root.cutscene; onEnterFrame = function () { _visible = _root.cutscene; }; } } movieClip 321 { frame 1 { stop(); onEnterFrame = function () { if (_alpha < 0) { _visible = false; } else { _visible = true; } }; } } movieClip 327 { frame 1 { stop(); } } movieClip 332 { } movieClip 336 multiplierText { } movieClip 340 { instance healthBarP1 of movieClip 239 { onClipEvent (load) { startXScale = _xscale; } onClipEvent (enterFrame) { _xscale = (_root.hero1health / _root.hero1maxHealth) * startXScale; } } instance healthBarP2 of movieClip 239 { onClipEvent (load) { startXScale = _xscale; if (_root.nrOfPlayers == 1) { _xscale = 0; } } onClipEvent (enterFrame) { _xscale = (_root.hero2health / _root.hero2maxHealth) * startXScale; } } instance multiplierDisplayP1 of movieClip 336 multiplierText { onClipEvent (load) { _visible = false; } } instance multiplierDisplayP2 of movieClip 336 multiplierText { onClipEvent (load) { _visible = false; } } } movieClip 341 { } movieClip 344 { } movieClip 346 { } movieClip 348 { } movieClip 349 { frame 1 { startY = _y; _y = _y + 70; ySpeed = 0; endBit.startX = endBit._x; endBit.xSpeed = 0; showTip = false; showText = false; tipsText.displayText.autoSize = true; onEnterFrame = function () { if (!_root.gamePause) { if (displayTimer != undefined) { --displayTimer; if (displayTimer <= 0) { showTip = false; showText = false; ySpeed = -5; displayTimer = undefined; } } if (endBit._x < endBit.startX + 3) { ySpeed += 1.2; _y = _y + ySpeed; } endBit._x += endBit.xSpeed; if (showTip) { if (_y > 240) { ySpeed = -15; } else { if (ySpeed >= 0) { if (_y > startY) { if (endBit.xSpeed == 0) { endBit.xSpeed = 40; showText = true; } _y = startY; ySpeed = 0; } } } } else { if (_y > startY + 70) { _y = startY + 70; ySpeed = 0; } } if (showText) { if (endBit._x < endBit.startX + tipsText._width + 30) { } else { endBit.xSpeed += (-15 - endBit.xSpeed) * 0.4; } if (endBit.xSpeed <= 0) { if (endBit._x < endBit.startX + tipsText._width + 30) { endBit._x = endBit.startX + tipsText._width + 30; endBit.xSpeed = 0; } } } else { endBit.xSpeed = -40; } if (endBit._x < endBit.startX) { endBit._x = endBit.startX; endBit.xSpeed = 0; if (nextMessage != undefined) { endBit.xSpeed = 40; tipsText.displayText.text = nextMessage; nextMessage = undefined; showText = true; } } else { if (endBit._x > 800) { endBit._x = 800; endBit.xSpeed = 0; } } maskBit._x = endBit._x; } }; } } movieClip 353 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 361 { } movieClip 363 { } movieClip 364 { frame 1 { mouseHeldDown = false; slider._x = 8 + (_root[inputVar] / maxVal) * 134; bar._width = slider._x; onEnterFrame = function () { if (mouseHeldDown) { _root[inputVar] = ((this._xmouse - 8) / 128) * maxVal; } if (_root[inputVar] > maxVal) { _root[inputVar] = maxVal; } else { if (_root[inputVar] < 0) { _root[inputVar] = 0; } } slider._x = 8 + (_root[inputVar] / maxVal) * 134; bar._width = slider._x; }; } instance hitbox of movieClip 155 hitbox { onClipEvent (load) { startWidth = _width; startHeight = _height; } onClipEvent (press) { _height = 2000; _width = 2000; _parent._parent[_parent.hideHitboxInObj].hitbox._x = 5000; _parent.mouseHeldDown = true; _root.playSound('menu_select_press'); } onClipEvent (release) { _root.savedData.data[_parent.inputVar] = _root[_parent.inputVar]; _root.savedData.flush(); _width = startWidth; _height = startHeight; _parent._parent[_parent.hideHitboxInObj].hitbox._x = 75; _parent.mouseHeldDown = false; _root.playSound('menu_select'); } onClipEvent (enterFrame) { this._visible = true; this._alpha = 0; this.onEnterFrame = undefined; } } } movieClip 368 { frame 1 { stop(); } } movieClip 371 { frame 1 { stop(); } } movieClip 374 { frame 1 { stop(); } } movieClip 376 { frame 1 { stop(); } } movieClip 379 { frame 1 { stop(); } } movieClip 381 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 383 { frame 1 { stop(); } } movieClip 385 { frame 1 { stop(); } } movieClip 388 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 408 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 412 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 422 { frame 1 { stop(); } } movieClip 425 { } movieClip 455 { } movieClip 456 { frame 1 { stop(); } frame 60 { stop(); } instance of movieClip 455 { onClipEvent (load) { lipShake = 0.5; } onClipEvent (enterFrame) { _y = 1 + lipShake; lipShake *= -1; } } } movieClip 460 { } movieClip 463 { frame 1 { _root.depthSortCustomY(this, _y - 2); } } movieClip 466 { frame 1 { _root.depthSort(this); } } movieClip 468 { } movieClip 471 { } movieClip 477 { } movieClip 478 { frame 1 { stop(); } instance of movieClip 388 { onClipEvent (release) { _root.playSound('menu_select'); hover = true; _parent._parent.gotoAndStop(1); } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_1'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 477 { onClipEvent (load) { achievementNr = 1; this.gotoAndStop(achievementNr); if (!_root.savedData.data['achievement' + achievementNr]) { _visible = false; } } } instance of movieClip 477 { onClipEvent (load) { achievementNr = 2; this.gotoAndStop(achievementNr); if (!_root.savedData.data['achievement' + achievementNr]) { _visible = false; } } } instance of movieClip 477 { onClipEvent (load) { achievementNr = 3; this.gotoAndStop(achievementNr); if (!_root.savedData.data['achievement' + achievementNr]) { _visible = false; } } } instance of movieClip 477 { onClipEvent (load) { achievementNr = 4; this.gotoAndStop(achievementNr); if (!_root.savedData.data['achievement' + achievementNr]) { _visible = false; } } } instance of movieClip 477 { onClipEvent (load) { achievementNr = 5; this.gotoAndStop(achievementNr); if (!_root.savedData.data['achievement' + achievementNr]) { _visible = false; } } } instance of movieClip 477 { onClipEvent (load) { achievementNr = 6; this.gotoAndStop(achievementNr); if (!_root.savedData.data['achievement' + achievementNr]) { _visible = false; } } } instance of movieClip 477 { onClipEvent (load) { achievementNr = 7; this.gotoAndStop(achievementNr); if (!_root.savedData.data['achievement' + achievementNr]) { _visible = false; } } } instance of movieClip 477 { onClipEvent (load) { achievementNr = 8; this.gotoAndStop(achievementNr); if (!_root.savedData.data['achievement' + achievementNr]) { _visible = false; } } } instance of movieClip 477 { onClipEvent (load) { achievementNr = 9; this.gotoAndStop(achievementNr); if (!_root.savedData.data['achievement' + achievementNr]) { _visible = false; } } } instance of movieClip 477 { onClipEvent (load) { achievementNr = 10; this.gotoAndStop(achievementNr); if (!_root.savedData.data['achievement' + achievementNr]) { _visible = false; } } } instance of movieClip 477 { onClipEvent (load) { achievementNr = 11; this.gotoAndStop(achievementNr); if (!_root.savedData.data['achievement' + achievementNr]) { _visible = false; } } } instance of movieClip 477 { onClipEvent (load) { achievementNr = 12; this.gotoAndStop(achievementNr); if (!_root.savedData.data['achievement' + achievementNr]) { _visible = false; } } } } movieClip 479 { frame 1 { stop(); } instance of movieClip 353 { onClipEvent (release) { _root.playSound('menu_select'); hover = true; _root.onScreen.gotoAndStop(1); _root.gamePause = false; _parent._visible = false; } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_4'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance sfxVolSlider of movieClip 364 { onClipEvent (load) { inputVar = 'sfxVolume'; maxVal = 1; hideHitboxInObj = 'musicVolSlider'; } } instance musicVolSlider of movieClip 364 { onClipEvent (load) { inputVar = 'musicVolume'; maxVal = 1; hideHitboxInObj = 'sfxVolSlider'; } } instance qualityLow of movieClip 368 { onClipEvent (load) { if (_root._quality == 'LOW') { this.gotoAndStop(2); } } onClipEvent (press) { _root.playSound('menu_select_press'); _root.savedData.data.qualitySetting = 'LOW'; _parent.qualityMedium.gotoAndStop(1); _parent.qualityHigh.gotoAndStop(1); this.gotoAndStop(2); _root._quality = 'Low'; } onClipEvent (rollOver) { _root.playSound('menu_hover_1'); } } instance qualityMedium of movieClip 371 { onClipEvent (load) { if (_root._quality == 'MEDIUM') { this.gotoAndStop(2); } } onClipEvent (press) { _root.playSound('menu_select_press'); _root.savedData.data.qualitySetting = 'MEDIUM'; _parent.qualityLow.gotoAndStop(1); _parent.qualityHigh.gotoAndStop(1); this.gotoAndStop(2); _root._quality = 'MEDIUM'; } onClipEvent (rollOver) { _root.playSound('menu_hover_2'); } } instance qualityHigh of movieClip 374 { onClipEvent (load) { if (_root._quality == 'HIGH') { this.gotoAndStop(2); } } onClipEvent (press) { _root.playSound('menu_select_press'); _root.savedData.data.qualitySetting = 'HIGH'; _parent.qualityLow.gotoAndStop(1); _parent.qualityMedium.gotoAndStop(1); this.gotoAndStop(2); _root._quality = 'HIGH'; } onClipEvent (rollOver) { _root.playSound('menu_hover_3'); } } instance of movieClip 376 { onClipEvent (press) { _root.playSound('menu_select_press'); this.gotoAndStop(2); } onClipEvent (release) { _root.playSound('menu_select'); _parent.gotoAndStop(2); this.gotoAndStop(1); } onClipEvent (dragOut) { this.gotoAndStop(1); } onClipEvent (rollOver) { _root.playSound('menu_hover_4'); } } instance activate2PButton of movieClip 379 { onClipEvent (press) { _root.playSound('menu_select_press'); if (_root.nrOfPlayers == 1) { this.gotoAndStop(2); } else { this.gotoAndStop(4); } } onClipEvent (release) { _root.playSound('menu_select'); if (_root.nrOfPlayers == 1) { if (_root.hero2score != undefined) { _root.hero2displayScore = _root.hero2score; } else { _root.hero2score = 0; _root.hero2displayScore = 0; _root.hero2scoreContinuesGiven = 0; _root.hero2scoreTemp = 0; _root.hero2multiplier = 0; _root.hero2multiplierTimer = 0; } _root.hud.overheadDisplay.healthBarP2._visible = true; _root.hud.overheadDisplay.iconP2.gotoAndStop(3); _root.savedData.data.hero2displayScore = _root.hero2displayScore; _root.savedData.data.nrOfPlayers = 2; _root.savedData.flush(); _root.player2JustActivatedFromMenu = true; _root.nrOfPlayers = 2; this.gotoAndStop(3); } else { _root.despawnPlayer(2); _root.hero2displayScore = 'MENU KEY [Enter or P] for 2 players'; _root.hud.overheadDisplay.multiplierDisplayP2._visible = false; _root.hud.overheadDisplay.healthBarP2._visible = false; _root.hud.overheadDisplay.iconP2.gotoAndStop(2); _root.hero2health = 0; _root.hero2RespawnDelay = 0; _root.savedData.data.nrOfPlayers = 1; _root.savedData.flush(); _root.nrOfPlayers = 1; this.gotoAndStop(1); } } onClipEvent (dragOut) { if (_root.nrOfPlayers == 1) { this.gotoAndStop(1); } else { this.gotoAndStop(3); } } onClipEvent (load) { if (_root.nrOfPlayers == 1) { this.gotoAndStop(1); } else { this.gotoAndStop(3); } } onClipEvent (rollOver) { _root.playSound('menu_hover_5'); } } instance of movieClip 381 { onClipEvent (release) { _root.playSound('menu_select'); hover = true; _parent.gotoAndStop(3); } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_3'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance restartButton of movieClip 383 { onClipEvent (press) { _root.playSound('menu_select_press'); this.gotoAndStop(2); } onClipEvent (release) { _root.playSound('menu_select'); i = 0; while (i < _root.musicTracks.length) { _root[_root.musicTracks[i] + 'TVol'] = 0; ++i; } _root.hud.mainMenuContinueWhiteFade.swapDepths(_root.hud.getNextHighestDepth()); _root.hud.mainMenuContinueWhiteFade.removeMovieClip(); _root.hud.attachMovie('whiteFade', 'mainMenuContinueWhiteFade', _root.hud.getNextHighestDepth()); _root.hud.mainMenuContinueWhiteFade.gotoAndStop(2); _root.hud.mainMenuContinueWhiteFade._alpha = 0; _root.hud.mainMenuContinueWhiteFade.onEnterFrame = function () { this._alpha += 2; if (this._alpha >= 110) { _root.clearAllVariables(); _root.loadState(); _root.mainMenuContinue = true; _root.onScreen.gotoAndStop(1); _root.gamePause = false; _parent._visible = false; stopAllSounds(); _root.gotoAndStop(_root.savedData.data.lastSavedFrame); this.swapDepths(this._parent.getNextHighestDepth()); this.removeMovieClip(); } }; this.gotoAndStop(1); } onClipEvent (dragOut) { this.gotoAndStop(1); } onClipEvent (load) { if (_root.savedData.data.lastSavedFrame == undefined) { _visible = false; } } onClipEvent (rollOver) { _root.playSound('menu_hover_5'); } } instance activate2PButton of movieClip 385 { onClipEvent (press) { _root.playSound('menu_select_press'); this.gotoAndStop(2); } onClipEvent (release) { _root.playSound('menu_select'); _parent.gotoAndStop(5); this.gotoAndStop(1); } onClipEvent (dragOut) { this.gotoAndStop(1); } onClipEvent (rollOver) { _root.playSound('menu_hover_6'); } } instance of movieClip 388 { onClipEvent (release) { _root.playSound('menu_select'); hover = true; _parent.gotoAndStop(1); } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_2'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 408 { onClipEvent (release) { _root.playSound('menu_select'); hover = true; _parent.gotoAndStop(1); } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_2'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 412 { onClipEvent (release) { _root.playSound('menu_select'); i = 0; while (i < _root.musicTracks.length) { _root[_root.musicTracks[i] + 'TVol'] = 0; ++i; } hover = true; _root.hideUiTip(); _root.hud.mainMenuContinueWhiteFade.swapDepths(_root.hud.getNextHighestDepth()); _root.hud.mainMenuContinueWhiteFade.removeMovieClip(); _root.hud.attachMovie('whiteFade', 'mainMenuContinueWhiteFade', _root.hud.getNextHighestDepth()); _root.hud.mainMenuContinueWhiteFade.gotoAndStop(2); _root.hud.mainMenuContinueWhiteFade._alpha = 0; _root.hud.mainMenuContinueWhiteFade.onEnterFrame = function () { this._alpha += 2; if (this._alpha >= 110) { _root.onScreen.gotoAndStop(1); _root.gamePause = false; _parent._visible = false; stopAllSounds(); _root.gotoAndStop(9); this.swapDepths(this._parent.getNextHighestDepth()); this.removeMovieClip(); } }; } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_2'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 381 { onClipEvent (release) { _root.playSound('menu_select'); i = 0; while (i < _root.musicTracks.length) { _root[_root.musicTracks[i] + 'TVol'] = 0; ++i; } hover = true; _root.hud.endCredits.swapDepths(_root.hud.getNextHighestDepth()); _root.hud.endCredits.removeMovieClip(); _root.hud.mainMenuContinueWhiteFade.swapDepths(_root.hud.getNextHighestDepth()); _root.hud.mainMenuContinueWhiteFade.removeMovieClip(); _root.hud.attachMovie('whiteFade', 'mainMenuContinueWhiteFade', _root.hud.getNextHighestDepth()); _root.hud.mainMenuContinueWhiteFade.gotoAndStop(2); _root.hud.mainMenuContinueWhiteFade._alpha = 0; _root.hud.mainMenuContinueWhiteFade.onEnterFrame = function () { this._alpha += 2; if (this._alpha >= 110) { _root.onScreen.gotoAndStop(1); _root.gamePause = false; _parent.gotoAndStop(1); stopAllSounds(); _root.gotoAndStop(9); this.swapDepths(this._parent.getNextHighestDepth()); this.removeMovieClip(); } }; } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_3'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance restartButton of movieClip 383 { onClipEvent (press) { _root.playSound('menu_select_press'); this.gotoAndStop(2); } onClipEvent (release) { _root.playSound('menu_select'); i = 0; while (i < _root.musicTracks.length) { _root[_root.musicTracks[i] + 'TVol'] = 0; ++i; } _root.hud.mainMenuContinueWhiteFade.swapDepths(_root.hud.getNextHighestDepth()); _root.hud.mainMenuContinueWhiteFade.removeMovieClip(); _root.hud.endCredits.swapDepths(_root.hud.getNextHighestDepth()); _root.hud.endCredits.removeMovieClip(); _root.hud.attachMovie('whiteFade', 'mainMenuContinueWhiteFade', _root.hud.getNextHighestDepth()); _root.hud.mainMenuContinueWhiteFade.gotoAndStop(2); _root.hud.mainMenuContinueWhiteFade._alpha = 0; _root.hud.mainMenuContinueWhiteFade.onEnterFrame = function () { this._alpha += 2; if (this._alpha >= 110) { _root.hud.pauseScreen.gotoAndStop(1); _root.clearAllVariables(); if (_root.savedData.data.continues < 3 * _root.nrOfPlayers) { _root.savedData.data.continues = 3 * _root.nrOfPlayers; } _root.loadState(); _root.mainMenuContinue = true; _root.onScreen.gotoAndStop(1); _root.gamePause = false; _parent._visible = false; stopAllSounds(); _root.gotoAndStop(_root.savedData.data.lastSavedFrame); this.swapDepths(this._parent.getNextHighestDepth()); this.removeMovieClip(); } }; this.gotoAndStop(1); } onClipEvent (dragOut) { this.gotoAndStop(1); } onClipEvent (load) { if (_root.savedData.data.lastSavedFrame == undefined) { _visible = false; } } onClipEvent (rollOver) { _root.playSound('menu_hover_2'); } } instance restartButton of movieClip 422 { onClipEvent (load) { _visible = false; } onClipEvent (press) { _root.playSound('menu_select_press'); this.gotoAndStop(2); } onClipEvent (release) { _root.playSound('menu_select'); this.gotoAndStop(1); if (_root.hero2score == undefined) { } else {} } onClipEvent (dragOut) { this.gotoAndStop(1); } onClipEvent (rollOver) { _root.playSound('menu_hover_1'); } } instance of movieClip 425 { onClipEvent (load) { if (_root.hero2score == undefined) { _alpha = 30; this.finalScoreDisplay.text = '-'; finalScore = _root.hero1score; } else { _alpha = 100; this.finalScoreDisplay.text = String(_root.hero2score); finalScore = _root.hero1score + _root.hero2score; } if (_root.savedData.data.highestScore == undefined || finalScore > _root.savedData.data.highestScore) { _root.savedData.data.highestScore = finalScore; _root.savedData.flush(); } if (_root.siteKongregate()) { _global.kongregate.stats.submit('Highscore', finalScore); } com.newgrounds.API.postScore('Nunchuck Charlie - Scoreboard', finalScore); _parent.finalScoreTotal.text = String(finalScore); _parent.personalHighest.text = String(_root.savedData.data.highestScore); } onClipEvent (enterFrame) { if (_root.hud.pauseScreen._visible) { if (_root.hero2score == undefined) { _alpha = 30; this.finalScoreDisplay.text = '-'; _parent.finalScoreTotal.text = String(_root.hero1score); } else { _alpha = 100; this.finalScoreDisplay.text = String(_root.hero2score); _parent.finalScoreTotal.text = String(_root.hero1score + _root.hero2score); } } } } } movieClip 480 hud { instance blackFade of movieClip 321 { onClipEvent (load) { _alpha = 100; fadeTarget = -20; } } instance overheadDisplay of movieClip 340 { onClipEvent (load) { startY = _y; } } instance pauseScreen of movieClip 479 { onClipEvent (load) { _visible = false; } } } movieClip 483 { } movieClip 485 { } movieClip 487 { } movieClip 489 { } movieClip 490 laser { frame 1 { focusBeam._alpha = -10; l = 0; while (l < 10) { laserName = 'l' + this.getNextHighestDepth(); this.attachMovie('laserChargeBeam', laserName, this.getNextHighestDepth()); this[laserName]._rotation = -45 + random(90); this[laserName]._alpha = 80 + random(20); this[laserName]._yscale = 100 + random(50); this[laserName]._xscale = this[laserName]._yscale; this[laserName].onEnterFrame = function () { if (!_root.gamePause) { this._yscale -= 20; this._xscale = this._yscale; this._alpha += 5; if (this._xscale <= 0) { if (this._parent.laserCharge) { this._alpha = 80 + random(20); this._rotation = -60 + random(120); this._yscale = 100 + random(50); this._xscale = this._yscale; } else { this.removeMovieClip(); } } } }; ++l; } laserBeam._alpha = 0; yScaleSpeed = 0; focusBeam._yscale = 400; timer = 30; timer2 = 15; this.attachMovie('flash', 'flsh', this.getNextHighestDepth()); flsh._yscale = 300; flsh._xscale = 300; flsh._alpha = 0; laserCharge = true; distanceOfGround = 50; onEnterFrame = function () { if (!_root.gamePause) { --timer; laserBeam.beam._width = _root.rightWall._x - _x; laserBeam.endOfBeam._x = laserBeam.beam._width; if (timer == 0) { flsh._alpha = 100; focusBeam._alpha = 100; } if (timer <= 0) { if (flsh._alpha <= 0) { flsh.swapDepths(_root.getNextHighestDepth()); flsh.removeMovieClip(); } else { flsh._alpha -= 15; } if (focusBeam._yscale < 0) { laserCharge = false; focusBeam.swapDepths(this.getNextHighestDepth()); focusBeam.removeMovieClip(); } else { yScaleSpeed += 0.2; focusBeam._yscale -= yScaleSpeed; } if (!laserCharge) { --timer2; if (timer2 <= 0) { if (!playedSound) { _root.playSound('chigeon_laser_fart', _x, _y); playedSound = true; } _root.cameraShakeTimer = 25; p = 1; while (p <= _root.nrOfPlayers) { if (hitbox.hitTest(_root['heroHitboxP' + p])) { if (this._xscale > 0) { _root.hurtHero(p, -1, 70); } else { _root.hurtHero(p, 1, 70); } } ++p; } laserBeam._alpha += (100 - laserBeam._alpha) * 0.3; laserBeam._alpha += -20 + random(40); laserBeam._y = -1 + random(3); } if (timer2 <= -80) { this._alpha -= 10; if (this._alpha <= 0) { _root[parentName].laserSequenceFinished = true; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } if (laserCharge) { _root.cameraShakeTimer = focusBeam._yscale / 40; } _root.depthSortCustomY(this, this._y + distanceOfGround); } }; } } movieClip 492 laserChargeBeam { } movieClip 495 { } movieClip 499 { } movieClip 500 { } movieClip 503 { frame 1 { stop(); } } movieClip 504 leverLever { } movieClip 506 megaHit { } movieClip 508 { } movieClip 510 { } movieClip 511 megaTeddingtonLaserImpact { frame 1 { timer = 25; _root.depthSort(this); onEnterFrame = function () { --timer; if (timer <= 0) { _alpha = _alpha - 10; if (_alpha <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } instance of movieClip 508 { onClipEvent (load) { _yscale = 0; _xscale = 0; scaleSpeed = 30; } onClipEvent (enterFrame) { _yscale = _yscale + scaleSpeed; _xscale = _yscale + scaleSpeed; scaleSpeed *= 0.9; _alpha = _alpha - 7; if (_alpha <= 0) { this.swapDepths(_parent.getNextHighestDepth()); this.removeMovieClip(); } } } instance glow of movieClip 510 { onClipEvent (load) { _rotation = _root.getAngle(_parent._x, _parent._y, _root.heroP1._x, _root.heroP1._y - 25) - 180; } onClipEvent (enterFrame) { _alpha = _alpha - 20; if (_alpha <= 0) { this.swapDepths(_parent.getNextHighestDepth()); this.removeMovieClip(); } } } } movieClip 513 { } movieClip 514 megaTeddingtonTarget { frame 1 { _root.attachMovie('teleporterGlow', 'teddingtonAimGlow', _root.getNextHighestDepth()); _root.teddingtonAimGlow._width = 15; _root.teddingtonAimGlow.onEnterFrame = function () { this._x = _root._xmouse; this._y = _root._ymouse; _root.depthSort(this); }; onEnterFrame = function () { targetIn1._rotation += 3; targetIn3._rotation = targetIn1._rotation; targetIn2._rotation = targetIn3._rotation; _x = _root._xmouse; _y = _root._ymouse; _root.depthSortCustomY(this, _root.sizeOfArea._y); if (_root.gamePause) { _root.teddingtonAimGlow._visible = false; _visible = _root.teddingtonAimGlow._visible; } else { _root.teddingtonAimGlow._visible = true; _visible = _root.teddingtonAimGlow._visible; } }; } } movieClip 516 { } movieClip 518 { } movieClip 521 { frame 1 { stop(); } } movieClip 522 mrBlueberry { frame 1 { ySpeed2 = 0; xSpeed2 = 0; ySpeed = 0; xSpeed = 0; if (zSpeed == undefined) { zSpeed = 0; } rotationSpeed = 0; body.yScaleTarget = 100; body.yScaleSpeed = 0; pauseOnGroundTimer = 10 + random(50); maxPauseOnGroundTimer = 30; health = 4; walkTargetX = this._x; walkTargetY = this._y; walkSpeed = 3; checkDistTimer = random(10); recoverTimer = 0; stickToPlayer = false; stickOnBiteTimer = 0; if (fromCombatZone == undefined) { fromCombatZone = false; } if (fromCombatZone) { ++_root.nrOfSoldiers; } onEnterFrame = function () { if (!_root.gamePause) { if (fromCombatZone || this.hitTest(_root.onScreen)) { --checkDistTimer; if (checkDistTimer <= 0) { if (_root.nrOfPlayers == 2) { if (!_root.hero2Alive || _root.getDist(this._x, this._y, _root.heroP1._x, _root.heroP1._y) < _root.getDist(this._x, this._y, _root.heroP2._x, _root.heroP2._y)) { walkTargetX = _root.heroP1._x; walkTargetY = _root.heroP1._y; } else { walkTargetX = _root.heroP2._x; walkTargetY = _root.heroP2._y; } if (!_root.hero1Alive) { walkTargetX = _root.heroP2._x; walkTargetY = _root.heroP2._y; } } else { walkTargetX = _root.heroP1._x; walkTargetY = _root.heroP1._y; } checkDistTimer = 20; } if (walkTargetX + 50 < this._x) { this.xSpeed = -walkSpeed; } else { if (walkTargetX - 50 > this._x) { this.xSpeed = walkSpeed; } else { this.xSpeed = 0; } } if (walkTargetY + 15 < this._y) { this.ySpeed = -walkSpeed * 0.8; } else { if (walkTargetY - 15 > this._y) { this.ySpeed = walkSpeed * 0.8; } else { this.ySpeed = 0; } } if (xSpeed2 != 0 || ySpeed2 != 0) { if (restrictZoneName != undefined) { if (this._x + this.hitbox._width / 2 > _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2 - this.hitbox._width / 2; this.xSpeed2 *= -0.5; this.xSpeed = this.xSpeed2; walkTargetX = this._x; } else { if (this._x - this.hitbox._width / 2 < _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2 + this.hitbox._width / 2; this.xSpeed2 *= -0.5; this.xSpeed = this.xSpeed2; walkTargetX = this._x; } } if (this._y + this.hitbox._height / 2 > _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2) { this._y = _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2 - this.hitbox._height / 2; this.ySpeed2 *= -0.5; this.ySpeed = this.ySpeed2; walkTargetY = this._x; } else { if (this._y - this.hitbox._height / 2 < _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2) { this._y = _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2 + this.hitbox._height / 2; this.ySpeed2 *= -0.5; this.ySpeed = this.ySpeed2; walkTargetY = this._x; } } if (_root[restrictZoneName].detectWalls) { wnr = 0; while (wnr < _root[restrictZoneName].wallList.length) { if (hitbox.hitTest(_root[restrictZoneName].wallList[wnr])) { if (_root[restrictZoneName].wallList[wnr].hitTest(_x - hitbox._width / 2, _y, false)) { _x = _root[restrictZoneName].wallList[wnr]._x + _root[restrictZoneName].wallList[wnr]._width / 2 + hitbox._width / 2; this.xSpeed2 *= -0.5; this.xSpeed = this.xSpeed2; walkTargetX = this._x; } else { if (_root[restrictZoneName].wallList[wnr].hitTest(_x + hitbox._width / 2, _y, false)) { _x = _root[restrictZoneName].wallList[wnr]._x - _root[restrictZoneName].wallList[wnr]._width / 2 - hitbox._width / 2; this.xSpeed2 *= -0.5; this.xSpeed = this.xSpeed2; walkTargetX = this._x; } } if (_root[restrictZoneName].wallList[wnr].hitTest(_x, _y - hitbox._height / 2, false)) { _y = _root[restrictZoneName].wallList[wnr]._y + _root[restrictZoneName].wallList[wnr]._height / 2 + hitbox._height / 2; this.ySpeed2 *= -0.5; this.ySpeed = this.ySpeed2; walkTargetY = this._y; } else { if (_root[restrictZoneName].wallList[wnr].hitTest(_x, _y + hitbox._height / 2, false)) { _y = _root[restrictZoneName].wallList[wnr]._y - _root[restrictZoneName].wallList[wnr]._height / 2 - hitbox._height / 2; this.ySpeed2 *= -0.5; this.ySpeed = this.ySpeed2; walkTargetY = this._y; } } wnr = _root[restrictZoneName].wallList.length + 1; } ++wnr; } } } } if (stickToPlayer) { _x = _root['heroP' + stickToPlayerNr]._x + stickXOffset; _y = _root['heroP' + stickToPlayerNr]._y + stickYOffset; } else { this._x += this.xSpeed2; this._y += this.ySpeed2; zSpeed += 0.7; body._y += zSpeed; body.bodyIn._rotation += rotationSpeed; shadow._width = body._width; } body.yScaleSpeed += (body.yScaleTarget - body._yscale) / 3; body.yScaleSpeed /= 1.3; body._yscale += body.yScaleSpeed; body._xscale = 200 - body._yscale; if (body._yscale < 20) { body._yscale = 20; } if (body._y > 0) { face.gotoAndStop(1); --pauseOnGroundTimer; body._y = 0; ySpeed2 = 0; xSpeed2 = 0; zSpeed = 0; body.yScaleTarget = 80; rotationSpeed = 0; if (pauseOnGroundTimer <= 0) { _root.playSound('slime_', _x, _y, 1 + random(3)); _root.playSound('blueberry_jump_', _x, _y, 1 + random(3)); rotationSpeed = xSpeed; body.yScaleTarget = 110; zSpeed = -9; xSpeed2 = xSpeed; ySpeed2 = ySpeed; pauseOnGroundTimer = maxPauseOnGroundTimer; } } --stickOnBiteTimer; if (stickToPlayer && stickOnBiteTimer <= 5) { face.gotoAndStop(2); } p = 1; while (p <= _root.nrOfPlayers) { if (body._y > -100 && !_root['heroP' + p].justHurt && hitbox.hitTest(_root['heroHitboxP' + p])) { if (recoverTimer <= 0 && stickOnBiteTimer <= 0 && zSpeed != 0) { if (!stickToPlayer) { if (_root['heroP' + p]._x < this._x) { stickXOffset = 40; body.bodyIn._rotation = 90; } else { stickXOffset = -40; body.bodyIn._rotation = -90; } stickYOffset = -5; stickToPlayerNr = p; stickToPlayer = true; } if (_root['heroP' + p]._x < this._x) { _root.hurtHero(p, 1, 4); } else { _root.hurtHero(p, -1, 4); } if (_root['hero' + p + 'health'] <= 0) { stickToPlayer = false; } body.yScaleSpeed = -50; face.gotoAndStop(1); stickOnBiteTimer = 30; } innerBody.xScaleSpeed = 70; } if (body._y > -100 && hitbox.hitTest(_root['heroAttackHitboxP' + p]) && recoverTimer <= 0) { _root.playSound('nunchuck_hit_', _x, _y, 1 + random(4)); _root.playSound('blueberry_hit_', _x, _y, 1 + random(3)); m = 0; while (m < _root['heroAttackHitboxP' + p].damageMultiplier) { if (_root['heroP' + p]._x < this._x) { this.xSpeed2 = 4; rotationSpeed = 15; _root.addVirusSplat(this._x, this._y, 3, 40, 0.2, 50, 50, 'blueberry_splat', body._y, 2.3); } else { this.xSpeed2 = -4; rotationSpeed = -15; _root.addVirusSplat(this._x, this._y, 3, 40, -0.2, 50, 50, 'blueberry_splat', body._y, 2.3); } this.zSpeed = -12; this.ySpeed2 = -3 + random(7); body.yScaleTarget = 110; face.gotoAndStop(2); _root.addMultiplier(p); _root.giveScore(p, 10); _root.addStar(_x, _y + body._y - 20, 150); health -= 1; if (health <= 0) { _root.playSound('slime_kill_', _x, _y, 1 + random(3)); m = _root['heroAttackHitboxP' + p].damageMultiplier; if (_root['heroP' + p]._x < this._x) { _root.addVirusSplat(this._x, this._y, 8, 60, 0.2, 50, 50, 'blueberry_splat', body._y, 1.9); } else { _root.addVirusSplat(this._x, this._y, 8, 60, -0.2, 50, 50, 'blueberry_splat', body._y, 1.9); } if (fromCombatZone) { --_root.nrOfSoldiers; } _root.giveScore(p, 100); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } stickToPlayer = false; stickOnBiteTimer = 60; walkSpeed += 1; maxPauseOnGroundTimer -= 10; pauseOnGroundTimer = maxPauseOnGroundTimer; recoverTimer = 20; ++m; } } ++p; } if (recoverTimer > 0) { --recoverTimer; } face._y = body._y - 25 * (100 / body._xscale); face._rotation = body.bodyIn._rotation; _root.depthSort(this); } } }; } } movieClip 526 { } movieClip 527 mullet { frame 1 { stop(); } frame 2 { ySpeed = -10; startY = _y; xSpeed = -_xscale * 0.05; distanceOfGround = 105; _root.attachMovie('shadow', _name + 'shadow', _root.getNextHighestDepth()); _root[_name + 'shadow']._x = _x; _root[_name + 'shadow']._y = startY + distanceOfGround + 10; _root[_name + 'shadow']._width = _width; _root[_name + 'shadow']._height = 10; _root.depthSortCustomY(_root[_name + 'shadow'], _root[_name + 'shadow']._y - 30); _root.depthSortCustomY(this, this._y + distanceOfGround); onEnterFrame = function () { ySpeed += 1; _rotation = _rotation + xSpeed * 3; _x = _x + xSpeed; _y = _y + ySpeed; _root[_name + 'shadow']._x = _x; _root[_name + 'shadow']._y = startY + distanceOfGround + 10; if (_y > startY + distanceOfGround) { _rotation = 0; this.gotoAndStop(3); _y = startY + distanceOfGround; this.onEnterFrame = undefined; } if (restrictZoneName != undefined) { if (this._x + this._width / 2 > _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2 - this._width / 2; } else { if (this._x - this._width / 2 < _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2 + this._width / 2; } } } }; } frame 3 { ySpeed2 = 0; xSpeed2 = 0; ySpeed = 0; xSpeed = 0; innerBody.xScaleTarget = 100; innerBody.xScaleSpeed = 0; walkTargetX = this._x; walkTargetY = this._y; walkSpeed = 2; wobbleTimer = 10; checkDistTimer = random(10); recoverTimer = 0; onEnterFrame = function () { if (this.hitTest(_root.onScreen)) { if (_root.destroyAllEggs) { _root.addHairSplat(this._x, this._y, 5 + 2 * (_xscale / 100), 100, -0.5, _width, _height); _root.addStar(_x, _y - 50, 150); _root[_name + 'shadow'].removeMovieClip(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } --checkDistTimer; if (checkDistTimer <= 0) { if (_root.nrOfPlayers == 2) { if (_root.getDist(this._x, this._y, _root.heroP1._x, _root.heroP1._y) < _root.getDist(this._x, this._y, _root.heroP2._x, _root.heroP2._y)) { walkTargetX = _root.heroP1._x; walkTargetY = _root.heroP1._y; } else { walkTargetX = _root.heroP2._x; walkTargetY = _root.heroP2._y; } } else { walkTargetX = _root.heroP1._x; walkTargetY = _root.heroP1._y; } checkDistTimer = 40 + random(40); } if (walkTargetX + 50 < this._x) { this.xSpeed = -walkSpeed; } else { if (walkTargetX - 50 > this._x) { this.xSpeed = walkSpeed; } else { this.xSpeed = 0; } } if (walkTargetY + 15 < this._y) { this.ySpeed = -walkSpeed * 0.8; } else { if (walkTargetY - 15 > this._y) { this.ySpeed = walkSpeed * 0.8; } else { this.ySpeed = 0; } } innerBody.xScaleSpeed += (innerBody.xScaleTarget - innerBody._xscale) / 2; innerBody.xScaleSpeed /= 1.3; innerBody._xscale += innerBody.xScaleSpeed; innerBody._yscale = 200 - innerBody._xscale; if (innerBody._yscale < 20) { innerBody._yscale = 20; } if (restrictZoneName != undefined) { if (this._x + this.hitbox._width / 2 > _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2 - this.hitbox._width / 2; } else { if (this._x - this.hitbox._width / 2 < _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2 + this.hitbox._width / 2; } } if (this._y + this.hitbox._height / 2 > _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2) { this._y = _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2 - this.hitbox._height / 2; } else { if (this._y - this.hitbox._height / 2 < _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2) { this._y = _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2 + this.hitbox._height / 2; } } if (_root[restrictZoneName].detectWalls) { wnr = 0; while (wnr < _root[restrictZoneName].wallList.length) { if (_root[restrictZoneName].wallList[wnr].activated && hitbox.hitTest(_root[restrictZoneName].wallList[wnr])) { if (_root[restrictZoneName].wallList[wnr].hitTest(_x - hitbox._width / 2, _y, false)) { _x = _root[restrictZoneName].wallList[wnr]._x + _root[restrictZoneName].wallList[wnr]._width / 2 + hitbox._width / 2; this.xSpeed2 = 0; this.xSpeed = 0; walkTargetX = this._x; } else { if (_root[restrictZoneName].wallList[wnr].hitTest(_x + hitbox._width / 2, _y, false)) { _x = _root[restrictZoneName].wallList[wnr]._x - _root[restrictZoneName].wallList[wnr]._width / 2 - hitbox._width / 2; this.xSpeed2 = 0; this.xSpeed = 0; walkTargetX = this._x; } } if (_root[restrictZoneName].wallList[wnr].hitTest(_x, _y - hitbox._height / 2, false)) { _y = _root[restrictZoneName].wallList[wnr]._y + _root[restrictZoneName].wallList[wnr]._height / 2 + hitbox._height / 2; this.ySpeed2 = 0; this.ySpeed = 0; walkTargetY = this._y; } else { if (_root[restrictZoneName].wallList[wnr].hitTest(_x, _y + hitbox._height / 2, false)) { _y = _root[restrictZoneName].wallList[wnr]._y - _root[restrictZoneName].wallList[wnr]._height / 2 - hitbox._height / 2; this.ySpeed2 = 0; this.ySpeed = 0; walkTargetY = this._y; } } } ++wnr; } } } if (this.xSpeed > 0) { this._xscale = 100; } else { this._xscale = -100; } this.xSpeed2 += (this.xSpeed - this.xSpeed2) * 0.1; this.ySpeed2 += (this.ySpeed - this.ySpeed2) * 0.1; this._x += this.xSpeed2; this._y += this.ySpeed2; _root[_name + 'shadow']._width = innerBody._width; _root[_name + 'shadow']._x = _x - (100 / _xscale) * 30; _root[_name + 'shadow']._y = _y; p = 1; while (p <= _root.nrOfPlayers) { if (!_root['heroP' + p].justHurt && hitbox.hitTest(_root['heroHitboxP' + p])) { if (_root['heroP' + p]._x < this._x) { _root.hurtHero(p, 1, 5); } else { _root.hurtHero(p, -1, 5); } innerBody.xScaleSpeed = 70; } if (hitbox.hitTest(_root['heroAttackHitboxP' + p])) { if (_root['heroP' + p]._x < this._x) { _root.addHairSplat(this._x, this._y, 5 + 2 * (_xscale / 100), 100, 0.5, _width, _height); } else { _root.addHairSplat(this._x, this._y, 5 + 2 * (_xscale / 100), 100, -0.5, _width, _height); } _root.addMultiplier(p); _root.giveScore(p, 50); _root.addStar(_x, _y - 50, 150); _root[_name + 'shadow'].removeMovieClip(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } ++p; } --wobbleTimer; if (wobbleTimer <= 0) { innerBody.xScaleSpeed = (Math.abs(xSpeed2) + Math.abs(ySpeed2)) * 10; wobbleTimer = 10; } _root.depthSort(this); _root.depthSortCustomY(_root[_name + 'shadow'], _root[_name + 'shadow']._y - 5); } }; } } movieClip 529 noInd { frame 1 { stop(); ySpeed = -1.5; startY = _y; _yscale = 0; _xscale = 0; _visible = false; remove = false; _root.depthSortCustomY(this, _y + 70); onEnterFrame = function () { if (!_root.gamePause) { if (_visible) { _y = _y + ySpeed; if (_y < startY) { ySpeed += 0.2; } else { ySpeed -= 0.2; } if (remove) { _yscale = _yscale + (-10 - _xscale) * 0.2; _xscale = _yscale + (-10 - _xscale) * 0.2; if (_xscale <= 0) { this._visible = false; } } else { _yscale = _yscale + (100 - _xscale) * 0.2; _xscale = _yscale + (100 - _xscale) * 0.2; } } } }; } } movieClip 531 onScreen { frame 1 { _visible = false; stop(); } } movieClip 537 p2ControlHint { frame 1 { _yscale = 0; _xscale = 0; scaleSpeed = 0; timer = 0; startTimer = false; xOffset2 = 0; xOffset = 0; scaleTarget = 100; stop(); onEnterFrame = function () { if (_root.heroP2.xSpeed2 != 0 || _root.heroP2.ySpeed2 != 0) { startTimer = true; } if (startTimer) { ++timer; } _x = _root.heroP2._x + xOffset2; _y = _root.heroP2._y - 130; if (_y < _root.gameCamera._y - 30) { _y = _root.gameCamera._y - 30; if (_root.heroP2._x < _root.gameCamera._x) { xOffset = 130; } else { xOffset = -130; } } else { xOffset = 0; } xOffset2 += (xOffset - xOffset2) * 0.2; pointer._rotation = _root.getAngle(_x, _y - 90, _root.heroP2._x, _root.heroP2._y) + 90; scaleSpeed += (scaleTarget - _yscale) * 0.25; scaleSpeed *= 0.9; _yscale = _yscale + scaleSpeed; _xscale = _yscale + scaleSpeed; if (timer > 150 || !_root.hero2Alive) { scaleTarget = 0; if (_yscale <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } } movieClip 540 progressSavedIndicator { frame 1 { _alpha = 120; onEnterFrame = function () { this.swapDepths(_parent.getNextHighestDepth()); _alpha = _alpha - 1; if (_alpha <= 0) { this.swapDepths(_parent.getNextHighestDepth()); this.removeMovieClip(); } }; } } movieClip 549 { } movieClip 550 pTeddingtonControlHint { frame 1 { _yscale = 0; _xscale = 0; scaleSpeed = 0; timer = 0; startTimer = false; xOffset2 = 0; xOffset = 0; scaleTarget = 100; rootXMousePos = _root._xmouse; stop(); onEnterFrame = function () { if (Math.abs(rootXMousePos - _root._xmouse) > 50) { startTimer = true; } if (startTimer) { ++timer; } _x = _root.heroP1._x + xOffset2; _y = _root.heroP1._y - 130; if (_y < _root.gameCamera._y - 30) { _y = _root.gameCamera._y - 30; if (_root.heroP1._x < _root.gameCamera._x) { xOffset = 130; } else { xOffset = -130; } } else { xOffset = 0; } xOffset2 += (xOffset - xOffset2) * 0.2; pointer._rotation = _root.getAngle(_x, _y - 90, _root.heroP1._x, _root.heroP1._y) + 90; scaleSpeed += (scaleTarget - _yscale) * 0.25; scaleSpeed *= 0.9; _yscale = _yscale + scaleSpeed; _xscale = _yscale + scaleSpeed; if (timer > 150 || !_root.hero1Alive) { scaleTarget = 0; if (_yscale <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } } movieClip 552 push_block_wall_collision { frame 1 { if (_name.indexOf('pushBlockWall') != 0) { _name = 'pushBlockWall' + _root.nrOfPushBlockWalls; ++_root.nrOfPushBlockWalls; } _visible = false; } } movieClip 554 { } movieClip 559 { frame 1 { stop(); } frame 3 { play(); } frame 50 { gotoAndPlay(3); } } movieClip 564 { frame 1 { stop(); } frame 9 { gotoAndStop(1); } } movieClip 565 { } movieClip 566 robot { frame 1 { this._name = 'wlkRbt' + _root.nrOfWalkRobots; ++_root.nrOfWalkRobots; body.ySpeed = 0; leg2.xSpeed = 0; leg2.ySpeed = 0; leg1.xSpeed = 0; leg1.ySpeed = 0; if (walkDir == undefined) { walkDir = -1; } lastLegLeft = false; stepTimer = 10; if (stunned == undefined) { stunned = false; } else { if (stunned) { body.displayImage.gotoAndStop(3); body.lamp.gotoAndStop(10); } } walkSpeed = 7; recoverTimer = 0; halfWidth = 25; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].squishable = true; if (leftMovement == undefined) { leftMovement = -200; rightMovement = 200; } onEnterFrame = function () { if (this.hitTest(_root.onScreen) && !_root.gamePause) { if (detectWallsInRestrictZone != undefined) { if (_root[detectWallsInRestrictZone].detectWalls) { wnr = 0; while (wnr < _root[detectWallsInRestrictZone].wallList.length) { if (_root[detectWallsInRestrictZone].wallList[wnr]._name != _root[collisionName]._name) { if (_root[detectWallsInRestrictZone].wallList[wnr].hitTest(hitbox)) { leg1.xSpeed *= -1; leg2.xSpeed *= -1; } } ++wnr; } } } if (conveyorGroup != undefined) { cg = 0; while (cg < _root[conveyorGroup].length) { if (_root[_root[conveyorGroup][cg]]._rotation == 0) { if (_root[_root[conveyorGroup][cg]].conSpeed2 > 0 || _root[_root[conveyorGroup][cg]].conSpeed2 < 0) { if (hitbox.hitTest(_root[_root[conveyorGroup][cg]])) { _x = _x + _root[_root[conveyorGroup][cg]].conSpeed2; } } } else { if (_root[_root[conveyorGroup][cg]].conSpeed2 > 0 || _root[_root[conveyorGroup][cg]].conSpeed2 < 0) { if (hitbox.hitTest(_root[_root[conveyorGroup][cg]])) { _y = _y + _root[_root[conveyorGroup][cg]].conSpeed2; } } } ++cg; } } leg1.ySpeed += 1; leg2.ySpeed += 1; _root[collisionName].extraThicknessX = -(leg1.xSpeed + leg2.xSpeed) / 2; leg1._x += leg1.xSpeed; leg1._y += leg1.ySpeed; leg2._x += leg2.xSpeed; leg2._y += leg2.ySpeed; if (!stunned) { if (body._x < leftMovement + 40 && walkDir < 0 || body._x > rightMovement - 40 && walkDir > 0) { body.lamp.play(); } --stepTimer; if (stepTimer <= 0) { if (body._x < leftMovement + 40 && walkDir < 0) { _root.playSound('robot_turn', _x, _y); walkDir = 1; body.displayImage.gotoAndStop(2); leg2.ySpeed = -6; leg1.ySpeed = -6; leg2.xSpeed = 0; leg1.xSpeed = 0; leg2._y = 0; leg1._y = 0; if (lastLegLeft) { lastLegLeft = false; } else { lastLegLeft = true; } stepTimer = 30; } else { if (body._x > rightMovement - 40 && walkDir > 0) { _root.playSound('robot_turn', _x, _y); walkDir = -1; body.displayImage.gotoAndStop(1); leg2.ySpeed = -6; leg1.ySpeed = -6; leg2.xSpeed = 0; leg1.xSpeed = 0; leg2._y = 0; leg1._y = 0; if (lastLegLeft) { lastLegLeft = false; } else { lastLegLeft = true; } stepTimer = 30; } else { if (lastLegLeft) { if (leg2._y > 0) { _root.playSound('robot_step_1', _x, _y); leg1._y = 0; leg1.ySpeed = -walkSpeed * 0.9; leg1.xSpeed = walkSpeed * walkDir; stepTimer = 30; lastLegLeft = false; } } else { if (leg1._y > 0) { _root.playSound('robot_step_2', _x, _y); leg2._y = 0; leg2.ySpeed = -walkSpeed * 0.9; leg2.xSpeed = walkSpeed * walkDir; stepTimer = 30; lastLegLeft = true; } } } } } body._rotation += ((leg1._x - leg2._x) * 0.05 - body._rotation) * 0.5; body._y += (-10 + leg1._y - (leg1._y - leg2._y) / 2 - body._y) * 0.3; } else { body.ySpeed += 1; body._y += body.ySpeed; if (body._y > 0) { body._y = 0; body.ySpeed = 0; body._rotation = 0; } } if (leg2._y > 0) { leg2._y = 0; leg2.ySpeed = 0; leg2.xSpeed = 0; } if (leg2._x < body._x - halfWidth) { leg2._x = body._x - halfWidth; leg2.xSpeed = 0; } if (leg2._x > body._x + halfWidth) { leg2._x = body._x + halfWidth; leg2.xSpeed = 0; } if (leg1._x < body._x - halfWidth) { leg1._x = body._x - halfWidth; leg1.xSpeed = 0; } if (leg1._x > body._x + halfWidth) { leg1._x = body._x + halfWidth; leg1.xSpeed = 0; } if (leg1._y > 0) { leg1._y = 0; leg1.ySpeed = 0; leg1.xSpeed = 0; } hitbox._x = leg1._x - (leg1._x - leg2._x) / 2; body._x = hitbox._x; shadow._x = body._x; _root[collisionName]._x = _x + hitbox._x; p = 1; while (p <= _root.nrOfPlayers) { if (hitbox.hitTest(_root['heroAttackHitboxP' + p]) && recoverTimer <= 0) { if (!stunned) { _root.playSound('box_hit_', _x, _y, 1 + random(4)); _root.playSound('robot_hit', _x, _y); leg2.ySpeed = -9; leg1.ySpeed = -9; leg2.xSpeed = 0; leg1.xSpeed = 0; body.ySpeed = -8; body.displayImage.gotoAndStop(3); body.lamp.gotoAndStop(10); stunned = true; } else { _root.playSound('box_hit_', _x, _y, 1 + random(4)); _root.playSound('robot_turn', _x, _y); if (walkDir < 0) { walkDir = 1; body.displayImage.gotoAndStop(2); } else { walkDir = -1; body.displayImage.gotoAndStop(1); } if (lastLegLeft) { lastLegLeft = false; } else { lastLegLeft = true; } body.lamp.gotoAndStop(1); leg2.ySpeed = -6; leg1.ySpeed = -6; leg2.xSpeed = 0; leg1.xSpeed = 0; stepTimer = 30; stunned = false; } _root.addStar(_x + body._x, _y - 50, 150); recoverTimer = 30; } ++p; } if (recoverTimer > 0) { --recoverTimer; } _root.depthSort(this); } }; } } movieClip 568 scoreBonusLife { } movieClip 572 securityHat { frame 1 { stop(); } frame 2 { ySpeed = -10; startY = _y; xSpeed = -_xscale * 0.05; distanceOfGround = 105; _root.attachMovie('shadow', _name + 'shadow', _root.getNextHighestDepth()); _root[_name + 'shadow']._x = _x; _root[_name + 'shadow']._y = startY + distanceOfGround + 10; _root[_name + 'shadow']._width = _width; _root[_name + 'shadow']._height = 10; _root.depthSortCustomY(_root[_name + 'shadow'], _root[_name + 'shadow']._y - 30); _root.depthSortCustomY(this, this._y + distanceOfGround); onEnterFrame = function () { if (!_root.gamePause) { ySpeed += 1; _rotation = _rotation + xSpeed; _x = _x + xSpeed; _y = _y + ySpeed; _root[_name + 'shadow']._x = _x; _root[_name + 'shadow']._y = startY + distanceOfGround + 10; if (_y > startY + distanceOfGround) { _rotation = 165 * -(100 / _xscale); this.gotoAndStop(3); _y = startY + distanceOfGround; this.onEnterFrame = undefined; } if (restrictZoneName != undefined) { if (this._x + this._width / 2 > _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2 - this._width / 2; } else { if (this._x - this._width / 2 < _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2 + this._width / 2; } } } } }; } } movieClip 574 { } movieClip 576 { } movieClip 577 shadowLong { } movieClip 580 shrimpHat { frame 1 { stop(); } frame 2 { ySpeed = -10; startY = _y; xSpeed = -_xscale * 0.05; distanceOfGround = 105; _root.attachMovie('shadow', _name + 'shadow', _root.getNextHighestDepth()); _root[_name + 'shadow']._x = _x; _root[_name + 'shadow']._y = startY + distanceOfGround + 10; _root[_name + 'shadow']._width = _width; _root[_name + 'shadow']._height = 10; _root.depthSortCustomY(_root[_name + 'shadow'], _root[_name + 'shadow']._y - 30); _root.depthSortCustomY(this, this._y + distanceOfGround); onEnterFrame = function () { if (!_root.gamePause) { ySpeed += 1; _rotation = _rotation + xSpeed; _x = _x + xSpeed; _y = _y + ySpeed; _root[_name + 'shadow']._x = _x; _root[_name + 'shadow']._y = startY + distanceOfGround + 10; if (_y > startY + distanceOfGround) { _rotation = 165 * -(100 / _xscale); this.gotoAndStop(3); _y = startY + distanceOfGround; this.onEnterFrame = undefined; } if (restrictZoneName != undefined) { if (this._x + this._width / 2 > _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2 - this._width / 2; } else { if (this._x - this._width / 2 < _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2 + this._width / 2; } } } } }; } } movieClip 581 { } movieClip 582 smash_star { frame 1 { this._rotation = random(90); i = 0; while (i <= 6) { this['starIn' + i]._alpha = 50 + 2 * i; ++i; } deleteTimer = 10; onEnterFrame = function () { if (!_root.gamePause) { i = 1; while (i <= 6) { this['starIn' + i]._yscale -= 20; this['starIn' + i]._xscale = this['starIn' + i]._yscale; this['starIn' + i]._alpha -= 20; if (this['starIn' + i]._xscale <= 0) { this['starIn' + i].swapDepths(this.getNextHighestDepth()); this['starIn' + i].removeMovieClip(); } ++i; } --deleteTimer; if (deleteTimer <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } } movieClip 584 smokeBall { } movieClip 593 { } movieClip 598 { frame 1 { stop(); } } movieClip 603 { frame 1 { stop(); } } movieClip 611 { frame 1 { stop(); } } movieClip 616 { frame 1 { stop(); } } movieClip 621 { frame 1 { stop(); } } movieClip 624 { instance hat of movieClip 580 shrimpHat { onClipEvent (load) { linkageName = 'shrimpHat'; _parent._parent.dropHat = true; } } instance hat of movieClip 572 securityHat { onClipEvent (load) { linkageName = 'securityHat'; _parent._parent.dropHat = true; } } instance hat of movieClip 527 mullet { onClipEvent (load) { linkageName = 'mullet'; _parent._parent.dropHat = true; } onClipEvent (enterFrame) { _rotation = Math.abs(_parent._parent.xSpeed) * 2; } } instance hat of movieClip 213 fishHat { onClipEvent (load) { linkageName = 'fishHat'; _parent._parent.dropHat = true; } } instance hat of movieClip 572 securityHat { onClipEvent (load) { linkageName = 'securityHat'; _parent._parent.dropHat = true; } } } movieClip 634 { } movieClip 642 { instance swoosh of movieClip 307 { onClipEvent (load) { _alpha = 0; } } } movieClip 643 { } movieClip 644 soldier { frame 1 { if (sType == undefined) { sType = 1 + random(4); } if (sType == 1) { speed = 3; attackSpeed = 7; attackFrequency = 8; hitsBeforeKickBack = 4; playerDamage = 4; health = 60; sendNextSoldierAt = 30; hatDropChance = 3; displayFrame = 7; } else { if (sType == 2) { speed = 3.5; attackSpeed = 7; attackFrequency = 7; hitsBeforeKickBack = 4; playerDamage = 5; health = 60; sendNextSoldierAt = 30; hatDropChance = 3; displayFrame = 3; } else { if (sType == 3) { speed = 2; attackSpeed = 7; attackFrequency = 8; hitsBeforeKickBack = 4; playerDamage = 6; health = 80; sendNextSoldierAt = 50; hatDropChance = 60; displayFrame = 5; } else { if (sType == 4) { speed = 6; attackSpeed = 9; attackFrequency = 4; hitsBeforeKickBack = 3; playerDamage = 6; health = 50; sendNextSoldierAt = 30; hatDropChance = 20; displayFrame = 4; } else { if (sType == 5) { speed = 5; attackSpeed = 9; attackFrequency = 5; hitsBeforeKickBack = 3; playerDamage = 8; health = 90; sendNextSoldierAt = 70; hatDropChance = 15; displayFrame = 2; } else { if (sType == 6) { speed = 6; attackSpeed = 10; attackFrequency = 4; hitsBeforeKickBack = 2; playerDamage = 12; health = 100; sendNextSoldierAt = 90; hatDropChance = 3; displayFrame = 6; } else { if (sType == 7) { speed = 7; attackSpeed = 10; attackFrequency = 4; hitsBeforeKickBack = 2; playerDamage = 12; health = 100; sendNextSoldierAt = 90; hatDropChance = 3; displayFrame = 1; } } } } } } } if (conveyorGroup != undefined) { if (sType != 3) { hatDropChance = -1; } } lowerBody.gotoAndStop(displayFrame); midBody.gotoAndStop(displayFrame); upperBody.gotoAndStop(displayFrame); sword.innerSword.gotoAndStop(displayFrame); lowerBody.zSpeed = 0; upperBody.zSpeed = 0; upperBody.startY = upperBody._y; upperBody.rotationSpeed = 0; targetX = _root.heroP1._x; targetY = _root.heroP1._y; targetAngle = _root.getAngle(_x, _y, targetX, targetY); targetDist = 100; closestHero = 1; ySpeed2 = 0; ySpeed = 0; xSpeed2 = 0; xSpeed = 0; ranXOffset = -30 + random(90); ranYOffset = -80 + random(160); sword.targetRotation = 25; sword._rotation = sword.targetRotation; attackTimer = 5; attackHitbox._width = 100; attacking = false; recoverTimer = 0; attack = false; sendAnotherSoldier = false; startXScale = _xscale; if (countedSoldier == undefined) { countedSoldier = false; } if (signalName == undefined) { activated = true; } else { attack = true; _root.depthSort(this); activated = _root[signalName]; } if (hatOff == undefined) { hatOff = false; } checkDistTimer = 0; if (faceLeft) { _xscale = -startXScale; } if (fromCombatZone == undefined) { fromCombatZone = false; } playedFootstepSound = true; nrOfHitsTaken = 0; kickedBack = false; kickBackAttackTimer = 45 + random(45); onScreen = false; if (playIdleAnim) { idleAnimRotTarget = -10 + random(20); idleAnimTimer = random(45); } onEnterFrame = function () { if (!_root.gamePause) { if (signalName != undefined) { activated = _root[signalName]; } onScreen = _root.onScreen.hitTest(this); if (activated && fromCombatZone || activated && onScreen) { --checkDistTimer; if (finalBoss) { if (_root.destroyAllEggs) { health = 0; } } if (_root.nrOfPlayers == 2 && checkDistTimer <= 0) { closestHero = 1; if (_root.getDist(_x, _y, _root.heroP2._x, _root.heroP2._y) < _root.getDist(_x, _y, _root.heroP1._x, _root.heroP1._y)) { closestHero = 2; } if (!_root.hero2Alive) { closestHero = 1; } else { if (!_root.hero1Alive) { closestHero = 2; } else { if (!_root.hero2Alive && !_root.hero1Alive) { attack = false; closestHero = 0; } } } checkDistTimer = 15; } if (!countedSoldier) { ++_root.nrOfSoldiers; countedSoldier = true; } if (!sendAnotherSoldier && _root.makeSoldierAttack) { attack = true; _root.makeSoldierAttack = false; } if (kickedBack) { --kickBackAttackTimer; if (_root['heroP' + closestHero]._xscale == _xscale) { kickBackAttackTimer -= 2; } if (kickBackAttackTimer <= 0) { attack = true; kickBackAttackTimer = 45 + random(45); kickedBack = false; } } if (attack) { upperBody.face.gotoAndStop(2); speed = attackSpeed; if (_root['heroP' + closestHero]._x < _x) { targetX = _root['heroP' + closestHero]._x + targetDist; _xscale = -startXScale; } else { targetX = _root['heroP' + closestHero]._x - targetDist; _xscale = startXScale; } targetY = _root['heroP' + closestHero]._y; } else { if (_root['heroP' + closestHero]._x < _x) { targetX = _root['heroP' + closestHero]._x + 250 + ranXOffset; _xscale = -startXScale; } else { targetX = _root['heroP' + closestHero]._x - 250 - ranXOffset; _xscale = startXScale; } if (ySpeed2 == 0) { targetY = this._y; } targetY = _root['heroP' + closestHero]._y - ranYOffset; } targetAngle = _root.getAngle(_x, _y, targetX, targetY); if (_root.getDist(_x, _y, targetX, targetY) > 10) { xSpeed2 = Math.sin((targetAngle - 90) * 0.0174532925199433) * speed; ySpeed2 = -Math.cos((targetAngle - 90) * 0.0174532925199433) * speed; if (!attacking && _root.getDist(_x, _y, _root['heroP' + closestHero]._x, _root['heroP' + closestHero]._y) > targetDist) { attackTimer = attackFrequency; } } else { ySpeed2 = 0; xSpeed2 = 0; } if (conveyorGroup != undefined) { cg = 0; while (cg < _root[conveyorGroup].length) { if (_root[_root[conveyorGroup][cg]]._rotation == 0) { if (hitbox.hitTest(_root[_root[conveyorGroup][cg]])) { _x = _x + _root[_root[conveyorGroup][cg]].conSpeed2; } } else { if (hitbox.hitTest(_root[_root[conveyorGroup][cg]])) { _y = _y + _root[_root[conveyorGroup][cg]].conSpeed2; } } ++cg; } } xSpeed += (xSpeed2 - xSpeed) * 0.4; ySpeed += (ySpeed2 - ySpeed) * 0.4; _x = _x + xSpeed; _y = _y + ySpeed; if (attack) { --attackTimer; } if (attackTimer > 0) { attacking = false; sword.xOffset *= 0.6; sword.yOffset *= 0.6; sword._rotation += (sword.targetRotation - sword._rotation) * 0.6; sword.innerSword._rotation += -sword.innerSword._rotation * 0.6; attackHitbox.gotoAndStop(2); } else { attacking = true; attackHitbox.gotoAndStop(1); p = 1; while (p <= _root.nrOfPlayers) { if (attackHitbox.hitTest(_root['heroHitboxP' + p])) { if (_x > _root['heroHitboxP' + p]._x) { _root.hurtHero(p, 1, playerDamage); } else { _root.hurtHero(p, -1, playerDamage); } } ++p; } sword.innerSword.swoosh._alpha = 100; sword.xOffset = 15; sword.yOffset = 30; if (attackTimer < 0) { sword.innerSword._rotation = 80; } if (attackTimer < -2) { attackTimer = attackFrequency; } } --recoverTimer; if (recoverTimer <= 0) { p = 1; while (p <= _root.nrOfPlayers) { if (_root['heroAttackHitboxP' + p].hitTest(hitbox)) { _root.playSound('nunchuck_hit_', _x, _y, 1 + random(4)); _root.playSound('bear_hit_', _x, _y, 1 + random(5)); m = 0; while (m < _root['heroAttackHitboxP' + p].damageMultiplier) { if (_x > _root['heroHitboxP' + p]._x) { xDir = -1; } else { xDir = 1; } if (!finalBoss) { _root.addMultiplier(p); _root.giveScore(p, 10); } if (dropHat && !hatOff && random(100) < hatDropChance) { newHat = 'HAT' + _root.getNextHighestDepth(); _root.attachMovie(upperBody.hat.linkageName, newHat, _root.getNextHighestDepth()); _root[newHat]._x = _x + (upperBody._x + upperBody.hat._x) * (_xscale / startXScale); _root[newHat]._y = _y + upperBody._y + upperBody.hat._y; _root[newHat]._xscale = _xscale; if (restrictZoneName != undefined) { _root[newHat].restrictZoneName = restrictZoneName; } _root[newHat]._rotation = upperBody.hat._rotation * (_xscale / startXScale); _root[newHat].gotoAndStop(2); upperBody.hat.swapDepths(upperBody.hat.getNextHighestDepth()); upperBody.hat.removeMovieClip(); hatOff = true; } _root.addStar(_x, _y - 50, 150 + _root['heroAttackHitboxP' + p].damageMultiplier * 10); health -= 10; if (health <= 0) { if (!finalBoss) { _root.giveScore(p, 100); } if (!sendAnotherSoldier) { _root.makeSoldierAttack = true; } m = _root['heroAttackHitboxP' + p].damageMultiplier; } attack = true; closestHero = p; upperBody._rotation = 80; ++nrOfHitsTaken; if (fromCombatZone) { if (nrOfHitsTaken == hitsBeforeKickBack || nrOfHitsTaken == hitsBeforeKickBack * 2 || nrOfHitsTaken == hitsBeforeKickBack * 3) { xSpeed2 = -60 * xDir; xSpeed = xSpeed2; upperBody.zSpeed = -10; lowerBody.zSpeed = -12; kickedBack = true; ranYOffset = -80 + random(160); attack = false; } else { xSpeed = -20 * xDir; } } else { xSpeed = -20 * xDir; } attackTimer = attackFrequency; recoverTimer = 5; ++m; } } ++p; } } else { upperBody.face.gotoAndStop(3); } if (health <= 0) { --_root.nrOfSoldiers; this.xSpeed = (-6 - random(3)) * xDir; this.ySpeed = -10 - random(5); this.startY = _y; this.midBody._visible = false; this.upperBody._rotation = 0; this.upperBody.rotationSpeed = -3 - random(35) * 0.1; this.upperBody.face.gotoAndStop(3); this.healthBar._visible = false; this.onEnterFrame = function () { if (!_root.gamePause) { this.ySpeed += 1.4; this._x += this.xSpeed; this._y += this.ySpeed; this.upperBody._rotation -= this.upperBody.rotationSpeed; this.lowerBody._rotation += this.upperBody.rotationSpeed * 1.5; if (this.upperBody._rotation > this.lowerBody._rotation + 40) { this.upperBody._rotation = this.lowerBody._rotation + 40; } else { if (this.upperBody._rotation < this.lowerBody._rotation - 40) { this.upperBody._rotation = this.lowerBody._rotation - 40; } } this.lowerBody._x = this.upperBody._x; this.lowerBody._y = this.upperBody._y; _root.moveInDir(this.lowerBody, this.lowerBody._rotation, -46); this.sword._rotation += this.upperBody.rotationSpeed * 0.3; this.sword.innerSword._rotation -= this.upperBody.rotationSpeed * 0.9; this.shadow._y = this.startY - this._y; if (!this.touchedWall) { if (restrictZoneName == undefined) { w = 0; while (w < _root.nrOfWalls) { if (_root['wall' + w].hitTest(this.hitbox)) { this.xSpeed *= -1; this.upperBody.rotationSpeed *= -1.5; this.touchedWall = true; } ++w; } } else { if (this._x + this.hitbox._width / 2 > _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2 - this.hitbox._width / 2; this.touchedWall = true; this.xSpeed = 0; } else { if (this._x - this.hitbox._width / 2 < _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2 + this.hitbox._width / 2; this.touchedWall = true; this.xSpeed = 0; } } if (_root[restrictZoneName].detectWalls) { wnr = 0; while (wnr < _root[restrictZoneName].wallList.length) { if (_root[restrictZoneName].wallList[wnr].hitTest(this.hitbox)) { this.xSpeed *= -1; this.upperBody.rotationSpeed *= -1.5; this.touchedWall = true; } ++wnr; } } } } if (this._y + lowerBody._y / 2 > this.startY) { _root.playSound('bear_popped_', _x, _y, 1 + random(4)); _root.addStar(this._x, this._y - 60, 200); _root.addButterflies(this._x, this._y, 6 + random(3)); _root.addSmoke(this._x, this._y - 50); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } else { if (health <= sendNextSoldierAt) { if (!sendAnotherSoldier) { _root.makeSoldierAttack = true; sendAnotherSoldier = true; } } } sword.innerSword.swoosh._alpha *= 0.6; sword._x = sword.xOffset; sword._y = sword.yOffset; lowerBody.zSpeed += 2; lowerBody._y += lowerBody.zSpeed; if (lowerBody._y > 0) { lowerBody._y = 0; if (!playedFootstepSound) { _root.playSound('footstep_', _x, _y, 6); playedFootstepSound = true; } lowerBody.zSpeed = 0; if (xSpeed2 != 0 || ySpeed2 != 0) { playedFootstepSound = false; lowerBody.zSpeed = -8; } } upperBody.rotationSpeed += -upperBody._rotation / 2; upperBody.rotationSpeed /= 1.3; upperBody._rotation += upperBody.rotationSpeed; upperBody.zSpeed += (lowerBody._y + upperBody.startY - upperBody._y) / 2; upperBody.zSpeed /= 1.9; upperBody._y += upperBody.zSpeed; if (upperBody._y > upperBody.startY + lowerBody._y + 3) { upperBody._y = upperBody.startY + lowerBody._y + 3; } midBody._y = lowerBody._y - 27; midBody._height = -(upperBody._y - midBody._y); if (restrictZoneName == undefined) { w = 0; while (w < _root.nrOfWalls) { _root.soldierWallCollision(_root['wall' + w], this, this.hitbox); ++w; } } else { if (this._x + this.hitbox._width / 2 > _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2 - this.hitbox._width / 2; } else { if (this._x - this.hitbox._width / 2 < _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2 + this.hitbox._width / 2; } } if (this._y + this.hitbox._height / 2 > _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2) { this._y = _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2 - this.hitbox._height / 2; } else { if (this._y - this.hitbox._height / 2 < _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2) { this._y = _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2 + this.hitbox._height / 2; } } if (_root[restrictZoneName].detectWalls) { wnr = 0; while (wnr < _root[restrictZoneName].wallList.length) { _root.soldierWallCollision(_root[restrictZoneName].wallList[wnr], this, this.hitbox); ++wnr; } } } _root.depthSort(this); } else { if (countedSoldier) { --_root.nrOfSoldiers; countedSoldier = false; } } if (!activated && onScreen && playIdleAnim) { ++idleAnimTimer; upperBody._rotation += (idleAnimRotTarget - upperBody._rotation) * 0.2; if (idleAnimTimer > 150) { if (random(2) == 1) { idleAnimRotTarget = -15 + random(25); } else { _xscale = _xscale * -1; } idleAnimTimer = random(45); } } if (!activated && onScreen && _root.megaTeddington) { if (_root.heroAttackHitboxP1.hitTest(hitbox)) { _root[signalName] = true; activated = true; } } } }; } } movieClip 646 { } movieClip 648 { } movieClip 650 { } movieClip 651 spawnBeam { frame 1 { _root.addSmoke(_x, _y); _root.addSmoke(_x, _y); _root.cameraShakeTimer = 40 * (_xscale / 100); bottom._alpha = 200; beam._alpha = 200; brightLight._alpha = 150; bottom._xscale = 150; bottom._yscale = 150; beam._xscale = 150; onEnterFrame = function () { if (!_root.gamePause) { brightLight._alpha -= 5; bottom._alpha -= 12; beam._alpha = bottom._alpha; bottom._xscale -= 10; bottom._yscale = bottom._xscale; beam._xscale = bottom._xscale; if (brightLight._alpha <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } } movieClip 653 { } movieClip 655 { } movieClip 656 { } movieClip 657 { } movieClip 661 { frame 1 { stop(); if (_root.nrOfPlayers == 2) { this.gotoAndStop(2); } } } movieClip 663 { frame 1 { stop(); } } movieClip 665 { } movieClip 666 speechBubble { frame 1 { var sepText = new Array(); lastSep = 0; curText = 0; c = 0; while (c <= inputText.length) { if (inputText.charAt(c) == '|' || c == inputText.length) { sepText.push(inputText.slice(lastSep, c)); lastSep = c + 1; } ++c; } skipTimer = 10 + sepText[curText].length * 0.3; speechText.speechText.autoSize = true; speechText.speechText.text = sepText[curText]; if (gibberishVoice != undefined) { _root.playGibberishSound(gibberishVoice, sepText[curText].length * 40); } if (speechText._width > 650) { speechText._width = 650; speechText._yscale = speechText._xscale; } speechText._x = -speechText._width / 2; middle._width = speechText._width; left._x = middle._x - middle._width / 2; right._x = middle._x + middle._width / 2; _yscale = _root.gameCamera._xscale; _xscale = _root.gameCamera._xscale; if (xPos > _x) { _x = xPos - (middle._width / 2) * (_xscale / 100); } else { _x = xPos + (middle._width / 2) * (_xscale / 100); } _y = yPos - 100 * (_xscale / 100); if (_x - middle._width * (_xscale / 100) / 2 < _root.gameCamera._x - _root.gameCamera._width / 2.5) { _x = middle._width * (_xscale / 100) / 2 + _root.gameCamera._x - _root.gameCamera._width / 2.5; } else { if (_x + middle._width * (_xscale / 100) / 2 > _root.gameCamera._x + _root.gameCamera._width / 2.5) { _x = _root.gameCamera._x + _root.gameCamera._width / 2.5 - middle._width * (_xscale / 100) / 2; } } if (_y < _root.gameCamera._y - _root.gameCamera._height / 3) { _y = _root.gameCamera._y - _root.gameCamera._height / 3; } else { if (_y > _root.gameCamera._y + _root.gameCamera._height / 3) { _y = _root.gameCamera._y + _root.gameCamera._height / 3; } } pointer.pointerIn._height = (_root.getDist(_x, _y, xPos, yPos) - 40) * (100 / _xscale); pointer._rotation = _root.getAngle(_x, _y, xPos, yPos) + 90; buttonPrompt._x = right._x + 25; skipTextButtonDown = true; offScreenTimer = 60; if (!allowSkip) { buttonPrompt._visible = false; } _root.depthSortCustomY(this, _root.sizeOfArea._y + _root.sizeOfArea._height + _y / 100); onEnterFrame = function () { if (!_root.gamePause) { _yscale = _root.gameCamera._xscale; _xscale = _root.gameCamera._xscale; if (timeVisible != undefined) { --timeVisible; if (timeVisible <= 0) { _root.removeSpeechBubble(); } } --skipTimer; if (allowSkip && skipTimer <= 0) { buttonPrompt.gotoAndStop(2); skipTextButton = false; p = 1; while (p <= _root.nrOfPlayers) { if (_root['kAttackP' + p]) { skipTextButton = true; } ++p; } if (skipTextButton) { if (!skipTextButtonDown) { ++curText; if (curText >= sepText.length) { _root.releasedAttackButtonAfterSpeechBubble = false; p = 1; while (p <= _root.nrOfPlayers) { _root['kAttackDownP' + p] = true; ++p; } if (gibberishVoice != undefined) { _root.stopGibberishSound(gibberishVoice); } this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } speechText.speechText.text = sepText[curText]; if (gibberishVoice != undefined) { _root.playGibberishSound(gibberishVoice, sepText[curText].length * 40); } speechText._yscale = 100; speechText._xscale = 100; if (speechText._width > 650) { speechText._width = 650; speechText._yscale = speechText._xscale; } speechText._x = -speechText._width / 2; middle._width = speechText._width; left._x = middle._x - middle._width / 2; right._x = middle._x + middle._width / 2; if (xPos > _x) { _x = xPos - (middle._width / 2) * (_xscale / 100); } else { _x = xPos + (middle._width / 2) * (_xscale / 100); } skipTimer = 10 + sepText[curText].length * 0.3; buttonPrompt.gotoAndStop(1); skipTextButtonDown = true; } } else { skipTextButtonDown = false; } } if (xPos > _x) { _x = _x + (xPos - (middle._width / 2) * (_xscale / 100) - _x) * 0.2; } else { _x = _x + (xPos + (middle._width / 2) * (_xscale / 100) - _x) * 0.2; } _y = _y + (yPos - 100 * (_xscale / 100) - _y) * 0.2; if (_x - middle._width * (_xscale / 100) / 2 < _root.gameCamera._x - _root.gameCamera._width / 2.5) { _x = middle._width * (_xscale / 100) / 2 + _root.gameCamera._x - _root.gameCamera._width / 2.5; } else { if (_x + middle._width * (_xscale / 100) / 2 > _root.gameCamera._x + _root.gameCamera._width / 2.5) { _x = _root.gameCamera._x + _root.gameCamera._width / 2.5 - middle._width * (_xscale / 100) / 2; } } if (_y < _root.gameCamera._y - _root.gameCamera._height / 3) { _y = _root.gameCamera._y - _root.gameCamera._height / 3; } else { if (_y > _root.gameCamera._y + _root.gameCamera._height / 3) { _y = _root.gameCamera._y + _root.gameCamera._height / 3; } } buttonPrompt._x = right._x + 25; if (!_root.onScreen.hitTest(xPos, yPos, false)) { --offScreenTimer; if (offScreenTimer <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } else { offScreenTimer = 60; } pointer.pointerIn._height = (_root.getDist(_x, _y, xPos, yPos) - 40) * (100 / _xscale); pointer._rotation = _root.getAngle(_x, _y, xPos, yPos) + 90; } }; } } movieClip 668 teleporterEffect { frame 1 { _root.depthSortCustomY(this, _y + 40); } } movieClip 670 teleporterGlow { } movieClip 672 { } movieClip 676 { } movieClip 678 { } movieClip 681 { frame 1 { stop(); } } movieClip 682 { } movieClip 683 undergroundWorm { frame 1 { this._name = 'UGW' + _root.nrOfUndergroundWorms; ++_root.nrOfUndergroundWorms; if (random(2) == 1) { rotSpeed = -1; } else { rotSpeed = 1; } recoverTimer = 5; aboveGroundTimer = 90 + random(20); if (health == undefined) { health = 100; } body.heightSpeed = 0; body.heightTarget = body._height; body._height = 0; head._y = 0; p = 1; while (p <= _root.nrOfPlayers) { if (_root['heroHitboxP' + p].hitTest(this.hitbox)) { if (_root['heroP' + p]._x < this._x) { _root.hurtHero(p, 1, 30); } else { _root.hurtHero(p, -1, 30); } } ++p; } _root.depthSortCustomY(this, this._y + 25); this.head.eyes.startX = this.head.eyes._x; this.head.eyes.startY = this.head.eyes._y; this.head.eyes.gotoAndStop(1); onEnterFrame = function () { if (!_root.gamePause) { this._rotation += this.rotSpeed; if (this._rotation < -5) { this.rotSpeed += 0.1; } else { if (this._rotation > 5) { this.rotSpeed -= 0.1; } } if (this._rotation < -10) { this._rotation += (-10 - this._rotation) * 0.2; } else { if (this._rotation > 10) { this._rotation += (10 - this._rotation) * 0.2; } } if (this.recoverTimer > 0) { --this.recoverTimer; } else { this.head.eyes.gotoAndStop(1); p = 1; while (p <= _root.nrOfPlayers) { if (_root['heroHitboxP' + p].hitTest(this.hitbox)) { if (_root['heroP' + p]._x < this._x) { _root.hurtHero(p, 1, 30); } else { _root.hurtHero(p, -1, 30); } } if (_root['heroAttackHitboxP' + p].hitTest(this.hitbox)) { _root.playSound('nunchuck_hit_', _x, _y, 1 + random(4)); _root.playSound('bear_hit_', _x, _y, 1 + random(5)); m = 0; while (m < _root['heroAttackHitboxP' + p].damageMultiplier) { if (_root['heroP' + p]._x < this._x) { this.rotSpeed = 3; this._rotation += 3; } else { this.rotSpeed = -3; this._rotation -= 3; } _root.addMultiplier(p); _root.giveScore(p, 20); this.body.heightSpeed = 20; this.recoverTimer = 5; this.health -= 3; if (this.health <= 0) { _root.playSound('bear_popped_', _x, _y, 1 + random(4)); _root.giveScore(p, 500); _root.cameraShakeTimer = 30; _root.addButterflies(this._x, this._y, 10); _root.addSmoke(this._x, this._y); ++_root.nrOfUndergroundWormsKilled; m = _root['heroAttackHitboxP' + p].damageMultiplier; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } this.head.eyes.gotoAndStop(2); _root.addStar(this._x, this._y, 200); ++m; } this.aboveGroundTimer -= 20; } ++p; } } --this.aboveGroundTimer; if (this.aboveGroundTimer == 0) { this.body.heightSpeed = 30; } else { if (this.aboveGroundTimer <= -7) { this.body.heightTarget = 0; } } if (aboveGroundTimer <= 0 && this.body._height + this.body.heightSpeed <= 0) { _root.addSmoke(this._x, this._y); _root.attachMovie('undergroundWormBump', 'UGWB' + this._name, _root.getNextHighestDepth()); _root['UGWB' + this._name]._x = _x; _root['UGWB' + this._name]._y = _y; _root['UGWB' + this._name].health = this.health; _root['UGWB' + this._name].restrictZoneName = this.restrictZoneName; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } this.body.heightSpeed += (this.body.heightTarget - (100 - this.health) - this.body._height) / 5; this.body.heightSpeed /= 1.2; this.body._height += this.body.heightSpeed; this.head._y = -this.body._height; closestPlayer = 1; if (_root.nrOfPlayers == 2) { if (!_root.hero1Alive || _root.getDist(_root.heroP1._x, _root.heroP1._y, this._x, this._y) > _root.getDist(_root.heroP2._x, _root.heroP2._y, this._x, this._y)) { closestPlayer = 2; } } playerAngle = _root.getAngle(_x, _y, _root['heroP' + closestPlayer]._x, _root['heroP' + closestPlayer]._y); this.head.head._rotation = playerAngle + 180; this.head.antennas._rotation = -_rotation * 1.1; this.head.eyes._x = this.head.eyes.startX; this.head.eyes._y = this.head.eyes.startY; _root.moveInDir(this.head.eyes, playerAngle - 90, 10); } }; } instance of movieClip 240 healthBar { onClipEvent (load) { maxHealth = 100; adjustRotation = true; } } } movieClip 685 undergroundWormBump { frame 1 { hero1Dist = _root.getDist(_root.heroP1._x, _root.heroP1._y, this._x, this._y); if (_root.nrOfPlayers == 2) { hero2Dist = _root.getDist(_root.heroP2._x, _root.heroP2._y, this._x, this._y); } closestHero = 1; if (_root.nrOfPlayers == 2) { if (hero1Dist > hero2Dist) { closestHero = 2; } } moveDir = _root.getAngle(this._x, this._y, _root['heroP' + closestHero]._x, _root['heroP' + closestHero]._y) + 90; moveDirSpeed = 3; speed = 3; if (timer == undefined) { timer = 90; } if (activated == undefined) { activated = true; } if (makeHeadAppear == undefined) { makeHeadAppear = false; } _visible = false; m = 0; while (m <= 15) { _root.attachMovie('undergroundWormEarthBit', 'EARTHBIT' + _name + m, _root.getNextHighestDepth()); _root['EARTHBIT' + _name + m].followName = this._name; _root['EARTHBIT' + _name + m]._x = this._x - 30 + random(60); _root['EARTHBIT' + _name + m]._y = this._y - 30 + random(60); _root['EARTHBIT' + _name + m]._yscale = 70 - _root.getDist(_root['EARTHBIT' + _name + m]._x, _root['EARTHBIT' + _name + m]._y, _root[_root['EARTHBIT' + _name + m].followName]._x, _root[_root['EARTHBIT' + _name + m].followName]._y); _root['EARTHBIT' + _name + m]._xscale = _root['EARTHBIT' + _name + m]._yscale; _root['EARTHBIT' + _name + m].timer = 90; _root.depthSort(_root['EARTHBIT' + _name + m]); _root['EARTHBIT' + _name + m].onEnterFrame = function () { if (!_root.gamePause) { if (_root[this.followName] == undefined) { --this.timer; } if (this.timer <= 0) { this._yscale -= 1; this._xscale = this._yscale; if (this._xscale <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } else { if (_root[this.followName] != undefined) { this._yscale = 70 - _root.getDist(this._x, this._y, _root[this.followName]._x, _root[this.followName]._y); this._xscale = this._yscale; if (this._xscale <= 0) { this._x = _root[this.followName]._x - 30 + random(60); this._y = _root[this.followName]._y - 30 + random(60); } } } _root.depthSort(this); } }; ++m; } onEnterFrame = function () { if (!_root.gamePause) { if (activated && this.hitTest(_root.onScreen)) { hero1Dist = _root.getDist(_root.heroP1._x, _root.heroP1._y, this._x, this._y); if (_root.nrOfPlayers == 2) { hero2Dist = _root.getDist(_root.heroP2._x, _root.heroP2._y, this._x, this._y); } --timer; if (timer < -90) { speed = 3; moveDirSpeed = -6 + random(12); timer = 90; } else { if (timer <= 0) { closestHero = 1; if (_root.hero2Alive && _root.nrOfPlayers == 2) { if (hero1Dist > hero2Dist || !_root.hero1Alive) { closestHero = 2; } } speed = 9; moveDir = _root.getAngle(this._x, this._y, _root['heroP' + closestHero]._x, _root['heroP' + closestHero]._y) - 90; } else { moveDir += moveDirSpeed; } } if (hero1Dist < 40 || hero2Dist < 40) { makeHeadAppear = true; } if (makeHeadAppear) { timer = 25; speed *= 0.5; this.onEnterFrame = function () { if (!_root.gamePause) { --timer; if (timer <= 0) { _root.addSmoke(this._x, this._y); _root.attachMovie('undergroundWorm', 'UGW' + _root.nrOfUndergroundWorms, _root.getNextHighestDepth()); _root['UGW' + _root.nrOfUndergroundWorms]._x = this._x; _root['UGW' + _root.nrOfUndergroundWorms]._y = this._y; _root['UGW' + _root.nrOfUndergroundWorms].health = this.health; _root['UGW' + _root.nrOfUndergroundWorms].restrictZoneName = this.restrictZoneName; ++_root.nrOfUndergroundWorms; _root.attachMovie('undergroundWormEarthBit', 'EARTHBIT' + _name + 30, _root.getNextHighestDepth()); _root['EARTHBIT' + _name + 30]._x = _x; _root['EARTHBIT' + _name + 30]._y = _y + 30; _root['EARTHBIT' + _name + 30]._yscale = 90; _root['EARTHBIT' + _name + 30]._xscale = 90; _root.depthSort(_root['EARTHBIT' + _name + 30]); _root['EARTHBIT' + _name + 30].followName = this._name; _root['EARTHBIT' + _name + 30].timer = 90; _root['EARTHBIT' + _name + 30].onEnterFrame = function () { if (!_root.gamePause) { if (_root[this.followName] == undefined) { --this.timer; } if (this.timer <= 0) { this._yscale -= 1; this._xscale = this._yscale; if (this._xscale <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } }; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } _root.depthSortCustomY(this, this._y - 30); _x = _x + Math.sin(moveDir * 0.0174532925199433) * speed; _y = _y - Math.cos(moveDir * 0.0174532925199433) * speed; if (this._x + this._width / 2 > _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2 - this._width / 2; } else { if (this._x - this._width / 2 < _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2 + this._width / 2; } } if (this._y + this._height / 2 > _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2) { this._y = _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2 - this._height / 2; } else { if (this._y - this._height / 2 < _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2) { this._y = _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2 + this._height / 2; } } } } }; } } movieClip 689 undergroundWormEarthBit { frame 1 { gotoAndStop(2 + random(3)); } } movieClip 692 { frame 1 { stop(); } } movieClip 695 { frame 1 { this.gotoAndPlay(random(20)); } } movieClip 696 virus { frame 1 { ySpeed2 = 0; xSpeed2 = 0; ySpeed = 0; xSpeed = 0; innerBody.xScaleTarget = 100; innerBody.xScaleSpeed = 0; eye2.yOffset = 2.5 + random(25) / 10; walkTargetX = this._x; walkTargetY = this._y; walkSpeed = 2; wobbleTimer = 10; checkDistTimer = random(10); recoverTimer = 0; offScreenTimer = 180; if (killOnOffScreen == undefined) { killOnOffScreen = false; } if (this.signalName == undefined) { active = true; } else { active = _root[signalName]; } eye1._x = -innerBody._width / 2.5; eye1._y = -innerBody._height / 1.8; eye2._x = innerBody._width / 2.5; eye2._y = -innerBody._height / eye2.yOffset; ++_root.nrOfVirus; _root.depthSort(this); onEnterFrame = function () { if (!_root.gamePause) { if (signalName != undefined) { active = _root[signalName]; } onScreen = this.hitTest(_root.onScreen); if (active && onScreen) { --checkDistTimer; if (checkDistTimer <= 0) { if (_root.nrOfPlayers == 2) { if (!_root.hero2Alive || _root.getDist(this._x, this._y, _root.heroP1._x, _root.heroP1._y) < _root.getDist(this._x, this._y, _root.heroP2._x, _root.heroP2._y)) { walkTargetX = _root.heroP1._x; walkTargetY = _root.heroP1._y; } else { walkTargetX = _root.heroP2._x; walkTargetY = _root.heroP2._y; } if (!_root.hero1Alive) { walkTargetX = _root.heroP2._x; walkTargetY = _root.heroP2._y; } } else { walkTargetX = _root.heroP1._x; walkTargetY = _root.heroP1._y; } checkDistTimer = 40 + random(40); } if (walkTargetX + 50 < this._x) { this.xSpeed = -walkSpeed; } else { if (walkTargetX - 50 > this._x) { this.xSpeed = walkSpeed; } else { this.xSpeed = 0; } } if (walkTargetY + 15 < this._y) { this.ySpeed = -walkSpeed * 0.8; } else { if (walkTargetY - 15 > this._y) { this.ySpeed = walkSpeed * 0.8; } else { this.ySpeed = 0; } } innerBody.xScaleSpeed += (innerBody.xScaleTarget - innerBody._xscale) / 2; innerBody.xScaleSpeed /= 1.3; innerBody._xscale += innerBody.xScaleSpeed; innerBody._yscale = 200 - innerBody._xscale; if (innerBody._yscale < 20) { innerBody._yscale = 20; } shadow._width = innerBody._width; if (restrictZoneName != undefined) { if (this._x + this.hitbox._width / 2 > _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2 - this.hitbox._width / 2; } else { if (this._x - this.hitbox._width / 2 < _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2) { this._x = _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2 + this.hitbox._width / 2; } } if (this._y + this.hitbox._height / 2 > _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2) { this._y = _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2 - this.hitbox._height / 2; } else { if (this._y - this.hitbox._height / 2 < _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2) { this._y = _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2 + this.hitbox._height / 2; } } if (_root[restrictZoneName].detectWalls) { wnr = 0; while (wnr < _root[restrictZoneName].wallList.length) { if (_root[restrictZoneName].wallList[wnr].activated && hitbox.hitTest(_root[restrictZoneName].wallList[wnr])) { if (_root[restrictZoneName].wallList[wnr].hitTest(_x - hitbox._width / 2, _y, false)) { _x = _root[restrictZoneName].wallList[wnr]._x + _root[restrictZoneName].wallList[wnr]._width / 2 + hitbox._width / 2; this.xSpeed2 = 0; this.xSpeed = 0; walkTargetX = this._x; } else { if (_root[restrictZoneName].wallList[wnr].hitTest(_x + hitbox._width / 2, _y, false)) { _x = _root[restrictZoneName].wallList[wnr]._x - _root[restrictZoneName].wallList[wnr]._width / 2 - hitbox._width / 2; this.xSpeed2 = 0; this.xSpeed = 0; walkTargetX = this._x; } } if (_root[restrictZoneName].wallList[wnr].hitTest(_x, _y - hitbox._height / 2, false)) { _y = _root[restrictZoneName].wallList[wnr]._y + _root[restrictZoneName].wallList[wnr]._height / 2 + hitbox._height / 2; this.ySpeed2 = 0; this.ySpeed = 0; walkTargetY = this._y; } else { if (_root[restrictZoneName].wallList[wnr].hitTest(_x, _y + hitbox._height / 2, false)) { _y = _root[restrictZoneName].wallList[wnr]._y - _root[restrictZoneName].wallList[wnr]._height / 2 - hitbox._height / 2; this.ySpeed2 = 0; this.ySpeed = 0; walkTargetY = this._y; } } } ++wnr; } } } this.xSpeed2 += (this.xSpeed - this.xSpeed2) * 0.1; this.ySpeed2 += (this.ySpeed - this.ySpeed2) * 0.1; this._x += this.xSpeed2; this._y += this.ySpeed2; p = 1; while (p <= _root.nrOfPlayers) { if (!_root['heroP' + p].justHurt && hitbox.hitTest(_root['heroHitboxP' + p])) { if (_root['heroP' + p]._x < this._x) { _root.hurtHero(p, 1, 4); } else { _root.hurtHero(p, -1, 4); } innerBody.xScaleSpeed = 70; } if (hitbox.hitTest(_root['heroAttackHitboxP' + p]) && recoverTimer <= 0) { _root.playSound('nunchuck_hit_', _x, _y, 1 + random(4)); _root.playSound('slime_kill_', _x, _y, 1 + random(3)); m = 0; while (m < _root['heroAttackHitboxP' + p].damageMultiplier) { if (_root['heroP' + p]._x < this._x) { _root.addVirusSplat(this._x, this._y, 5 + 2 * (_xscale / 100), 100, 0.5, _width, _height); this.xSpeed2 = 10; } else { _root.addVirusSplat(this._x, this._y, 5 + 2 * (_xscale / 100), 100, -0.5, _width, _height); this.xSpeed2 = -10; } _root.addStar(_x, _y - 50, 150); _root.addMultiplier(p); this._yscale -= 30; this._xscale = this._yscale; if (this._xscale < 90) { m = _root['heroAttackHitboxP' + p].damageMultiplier; _root.giveScore(p, 80); --_root.nrOfVirus; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } _root.giveScore(p, 10); recoverTimer = 4; ++m; } } ++p; } if (recoverTimer > 0) { --recoverTimer; } --wobbleTimer; if (wobbleTimer <= 0) { if (xSpeed != 0 || ySpeed != 0) { _root.playSound('slime_', _x, _y, 1 + random(3)); } innerBody.xScaleSpeed = (Math.abs(xSpeed2) + Math.abs(ySpeed2)) * 10; wobbleTimer = 10; } eye1._x = -innerBody._width / 2.5; eye1._y = -innerBody._height / 1.8; eye2._x = innerBody._width / 2.5; eye2._y = -innerBody._height / eye2.yOffset; _root.depthSort(this); } else { if (killOnOffScreen) { --offScreenTimer; if (offScreenTimer <= 0) { --_root.nrOfVirus; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } if (_root.megaTeddington && onScreen && !active) { if (this.hitTest(_root.heroAttackHitboxP1)) { _root[signalName] = true; active = true; } } }; } } movieClip 700 virus_splat { frame 1 { this.gotoAndStop(1 + random(4)); } } movieClip 702 wall_collision { frame 1 { if (_name.indexOf('wall') != 0) { extraThicknessY = 0; extraThicknessX = 0; _name = 'wall' + _root.nrOfWalls; ++_root.nrOfWalls; } if (squishable == undefined) { squishable = false; } if (activated == undefined) { activated = true; } _visible = false; } } movieClip 704 wall_collision_triggerable { frame 1 { collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = _width; _root[collisionName]._height = _height; _root[collisionName]._x = _x; _root[collisionName]._y = _y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].activated = false; if (inverted == undefined) { inverted = false; } _visible = false; onEnterFrame = function () { if (!inverted) { _root[collisionName].activated = _root[signalName]; } else { _root[collisionName].activated = !_root[signalName]; } }; } } movieClip 711 watermelon_splat { frame 1 { this.gotoAndStop(1 + random(6)); } } movieClip 716 weakspotSplat { frame 1 { this.gotoAndStop(1 + random(4)); } } movieClip 717 whiteFade { } movieClip 719 yesInd { frame 1 { stop(); ySpeed = -1.5; startY = _y; _yscale = 0; _xscale = 0; _visible = false; remove = false; _root.depthSortCustomY(this, _y + 70); onEnterFrame = function () { if (!_root.gamePause) { if (_visible) { _y = _y + ySpeed; if (_y < startY) { ySpeed += 0.2; } else { ySpeed -= 0.2; } if (remove) { _yscale = _yscale + (-10 - _xscale) * 0.2; _xscale = _yscale + (-10 - _xscale) * 0.2; if (_xscale <= 0) { this._visible = false; } } else { _yscale = _yscale + (100 - _xscale) * 0.2; _xscale = _yscale + (100 - _xscale) * 0.2; } } } }; } } movieClip 932 { } instance of movieClip 932 { onClipEvent (load) { trace('THIS SHOULD NEVER BE SEEN'); stopAllSounds(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } frame 5 { function setUpFrame() { kRightP1 = false; kLeftP1 = false; kUpP1 = false; kDownP1 = false; kAttackP1 = false; kAttackDownP1 = false; cutscene = false; scriptControlOverride = false; nrOfVirus = 0; nrOfWalls = 0; nrOfPushBlocks = 0; nrOfBreakBlocks = 0; nrOfRapidHitBlockers = 0; nrOfButtons = 0; nrOfLevers = 0; nrOfDoors = 0; nrOfPushBlockWalls = 0; nrOfWalkRobots = 0; nrOfUndergroundWorms = 0; nrOfUndergroundWormsKilled = 0; nrOfFlies = 0; nrOfPathFollowWayPoints = 0; nrOfPathFollowers = 0; nrOfPFGroups = 0; nrOfSoldiers = 0; nrOfSpikes = 0; nrOfCrushers = 0; nrOfConveyorBelts = 0; nrOfButterflies = 0; nrOfTeleporters = 0; nrOfHatBirds = 0; nrOfPickups = 0; nrOfPlayerCollisionZones = 0; if (nrOfWatermelonsSmashed == undefined) { nrOfWatermelonsSmashed = 0; } if (gnomesFound == undefined) { gnomesFound = 0; } allPushBlockMovementForSound = 0; destroyAllEggs = false; combatZoneActive = false; makeSoldierAttack = true; breakBlockBitNr = 0; nrOfSmokeBalls = 0; nrOfCheckPoints = 0; activeCheckPoint = NaN; frameRate = 0; displayFrameRate = 30; doubleTapTime = 4; newVirusSplatNr = 0; cameraZoom = 0; cameraZoomSmoothed = 0; nrOfCameraZones = 0; nrOfCameraFocusZones = 0; cameraOvershootY = 0; cameraOvershootX = 0; cameraFocusX = undefined; cameraFocusY = undefined; cameraFocusPowerX = 0.5; cameraFocusPowerY = 0.5; cameraShakeTimer = 0; hud.blackFade.fadeTarget = -20; if (nrOfPlayers == 1) { hero2displayScore = 'MENU KEY [Enter or P] for 2 players'; _root.hud.overheadDisplay.multiplierDisplayP2._visible = false; _root.hud.overheadDisplay.healthBarP2._visible = false; _root.hud.overheadDisplay.iconP2.gotoAndStop(2); } else { _root.hud.overheadDisplay.iconP2.gotoAndStop(3); } if (_root.megaTeddington) { _root.hud.overheadDisplay.iconP1.gotoAndStop(4); } else { _root.hud.overheadDisplay.iconP1.gotoAndStop(1); } _root._x = gameCamera.cX - gameCamera._x * scaleX; _root._y = gameCamera.cY - gameCamera._y * scaleY; spawnPlayer(1, startPoint._x + startPoint._width / 2, startPoint._y + startPoint._height / 2); if (nrOfPlayers == 2) { spawnPlayer(2, startPoint._x - startPoint._width / 2, startPoint._y - startPoint._height / 2); } gameCamera._x = heroP1._x; gameCamera._y = heroP1._y - 50; if (continues == undefined) { continues = 10; } _root.attachMovie('checkpoint', 'startCheckpoint', _root.getNextHighestDepth()); _root.startCheckpoint._visible = false; _root.startCheckpoint._x = _root.startPoint._x; _root.startCheckpoint._y = _root.startPoint._y; _root.endPoint.sequenceStart = false; _root.startPoint._visible = false; _root.endPoint._visible = false; gamePause = false; frameSetUp = true; if (megaTeddington == undefined) { megaTeddington = false; } _root.hud._visible = true; _root.hud.swapDepths(_root.getNextHighestDepth()); } function getDist(xPos1, yPos1, xPos2, yPos2) { return Math.sqrt((xPos1 - xPos2) * (xPos1 - xPos2) + (yPos1 - yPos2) * (yPos1 - yPos2)); } function spawnPlayer(heroNr, xPos, yPos) { if (heroNr == 1 && _root.megaTeddington) { _root.attachMovie('hero1MegaTeddington', 'heroP' + heroNr, _root.getNextHighestDepth()); _root.attachMovie('megaTeddingtonTarget', 'megaTeddingtonTarget', _root.getNextHighestDepth()); _root.attachMovie('hitbox', 'megaTeddingtonClickDetect', _root.getNextHighestDepth()); _root.megaTeddingtonClickDetect._alpha = 0; _root.megaTeddingtonClickDetect._height = 300; _root.megaTeddingtonClickDetect._width = 300; _root.megaTeddingtonClickDetect.onPress = function () { _root.megaTeddingtonClickDetect.pressed = true; }; _root.megaTeddingtonClickDetect.onRelease = function () { _root.megaTeddingtonClickDetect.pressed = false; }; _root.megaTeddingtonClickDetect.onEnterFrame = function () { this._x = _root._xmouse; this._y = _root._ymouse; if (_root.gamePause) { this._visible = false; } else { this._visible = true; } }; } else { _root.attachMovie('hero' + heroNr, 'heroP' + heroNr, _root.getNextHighestDepth()); _root.attachMovie('heroSword', 'heroSwordP' + heroNr, _root.getNextHighestDepth()); } _root.attachMovie('shadow', 'heroShadowP' + heroNr, _root.getNextHighestDepth()); _root.attachMovie('attackHitBox', 'heroAttackHitboxP' + heroNr, _root.getNextHighestDepth()); _root.attachMovie('hitbox', 'heroHitboxP' + heroNr, _root.getNextHighestDepth()); _root.attachMovie('hitbox', 'heroDeathBoxP' + heroNr, _root.getNextHighestDepth()); _root['heroDeathBoxP' + heroNr]._x = xPos; _root['heroHitboxP' + heroNr]._x = _root['heroDeathBoxP' + heroNr]._x; _root['heroAttackHitboxP' + heroNr]._x = _root['heroDeathBoxP' + heroNr]._x; _root['heroShadowP' + heroNr]._x = _root['heroDeathBoxP' + heroNr]._x; _root['heroSwordP' + heroNr]._x = _root['heroDeathBoxP' + heroNr]._x; _root['heroP' + heroNr]._x = _root['heroDeathBoxP' + heroNr]._x; _root['heroDeathBoxP' + heroNr]._y = yPos; _root['heroHitboxP' + heroNr]._y = _root['heroDeathBoxP' + heroNr]._y; _root['heroAttackHitboxP' + heroNr]._y = _root['heroDeathBoxP' + heroNr]._y; _root['heroShadowP' + heroNr]._y = _root['heroDeathBoxP' + heroNr]._y; _root['heroSwordP' + heroNr]._y = _root['heroDeathBoxP' + heroNr]._y; _root['heroP' + heroNr]._y = _root['heroDeathBoxP' + heroNr]._y; _root['heroP' + heroNr].zSpeed2 = 0; _root['heroP' + heroNr].ySpeed2 = 0; _root['heroP' + heroNr].xSpeed2 = 0; _root['heroP' + heroNr].zSpeed = 0; _root['heroP' + heroNr].ySpeed = 0; _root['heroP' + heroNr].xSpeed = 0; _root['heroP' + heroNr].conSpeedX = 0; _root['heroP' + heroNr].conSpeedY = 0; _root['heroP' + heroNr].moveSpeed = 0; _root['heroP' + heroNr].moveDir = 0; _root['heroP' + heroNr].walkingSpeed = 6; _root['heroP' + heroNr].onGround = true; depthSort(_root['heroP' + heroNr]); _root['heroP' + heroNr].attackTimer = 0; _root['heroP' + heroNr].attackFaceMeter = 0; _root['heroP' + heroNr].speedMultiplyer = 1; if (heroNr == 2) { _root.heroP2.waypointX = _root.heroP1.waypointX; _root.heroP2.waypointY = _root.heroP1.waypointY; } else { _root['heroP' + heroNr].waypointY = 0; _root['heroP' + heroNr].waypointX = 0; } _root['heroP' + heroNr].allowTeleport = true; _root['heroP' + heroNr].touchingTeleporter = false; if (_root['hero' + heroNr + 'health'] == undefined || _root['hero' + heroNr + 'health'] <= 0) { _root['hero' + heroNr + 'health'] = 100; } if (_root['hero' + heroNr + 'maxHealth'] == undefined) { _root['hero' + heroNr + 'maxHealth'] = 100; } _root['heroP' + heroNr].deathBoxTouchingWall = false; _root['hero' + heroNr + 'RespawnDelay'] = 30; if (_root['hero' + heroNr + 'score'] == undefined) { _root['hero' + heroNr + 'score'] = 0; _root['hero' + heroNr + 'displayScore'] = 0; _root['hero' + heroNr + 'scoreContinuesGiven'] = 0; _root['hero' + heroNr + 'scoreTemp'] = 0; _root['hero' + heroNr + 'multiplier'] = 0; _root['hero' + heroNr + 'multiplierTimer'] = 0; } if (isNaN(_root['hero' + heroNr + 'scoreTemp'])) { _root['hero' + heroNr + 'scoreTemp'] = 0; } _root['heroP' + heroNr].justHurt = false; _root['heroP' + heroNr].recoverTimer = 30; _root['heroP' + heroNr].doubleTapTimerKDown = 0; _root['heroP' + heroNr].doubleTapTimerKUp = 0; _root['heroP' + heroNr].doubleTapTimerKLeft = 0; _root['heroP' + heroNr].doubleTapTimerKRight = 0; _root['heroP' + heroNr].doubleTapTimerKDownPrev = 0; _root['heroP' + heroNr].doubleTapTimerKUpPrev = 0; _root['heroP' + heroNr].doubleTapTimerKLeftPrev = 0; _root['heroP' + heroNr].doubleTapTimerKRightPrev = 0; _root['heroP' + heroNr].doubleTapTimerKDownPrevTimer = 0; _root['heroP' + heroNr].doubleTapTimerKUpPrevTimer = 0; _root['heroP' + heroNr].doubleTapTimerKLeftPrevTimer = 0; _root['heroP' + heroNr].doubleTapTimerKRightPrevTimer = 0; _root['heroP' + heroNr].upperBody.rotationSpeed = 0; _root['heroSwordP' + heroNr].targetRotation = 20; _root['heroSwordP' + heroNr].yOffset = 0; _root['heroSwordP' + heroNr].xOffset = 0; _root['heroSwordP' + heroNr].innerSword.nunchuck.rotSpeed = 0; _root['heroHitboxP' + heroNr]._width = 65; _root['heroHitboxP' + heroNr]._height = 10; _root['heroHitboxP' + heroNr].activated = true; _root['heroAttackHitboxP' + heroNr]._width = 77; _root['heroAttackHitboxP' + heroNr]._height = 5; _root['heroAttackHitboxP' + heroNr].damageMultiplier = 1; _root['heroDeathBoxP' + heroNr]._width = 55; _root['heroDeathBoxP' + heroNr]._height = 1; _root['hero' + heroNr + 'Alive'] = true; _root.hud.swapDepths(_root.getNextHighestDepth()); } function despawnPlayer(heroNr) { if (heroNr == 1 && _root.megaTeddington) { _root.teddingtonAimGlow.removeMovieClip(); _root.megaTeddingtonTarget.removeMovieClip(); _root.megaTeddingtonClickDetect.removeMovieClip(); } _root['heroP' + heroNr].removeMovieClip(); _root['heroSwordP' + heroNr].removeMovieClip(); _root['heroShadowP' + heroNr].removeMovieClip(); _root['heroAttackHitboxP' + heroNr].removeMovieClip(); _root['heroHitboxP' + heroNr].removeMovieClip(); _root['heroDeathBoxP' + heroNr].removeMovieClip(); _root['hero' + heroNr + 'Alive'] = false; } function unlockAchievement(unlockNr) { if (!_root.savedData.data['achievement' + unlockNr]) { if (unlockNr == 1) { achievementText = 'Find 3 gnomes'; com.newgrounds.API.unlockMedal('Find 3 gnomes'); if (siteKongregate()) { _global.kongregate.stats.submit('Achievement 1', 1); } } else { if (unlockNr == 2) { achievementText = 'Find 6 gnomes'; com.newgrounds.API.unlockMedal('Find 6 gnomes'); if (siteKongregate()) { _global.kongregate.stats.submit('Achievement 2', 1); } } else { if (unlockNr == 3) { achievementText = 'Find 9 gnomes'; com.newgrounds.API.unlockMedal('Find 9 gnomes'); if (siteKongregate()) { _global.kongregate.stats.submit('Achievement 3', 1); } } else { if (unlockNr == 4) { achievementText = 'Don\'t give Mr.Pink the blues'; com.newgrounds.API.unlockMedal('Dont give Mr Pink the blues'); if (siteKongregate()) { _global.kongregate.stats.submit('Achievement 4', 1); } } else { if (unlockNr == 5) { achievementText = 'Score 20 in Super Deluxe Space Avoider'; com.newgrounds.API.unlockMedal('Score 20 in Super Deluxe Space Avoider'); if (siteKongregate()) { _global.kongregate.stats.submit('Achievement 5', 1); } } else { if (unlockNr == 6) { achievementText = 'Smash all the watermelons'; com.newgrounds.API.unlockMedal('Smash all the watermelons'); if (siteKongregate()) { _global.kongregate.stats.submit('Achievement 6', 1); } } else { if (unlockNr == 7) { achievementText = 'Finish Chapter "Welcome to the Wishingwell"'; com.newgrounds.API.unlockMedal('Finish Chapter 1'); if (siteKongregate()) { _global.kongregate.stats.submit('Achievement 7', 1); } } else { if (unlockNr == 8) { achievementText = 'Finish Chapter "Fruit \'n Veg R&D Facilities"'; com.newgrounds.API.unlockMedal('Finish Chapter 2'); if (siteKongregate()) { _global.kongregate.stats.submit('Achievement 8', 1); } } else { if (unlockNr == 9) { achievementText = 'Finish Chapter "The Fishy Theatre"'; com.newgrounds.API.unlockMedal('Finish Chapter 3'); if (siteKongregate()) { _global.kongregate.stats.submit('Achievement 9', 1); } } else { if (unlockNr == 10) { achievementText = 'Score higher than 2 500 000'; com.newgrounds.API.unlockMedal('Score higher than 2 500 000'); if (siteKongregate()) { _global.kongregate.stats.submit('Achievement 10', 1); } } else { if (unlockNr == 11) { achievementText = 'Get a multiplier higher than 50'; com.newgrounds.API.unlockMedal('Get a multiplier higher than 50'); if (siteKongregate()) { _global.kongregate.stats.submit('Achievement 11', 1); } } else { if (unlockNr == 12) { achievementText = 'Forgive and forget'; com.newgrounds.API.unlockMedal('Forgive and forget'); if (siteKongregate()) { _global.kongregate.stats.submit('Achievement 12', 1); } } } } } } } } } } } } } com.newgrounds.API.logCustomEvent('Achievement_' + unlockNr); _root.showUiTip('Achievement unlocked: ' + achievementText, 180); _root['achievement' + unlockNr] = true; _root.savedData.data['achievement' + unlockNr] = true; _root.savedData.flush(); } } function playerHandling(playerNr, hero, heroSword, heroShadow, heroAttackHitbox) { if (_root['hero' + playerNr + 'Alive']) { if (!hero.touchingTeleporter) { hero.allowTeleport = true; } hero.touchingTeleporter = false; if (cutscene && !scriptControlOverride) { if (hero._x > hero.waypointX + 10) { _root['kRightP' + playerNr] = false; _root['kLeftP' + playerNr] = true; } else { if (hero._x < hero.waypointX - 10) { _root['kRightP' + playerNr] = true; _root['kLeftP' + playerNr] = false; } else { _root['kRightP' + playerNr] = false; _root['kLeftP' + playerNr] = false; } } if (hero._y > hero.waypointY + 10) { _root['kUpP' + playerNr] = true; _root['kDownP' + playerNr] = false; } else { if (hero._y < hero.waypointY - 10) { _root['kUpP' + playerNr] = false; _root['kDownP' + playerNr] = true; } else { _root['kUpP' + playerNr] = false; _root['kDownP' + playerNr] = false; } } } hero.moveSpeed = 0; if (!_root['kRightP' + playerNr] && !_root['kLeftP' + playerNr] && !_root['kUpP' + playerNr] && !_root['kDownP' + playerNr]) { if (hero.doubleTapTimerKRightPrevTimer == doubleTapTime) { hero.doubleTapTimerKRightPrev = hero.doubleTapTimerKRight; } else { if (hero.doubleTapTimerKRightPrevTimer <= 0) { hero.doubleTapTimerKRightPrev = 0; } } --hero.doubleTapTimerKRightPrevTimer; hero.doubleTapTimerKRight = 0; if (hero.doubleTapTimerKLeftPrevTimer == doubleTapTime) { hero.doubleTapTimerKLeftPrev = hero.doubleTapTimerKLeft; } else { if (hero.doubleTapTimerKLeftPrevTimer <= 0) { hero.doubleTapTimerKLeftPrev = 0; } } --hero.doubleTapTimerKLeftPrevTimer; hero.doubleTapTimerKLeft = 0; if (hero.doubleTapTimerKUpPrevTimer == doubleTapTime) { hero.doubleTapTimerKUpPrev = hero.doubleTapTimerKUp; } else { if (hero.doubleTapTimerKUpPrevTimer <= 0) { hero.doubleTapTimerKUpPrev = 0; } } --hero.doubleTapTimerKUpPrevTimer; hero.doubleTapTimerKUp = 0; if (hero.doubleTapTimerKDownPrevTimer == doubleTapTime) { hero.doubleTapTimerKDownPrev = hero.doubleTapTimerKDown; } else { if (hero.doubleTapTimerKDownPrevTimer <= 0) { hero.doubleTapTimerKDownPrev = 0; } } --hero.doubleTapTimerKDownPrevTimer; hero.doubleTapTimerKDown = 0; } if (_root['kRightP' + playerNr]) { if (hero.doubleTapTimerKRightPrev < doubleTapTime && hero.doubleTapTimerKRightPrev > 0) { hero.speedMultiplyer = 1.6; } ++hero.doubleTapTimerKRight; hero.doubleTapTimerKRightPrevTimer = doubleTapTime; hero.moveSpeed = hero.walkingSpeed * hero.speedMultiplyer; if (_root['kUpP' + playerNr]) { hero.moveDir = 45; } else { if (_root['kDownP' + playerNr]) { hero.moveDir = 135; } else { hero.moveDir = 90; } } hero._xscale = 100; heroSword._xscale = -100; heroSword.targetRotation = -40; } else { if (_root['kLeftP' + playerNr]) { if (hero.doubleTapTimerKLeftPrev < doubleTapTime && hero.doubleTapTimerKLeftPrev > 0) { hero.speedMultiplyer = 1.6; } ++hero.doubleTapTimerKLeft; hero.doubleTapTimerKLeftPrevTimer = doubleTapTime; hero.moveSpeed = hero.walkingSpeed * hero.speedMultiplyer; if (_root['kUpP' + playerNr]) { hero.moveDir = -45; } else { if (_root['kDownP' + playerNr]) { hero.moveDir = -135; } else { hero.moveDir = -90; } } hero._xscale = -100; heroSword._xscale = 100; heroSword.targetRotation = 40; } else { if (_root['kUpP' + playerNr]) { if (hero.doubleTapTimerKUpPrev < doubleTapTime && hero.doubleTapTimerKUpPrev > 0) { hero.speedMultiplyer = 1.6; } ++hero.doubleTapTimerKUp; hero.doubleTapTimerKUpPrevTimer = doubleTapTime; hero.moveSpeed = hero.walkingSpeed * hero.speedMultiplyer; hero.moveDir = 0; } else { if (_root['kDownP' + playerNr]) { if (hero.doubleTapTimerKDownPrev < doubleTapTime && hero.doubleTapTimerKDownPrev > 0) { hero.speedMultiplyer = 1.6; } ++hero.doubleTapTimerKDown; hero.doubleTapTimerKDownPrevTimer = doubleTapTime; hero.moveSpeed = hero.walkingSpeed * hero.speedMultiplyer; hero.moveDir = 180; } else { hero.speedMultiplyer = 1; } } } } hero.xSpeed2 = Math.sin(hero.moveDir * 0.0174532925199433) * hero.moveSpeed; hero.ySpeed2 = -Math.cos(hero.moveDir * 0.0174532925199433) * (hero.moveSpeed * 0.8); hero.xSpeed += (hero.xSpeed2 - hero.xSpeed) * 0.4; hero.ySpeed += (hero.ySpeed2 - hero.ySpeed) * 0.4; if (!_root.megaTeddington && playerNr == 1 || playerNr == 2) { if (hero.justHurt || hero.attackTimer <= 0) { hero._x += hero.xSpeed; hero._y += hero.ySpeed; } } else { hero._x += hero.xSpeed; hero._y += hero.ySpeed; } if (hero.conSpeedX > 0 && !hero.wallCollideRight || hero.conSpeedX < 0 && !hero.wallCollideLeft) { hero._x += hero.conSpeedX; } if (hero.conSpeedY > 0 && !hero.wallCollideDown || hero.conSpeedY < 0 && !hero.wallCollideUp) { hero._y += hero.conSpeedY; } depthSort(hero); if (hero.speedMultiplyer != 1) { hero.upperBody.rotationSpeed += (Math.abs(hero.xSpeed * 2) - hero.upperBody._rotation) / 2; hero.upperBody.rotationSpeed /= 1.3; hero.upperBody._rotation += hero.upperBody.rotationSpeed; } else { hero.upperBody.rotationSpeed += (-Math.abs(hero.xSpeed * 1.5) - hero.upperBody._rotation) / 2; hero.upperBody.rotationSpeed /= 1.3; hero.upperBody._rotation += hero.upperBody.rotationSpeed; } if (!kAttackDownP1 && !kAttackDownP2 && !_root.speechBubble.allowSkip) { releasedAttackButtonAfterSpeechBubble = true; } if (_root['hero' + playerNr + 'Alive'] && hero.attackTimer <= 0) { heroAttackHitbox.damageMultiplier = 1; if (releasedAttackButtonAfterSpeechBubble && !_root.speechBubble.allowSkip && !cutscene && _root['kAttackP' + playerNr]) { if (_root.megaTeddington && playerNr == 1) { } else { heroSword.innerSword.nunchuck.rotSpeed = 50 + heroSword.innerSword.nunchuck.power._alpha * 0.3; heroSword.innerSword.nunchuck.power._alpha += 0.5; if (heroSword.innerSword.nunchuck.power._alpha < 15) { _root['nunchuck_chargeP' + playerNr + 'S'].setVolume(heroSword.innerSword.nunchuck.power._alpha * 10 * sfxVolume); _root['nunchuck_charge_readyP' + playerNr + 'S'].setVolume(0); } else { _root['nunchuck_chargeP' + playerNr + 'S'].setVolume(heroSword.innerSword.nunchuck.power._alpha * sfxVolume); _root['nunchuck_charge_readyP' + playerNr + 'S'].setVolume(heroSword.innerSword.nunchuck.power._alpha * 0.9 * sfxVolume); } if (heroSword.innerSword.nunchuck.power._alpha >= 15) { if (!_root['playedMegaChopChargedSoundP' + playerNr]) { _root.playSound('nunchuck_mega_attack_charged_1'); _root['playedMegaChopChargedSoundP' + playerNr] = true; } heroSword.innerSword.nunchuck.charge._yscale += (35 - heroSword.innerSword.nunchuck.charge._yscale) * 0.2; heroSword.innerSword.nunchuck.charge._xscale = heroSword.innerSword.nunchuck.charge._yscale; heroSword.innerSword.nunchuck.charge._alpha += (30 - heroSword.innerSword.nunchuck.charge._alpha) * 0.2; heroSword.innerSword.nunchuck.charge._visible = true; heroSword.innerSword.nunchuck.power._alpha = 90; } else { _root['playedMegaChopChargedSoundP' + playerNr] = false; } } } else { if (heroSword.innerSword.nunchuck.power._alpha >= 15) { if (!_root.megaTeddington && playerNr == 1 || playerNr == 2) { _root.playSound('nunchuck_mega_attack_1'); _root['nunchuck_chargeP' + playerNr + 'S'].setVolume(0); _root['nunchuck_charge_readyP' + playerNr + 'S'].setVolume(0); _root['nunchuck_chargeP' + playerNr + 'S'].stop(); _root['nunchuck_charge_readyP' + playerNr + 'S'].stop(); _root['megaHit' + playerNr].swapDepths(_root.getNextHighestDepth()); _root['megaHit' + playerNr].removeMovieClip(); heroAttackHitbox.damageMultiplier = 10; _root['kAttackP' + playerNr] = true; _root['kAttackDownP' + playerNr] = false; _root.attachMovie('megaHit', 'megaHit' + playerNr, _root.getNextHighestDepth()); _root['megaHit' + playerNr]._x = hero._x; _root['megaHit' + playerNr]._y = hero._y; _root['megaHit' + playerNr]._xscale = hero._xscale; _root.depthSort(_root['megaHit' + playerNr]); _root['megaHit' + playerNr].onEnterFrame = function () { if (!_root.gamePause) { this._xscale *= 1.08; this._yscale *= 1.01; this._alpha -= 15; if (this._alpha <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; heroSword.innerSword.nunchuck.power._alpha = 0; } } } heroSword.innerSword.nunchuck.rotSpeed += (-Math.abs(heroSword._rotation) - heroSword.innerSword._rotation - Math.abs(hero.xSpeed * 4) - heroSword.innerSword.nunchuck._rotation) / 10; heroSword.innerSword.nunchuck.rotSpeed /= 1.1; heroSword.innerSword.nunchuck._rotation += heroSword.innerSword.nunchuck.rotSpeed; heroSword.xOffset *= 0.6; heroSword.yOffset += (-10 - hero.upperBody.zSpeed - heroSword.yOffset) * 0.4; heroSword._rotation += (heroSword.targetRotation - heroSword._rotation) * 0.6; heroSword.innerSword._rotation += -heroSword.innerSword._rotation * 0.6; heroAttackHitbox.gotoAndStop(2); hero.attackTimer = 0; } else { --hero.attackTimer; } heroSword.innerSword.nunchuck.swoosh._alpha *= 0.5; heroSword._x = hero._x + heroSword.xOffset; heroSword._y = hero._y + heroSword.yOffset; heroSword.swapDepths(hero.getDepth() + 4); if (hero.attackFaceMeter > 0) { --hero.attackFaceMeter; if (hero.attackFaceMeter > 20) { hero.upperBody.face.gotoAndStop(3); } else { if (hero.attackFaceMeter > 10) { hero.upperBody.face.gotoAndStop(2); } } } else { hero.upperBody.face.gotoAndStop(1); } if (!_root.speechBubble.allowSkip && !cutscene && _root['kAttackP' + playerNr]) { if (!_root['kAttackDownP' + playerNr]) { if (hero.attackTimer <= 0) { if (!_root.megaTeddington && playerNr == 1 || playerNr == 2) { _root['nunchuck_chargeP' + playerNr + 'S'].stop(); _root['nunchuck_chargeP' + playerNr + 'S'].onSoundComplete = function () { _root['nunchuck_chargeP' + playerNr + 'S'].start(random(1000) * 0.001); }; _root['nunchuck_charge_readyP' + playerNr + 'S'].stop(); _root['nunchuck_charge_readyP' + playerNr + 'S'].onSoundComplete = function () { _root['nunchuck_charge_readyP' + playerNr + 'S'].start(random(1000) * 0.001); }; _root['nunchuck_chargeP' + playerNr + 'S'].start(); _root['nunchuck_charge_readyP' + playerNr + 'S'].start(); _root.playSound('nunchuck_attack_', _root['heroP' + playerNr]._x, _root['heroP' + playerNr]._y, 1 + random(4)); heroAttackHitbox._xscale = hero._xscale; heroAttackHitbox.gotoAndStop(1); heroSword.innerSword._rotation = -135; heroSword.innerSword.nunchuck._rotation = -179 + random(30); heroSword.innerSword.nunchuck.rotSpeed = -20; heroSword.innerSword.nunchuck.swoosh._alpha = 100; heroSword.xOffset = 80 * (hero._xscale / 100); heroSword.yOffset = -10; hero.attackTimer = 3; hero.attackFaceMeter += 6; } else { _root.playSound('teddington_laser_', _root.heroP1._x, _root.heroP1._y, 1 + random(3)); _root.heroP1.upperBody.laserCannon.glow._alpha = 100; _root.heroP1.upperBody.glow._alpha = 100; heroAttackHitbox.gotoAndStop(1); heroAttackHitbox._height = 100; heroAttackHitbox._x = _root._xmouse - 60; heroAttackHitbox._y = _root._ymouse; teddingtonLaserName = 'teddingtonLaser' + _root.getNextHighestDepth(); _root.attachMovie('megaTeddingtonLaserImpact', teddingtonLaserName, _root.getNextHighestDepth()); _root[teddingtonLaserName]._x = _root._xmouse; _root[teddingtonLaserName]._y = _root._ymouse; hero.attackTimer = 3; } } _root['kAttackDownP' + playerNr] = true; } } else { if (Math.abs(heroSword.innerSword.nunchuck.rotSpeed) > 20) { heroSword.innerSword.nunchuck.rotSpeed *= 0.8; } _root['nunchuck_chargeP' + playerNr + 'S'].stop(); _root['nunchuck_charge_readyP' + playerNr + 'S'].stop(); heroSword.innerSword.nunchuck.power._alpha = 0; heroSword.innerSword.nunchuck.charge._alpha = 100; heroSword.innerSword.nunchuck.charge._yscale = 100; heroSword.innerSword.nunchuck.charge._xscale = 100; heroSword.innerSword.nunchuck.charge._visible = false; _root['kAttackDownP' + playerNr] = false; } if (hero.justHurt) { --hero.recoverTimer; if (hero.recoverTimer <= 0) { hero.recoverTimer = 15; hero.justHurt = false; } } heroShadow._x = hero._x; heroShadow._y = hero._y; depthSortCustomY(heroShadow, sizeOfArea._y); _root['heroDeathBoxP' + playerNr]._x = hero._x; _root['heroHitboxP' + playerNr]._x = _root['heroDeathBoxP' + playerNr]._x; _root['heroDeathBoxP' + playerNr]._y = hero._y; _root['heroHitboxP' + playerNr]._y = _root['heroDeathBoxP' + playerNr]._y; if (!_root.megaTeddington && playerNr == 1 || playerNr == 2) { heroAttackHitbox._x = hero._x; heroAttackHitbox._y = hero._y; } if (_root.megaTeddington && playerNr == 1) { if (_root.heroP1._xscale > 0) { _root.heroP1.upperBody.laserCannon._rotation = _root.getAngle(_root.heroP1._x, _root.heroP1._y + _root.heroP1.upperBody._y + _root.heroP1.upperBody.laserCannon._y, _root._xmouse, _root._ymouse) * (_root.heroP1._xscale / 100) + 180 - _root.heroP1.upperBody._rotation; } else { _root.heroP1.upperBody.laserCannon._rotation = _root.getAngle(_root.heroP1._x, _root.heroP1._y + _root.heroP1.upperBody._y + _root.heroP1.upperBody.laserCannon._y, _root._xmouse, _root._ymouse) * (_root.heroP1._xscale / 100) - _root.heroP1.upperBody._rotation; } } if (!cutscene) { if (hero._x - _root['heroHitboxP' + playerNr]._width / 2 < gameCamera._x - gameCamera._width / 2) { hero._x = gameCamera._x - gameCamera._width / 2 + _root['heroHitboxP' + playerNr]._width / 2; } else { if (hero._x + _root['heroHitboxP' + playerNr]._width / 2 > gameCamera._x + gameCamera._width / 2) { hero._x = gameCamera._x + gameCamera._width / 2 - _root['heroHitboxP' + playerNr]._width / 2; } } if (nrOfPlayers == 2 && hero._y < gameCamera._y - gameCamera._height / 2) { hero._y = gameCamera._y - gameCamera._height / 2; } else { if (nrOfPlayers == 1 && hero._y - 80 < gameCamera._y - gameCamera._height / 2) { hero._y = gameCamera._y + 80 - gameCamera._height / 2; } else { if (hero._y > gameCamera._y + gameCamera._height / 2) { hero._y = gameCamera._y + gameCamera._height / 2; } } } } } else { --_root['hero' + playerNr + 'RespawnDelay']; } if (_root['hero' + playerNr + 'health'] <= 0) { _root['hero' + playerNr + 'health'] = 0; if (hero != undefined) { addStar(hero._x, hero._y, 200); addButterflies(hero._x, hero._y, 20); _root.playSound('bear_popped_', hero._x, hero._y, 1 + random(4)); despawnPlayer(playerNr); } } if (_root['hero' + playerNr + 'multiplierTimer'] > 0) { _root.hud.overheadDisplay['multiplierDisplayP' + playerNr].multiplierText.text = 'x' + _root['hero' + playerNr + 'multiplier']; _root.hud.overheadDisplay['multiplierDisplayP' + playerNr].scoreTempText.text = _root['hero' + playerNr + 'scoreTemp']; _root.hud.overheadDisplay['multiplierDisplayP' + playerNr]._visible = true; --_root['hero' + playerNr + 'multiplierTimer']; } else { _root.hud.overheadDisplay['multiplierDisplayP' + playerNr].multiplierText.text = ''; _root.hud.overheadDisplay['multiplierDisplayP' + playerNr].scoreTempText.text = ''; _root.hud.overheadDisplay['multiplierDisplayP' + playerNr]._visible = false; if (_root['hero' + playerNr + 'scoreTemp'] > 0) { _root['hero' + playerNr + 'score'] += _root['hero' + playerNr + 'scoreTemp'] * _root['hero' + playerNr + 'multiplier']; if (_root['hero' + playerNr + 'score'] > 2500000) { _root.unlockAchievement(10); } if (_root['hero' + playerNr + 'multiplier'] > 50) { _root.unlockAchievement(11); } _root['hero' + playerNr + 'scoreTemp'] = 0; } _root['hero' + playerNr + 'multiplier'] = 0; } _root.hud.overheadDisplay['multiplierDisplayP' + playerNr].background._yscale = 55 + _root['hero' + playerNr + 'multiplierTimer']; _root.hud.overheadDisplay['multiplierDisplayP' + playerNr].background._xscale = _root.hud.overheadDisplay['multiplierDisplayP' + playerNr].background._yscale; _root.hud.overheadDisplay['multiplierDisplayP' + playerNr].background2._yscale = _root.hud.overheadDisplay['multiplierDisplayP' + playerNr].background._xscale; _root.hud.overheadDisplay['multiplierDisplayP' + playerNr].background2._xscale = _root.hud.overheadDisplay['multiplierDisplayP' + playerNr].background2._yscale; _root.hud.overheadDisplay['multiplierDisplayP' + playerNr]._xscale = 70 + _root['hero' + playerNr + 'multiplier']; _root.hud.overheadDisplay['multiplierDisplayP' + playerNr]._yscale = _root.hud.overheadDisplay['multiplierDisplayP' + playerNr]._xscale; if (_root['hero' + playerNr + 'displayScore'] > _root['hero' + playerNr + 'score'] - 1111) { _root['hero' + playerNr + 'displayScore'] += 111; } else { _root['hero' + playerNr + 'displayScore'] += 1111; } if (_root['hero' + playerNr + 'displayScore'] > _root['hero' + playerNr + 'score']) { _root['hero' + playerNr + 'displayScore'] = _root['hero' + playerNr + 'score']; } if (Math.round(_root['hero' + playerNr + 'displayScore'] / 50000 - 0.5) > _root['hero' + playerNr + 'scoreContinuesGiven']) { ++continues; _root.playSound('bonus_life'); scoreBonusLifeName = 'SBLN' + _root.getNextHighestDepth(); _root.attachMovie('scoreBonusLife', scoreBonusLifeName, _root.getNextHighestDepth()); _root[scoreBonusLifeName]._x = hero._x; _root[scoreBonusLifeName]._y = hero._y - 100; _root[scoreBonusLifeName]._yscale = 10; _root[scoreBonusLifeName]._xscale = 10; _root[scoreBonusLifeName]._alpha = 160; _root.depthSortCustomY(_root[scoreBonusLifeName], hero._y - 20); _root[scoreBonusLifeName].onEnterFrame = function () { if (!_root.gamePause) { this._y -= 2; this._yscale += (100 - this._xscale) * 0.3; this._xscale = this._yscale; this._alpha -= 2; if (this._alpha <= 0) { this.swapDepths(root.getNextHighestDepth()); this.removeMovieClip(); } } }; _root['hero' + playerNr + 'scoreContinuesGiven'] = Math.round(_root['hero' + playerNr + 'displayScore'] / 50000 - 0.5); } if (_root.endPoint.activated && _root['heroHitboxP' + playerNr].hitTest(_root.endPoint)) { _root.endPoint.sequenceStart = true; } } function giveScore(heroNr, amount) { _root['hero' + heroNr + 'scoreTemp'] += amount; } function addMultiplier(heroNr) { _root['hero' + heroNr + 'multiplierTimer'] = 30; ++_root['hero' + heroNr + 'multiplier']; } function hurtHero(playerNr, xDir, amount) { if (!_root['heroP' + playerNr].justHurt) { _root.playSound('nunchuck_hit_', _root['heroP' + playerNr]._x, _root['heroP' + playerNr]._y, 1 + random(4)); if (!_root.megaTeddington && playerNr == 1) { _root.playSound('charlie_being_hit_', _root['heroP' + playerNr]._x, _root['heroP' + playerNr]._y, 1 + random(4)); } else { if (playerNr == 2) { _root.playSound('mortadela_being_hit_', _root['heroP' + playerNr]._x, _root['heroP' + playerNr]._y, 1 + random(4)); } } _root['heroP' + playerNr].upperBody._rotation = -80 * xDir; _root['heroP' + playerNr].xSpeed = -50 * xDir; _root['hero' + playerNr + 'health'] -= amount; _root['heroP' + playerNr].justHurt = true; } } function addButterflies(xPos, yPos, amount) { i = 0; while (i < amount) { newButterflyName = 'BUTTERF' + nrOfButterflies; ++nrOfButterflies; _root.attachMovie('butterfly', newButterflyName, _root.getNextHighestDepth()); _root[newButterflyName]._x = xPos - 20 + random(40); _root[newButterflyName]._y = yPos - 20 - random(100); _root.depthSortCustomY(_root[newButterflyName], yPos); ++i; } } function depthSort(obj) { obj.swapDepths(_root.sizeOfArea._x + obj._x + (obj._y + 10000) * _root.sizeOfArea._width); } function depthSortCustomY(obj, objY) { obj.swapDepths(_root.sizeOfArea._x + obj._x + (objY + 10000) * _root.sizeOfArea._width); } function addVirusSplat(xPos, yPos, amount, scale, splatDir, objWidth, objHeight, type, heightOffset, ySpeedMultiplier) { if (type == undefined) { type = 'virus_splat'; } if (heightOffset == undefined) { heightOffset = 0; } if (ySpeedMultiplier == undefined) { ySpeedMultiplier = 1; } i = 0; while (i < amount) { newVirusSplatName = 'vs' + newVirusSplatNr; _root.attachMovie(type, newVirusSplatName, _root.getNextHighestDepth()); _root[newVirusSplatName]._yscale = scale * 0.5 + random(scale); _root[newVirusSplatName]._xscale = _root[newVirusSplatName]._yscale; _root[newVirusSplatName]._x = xPos - objWidth / 2 + random(objWidth); _root[newVirusSplatName]._y = yPos + heightOffset - random(objHeight); _root[newVirusSplatName].yPos = yPos - 10 + random(20); _root[newVirusSplatName].objScale = _root[newVirusSplatName]._xscale; depthSort(_root[newVirusSplatName]); _root[newVirusSplatName].ySpeed = (-7 - random(7)) * ySpeedMultiplier; _root[newVirusSplatName].xSpeed = (10 + random(14)) * splatDir; _root[newVirusSplatName].onEnterFrame = function () { if (!_root.gamePause) { this._x += this.xSpeed; this._y += this.ySpeed; this.ySpeed += 2; if (this._y >= this.yPos) { this._yscale -= this.ySpeed * 2; if (this._yscale <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } this._y = this.yPos; this.xSpeed *= 0.8; } this.shadow._y = (this.yPos - this._y) / this.objScale * 0.01; } }; ++newVirusSplatNr; ++i; } } function addHairSplat(xPos, yPos, amount, scale, splatDir, objWidth, objHeight) { i = 0; while (i < amount) { newVirusSplatName = 'vs' + newVirusSplatNr; _root.attachMovie('hairTufft', newVirusSplatName, _root.getNextHighestDepth()); _root[newVirusSplatName]._yscale = scale * 0.5 + random(scale); _root[newVirusSplatName]._xscale = _root[newVirusSplatName]._yscale; _root[newVirusSplatName]._x = xPos - objWidth / 2 + random(objWidth); _root[newVirusSplatName]._y = yPos - random(objHeight); depthSort(_root[newVirusSplatName]); _root[newVirusSplatName].ySpeed = -7 - random(7); _root[newVirusSplatName].xSpeed = (10 + random(14)) * splatDir; _root[newVirusSplatName].onEnterFrame = function () { if (!_root.gamePause) { this._x += this.xSpeed; this._y += this.ySpeed; this.ySpeed += 2; if (this._y >= yPos) { this._yscale -= this.ySpeed * 2; if (this._yscale <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } this._y = yPos; this.xSpeed *= 0.8; } this.shadow._y = -(this._y - yPos); } }; ++newVirusSplatNr; ++i; } } function addStar(xPos, yPos, scale) { starName = 'ss' + _root.getNextHighestDepth(); _root.attachMovie('smash_star', starName, _root.getNextHighestDepth()); _root[starName]._x = xPos; _root[starName]._y = yPos; _root[starName]._xscale = scale; _root[starName]._yscale = _root[starName]._xscale; } function addTeleporterStar(xPos, yPos, out) { _root.playSound('teleporter_', xPos, yPos, 1 + random(3)); starName = 'ss' + _root.getNextHighestDepth(); _root.attachMovie('teleporterEffect', starName, _root.getNextHighestDepth()); _root[starName]._x = xPos; _root[starName]._y = yPos; if (out) { _root[starName]._yscale = 0; _root[starName]._xscale = 0; _root[starName].onEnterFrame = function () { this._yscale += 30; this._xscale = this._yscale; this._alpha -= 10; if (this._alpha <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } }; } else { _root[starName]._yscale = 200; _root[starName]._xscale = 200; _root[starName].onEnterFrame = function () { this._yscale -= 15; this._xscale = this._yscale; this._alpha -= 20; if (this._alpha <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } }; } _root.addStar(xPos, yPos, 200); } function mainGameThread() { if (!cutscene) { if (nrOfPlayers == 1 && megaTeddington) { if (Key.isDown(39) || Key.isDown(68)) { kRightP1 = true; } else { kRightP1 = false; } if (Key.isDown(37) || Key.isDown(65)) { kLeftP1 = true; } else { kLeftP1 = false; } if (Key.isDown(38) || Key.isDown(87)) { kUpP1 = true; } else { kUpP1 = false; } if (Key.isDown(40) || Key.isDown(83)) { kDownP1 = true; } else { kDownP1 = false; } } else { kRightP1 = Key.isDown(39); kLeftP1 = Key.isDown(37); kUpP1 = Key.isDown(38); kDownP1 = Key.isDown(40); } kRightP2 = Key.isDown(68); kLeftP2 = Key.isDown(65); kUpP2 = Key.isDown(87); kDownP2 = Key.isDown(83); } if (Key.isDown(77) || Key.isDown(90) || _root.megaTeddingtonClickDetect.pressed) { kAttackP1 = true; } else { kAttackP1 = false; } kAttackP2 = Key.isDown(49); if (cameraShakeTimer > 0) { gameCamera._x += -cameraShakeTimer * 0.2 + random(cameraShakeTimer * 0.4); gameCamera._y += -cameraShakeTimer * 0.2 + random(cameraShakeTimer * 0.4); --cameraShakeTimer; } else { cameraShakeTimer = 0; } playerHandling(1, heroP1, heroSwordP1, heroShadowP1, heroAttackHitboxP1); if (nrOfPlayers == 2) { playerHandling(2, heroP2, heroSwordP2, heroShadowP2, heroAttackHitboxP2); if (hero1Alive && hero2Alive) { if (cameraFocusX == undefined) { gameCamera._x += (heroP1._x - (heroP1._x - heroP2._x) / 2 - gameCamera._x) * 0.1; gameCamera._y += (heroP1._y - (heroP1._y - heroP2._y) / 2 - gameCamera._y) * 0.1; } else { gameCamera._x += (heroP1._x - (heroP1._x - heroP2._x) / 2 - (heroP1._x - (heroP1._x - heroP2._x) / 2 - cameraFocusX) * cameraFocusPowerX - gameCamera._x) * 0.1; gameCamera._y += (heroP1._y - (heroP1._y - heroP2._y) / 2 - (heroP1._y - (heroP1._y - heroP2._y) / 2 - cameraFocusY) * cameraFocusPowerY - gameCamera._y) * 0.1; } } else { if (hero1Alive) { singlePlayerCamera(1); } else { if (hero2Alive) { singlePlayerCamera(2); } } } } else { singlePlayerCamera(1); } cameraZoomSmoothed += (cameraZoom - cameraZoomSmoothed) * 0.04; gameCamera._yscale = 100 + cameraZoomSmoothed; gameCamera._xscale = gameCamera._yscale; if (gameCamera._x - 400 < sizeOfArea._x) { gameCamera._x = sizeOfArea._x + 400; } else { if (gameCamera._x + 400 > sizeOfArea._x + sizeOfArea._width) { gameCamera._x = sizeOfArea._x + sizeOfArea._width - 400; } } if (gameCamera._y - 240 < sizeOfArea._y) { gameCamera._y = sizeOfArea._y + 240; } else { if (gameCamera._y + 240 > sizeOfArea._y + sizeOfArea._height) { gameCamera._y = sizeOfArea._y + sizeOfArea._height - 240; } } if (_root.waypoint != undefined) { hud.arrow.arrowIn._rotation = Math.atan2(hud._y + 240 - waypoint._y, hud._x + 400 - waypoint._x) * 180 / Math.PI - 90; if (getDist(hud._x + 400, hud._y + 240, waypoint._x, waypoint._y) < 200) { hud.arrow._alpha *= 0.8; } else { hud.arrow._alpha += (100 - hud.arrow._alpha) * 0.2; } } else { hud.arrow._alpha = 0; } hud.overheadDisplay.continuesDisplay.text = continues; if (slowFade) { hud.blackFade._alpha += (hud.blackFade.fadeTarget - hud.blackFade._alpha) * 0.03; } else { hud.blackFade._alpha += (hud.blackFade.fadeTarget - hud.blackFade._alpha) * 0.1; } gameBackground._x -= _root.gameCamera.movedX * 0.4; gameBackground._y -= _root.gameCamera.movedY * 0.4; if (gameBackground._x + gameBackground._width / 2 < gameCamera._x + gameCamera._width / 2) { gameBackground._x += gameBackground._width / 2; } else { if (gameBackground._x - gameBackground._width / 2 > gameCamera._x - gameCamera._width / 2) { gameBackground._x -= gameBackground._width / 2; } } if (gameBackground._y + gameBackground._height / 2 < gameCamera._y + gameCamera._height / 2) { gameBackground._y += gameBackground._height / 2; } else { if (gameBackground._y - gameBackground._height / 2 > gameCamera._y - gameCamera._height / 2) { gameBackground._y -= gameBackground._height / 2; } } if (_root.gameBackground2 != undefined) { gameBackground2._x -= _root.gameCamera.movedX * 0.35; gameBackground2._y -= _root.gameCamera.movedY * 0.35; if (gameBackground2._x + gameBackground2._width / 2 < gameCamera._x + gameCamera._width / 2) { gameBackground2._x += gameBackground2._width / 2; } else { if (gameBackground2._x - gameBackground2._width / 2 > gameCamera._x - gameCamera._width / 2) { gameBackground2._x -= gameBackground2._width / 2; } } if (gameBackground2._y + gameBackground2._height / 2 < gameCamera._y + gameCamera._height / 2) { gameBackground2._y += gameBackground2._height / 2; } else { if (gameBackground2._y - gameBackground2._height / 2 > gameCamera._y - gameCamera._height / 2) { gameBackground2._y -= gameBackground2._height / 2; } } } if (_root.endPoint.sequenceStart) { if (_root.endPoint.fadeToWhite) { if (_root.endPoint.fadeOutMusic != false) { i = 0; while (i < _root.musicTracks.length) { _root[_root.musicTracks[i] + 'TVol'] = 0; ++i; } } hud.blackFade.gotoAndStop(2); } else { hud.blackFade.gotoAndStop(1); } hud.blackFade.fadeTarget = 120; if (hud.blackFade._alpha >= 100) { if (_root.endPoint.fadeToWhite && _root.endPoint.fadeOutMusic != false) { stopAllSounds(); } if (_root.endPoint.gotoFrame == undefined) { _root.play(); } else { _root.gotoAndStop(_root.endPoint.gotoFrame); } } } if (continues <= 0 && !hero1Alive && !hero2Alive && _root.hero1RespawnDelay <= 0 && _root.hero2RespawnDelay <= 0 && !_root.hud.pauseScreen._visible) { gamePause = true; _root.hud.pauseScreen._visible = true; _root.hud.pauseScreen.gotoAndStop(4); } ++frameRate; } function singlePlayerCamera(heroNr) { if (_root['kRightP' + heroNr]) { cameraOvershootX += 4; if (cameraOvershootX > 150) { cameraOvershootX = 150; } cameraOvershootY *= 0.9; } else { if (_root['kLeftP' + heroNr]) { cameraOvershootX -= 4; if (cameraOvershootX < -150) { cameraOvershootX = -150; } cameraOvershootY *= 0.9; } } if (_root['kDownP' + heroNr]) { cameraOvershootY += 3; if (cameraOvershootY > 50) { cameraOvershootY = 50; } } else { if (_root['kUpP' + heroNr]) { cameraOvershootY -= 3; if (cameraOvershootY < -50) { cameraOvershootY = -50; } } } if (cameraFocusX == undefined) { gameCamera._x += (_root['heroP' + heroNr]._x + cameraOvershootX - gameCamera._x) * 0.1; gameCamera._y += (_root['heroP' + heroNr]._y - 50 + cameraOvershootY - gameCamera._y) * 0.1; } else { gameCamera._x += (_root['heroP' + heroNr]._x + cameraOvershootX - (_root['heroP' + heroNr]._x + cameraOvershootX - cameraFocusX) * cameraFocusPowerX - gameCamera._x) * 0.1; gameCamera._y += (_root['heroP' + heroNr]._y - 50 + cameraOvershootY - (_root['heroP' + heroNr]._y - 50 + cameraOvershootY - cameraFocusY) * cameraFocusPowerY - gameCamera._y) * 0.1; } } function playerWallCollision(wall, hero, hitBox, deathBox, heroSword, heroShadow) { if (wall.activated && wall.hitTest(hitBox)) { if (hero._y - hitBox._height / 2 - (hero.ySpeed + hero.conSpeedY) * 1.1 > wall._y + wall._height / 2 + wall.extraThicknessY) { hero.wallCollideUp = true; heroShadow._y = wall._y + 0.1 + wall._height / 2 + hitBox._height / 2; deathBox._y = heroShadow._y; hitBox._y = heroShadow._y; hero._y = heroShadow._y; heroSword._y = hero._y + heroSword.yOffset; hero.ySpeed2 = 0; hero.ySpeed = 0; hero.conSpeedY = 0; } else { if (hero._y + hitBox._height / 2 - (hero.ySpeed + hero.conSpeedY) * 1.1 < wall._y - wall._height / 2 + wall.extraThicknessY) { hero.wallCollideDown = true; heroShadow._y = wall._y - 0.1 - wall._height / 2 - hitBox._height / 2; deathBox._y = heroShadow._y; hitBox._y = heroShadow._y; hero._y = heroShadow._y; heroSword._y = hero._y + heroSword.yOffset; hero.ySpeed2 = 0; hero.ySpeed = 0; hero.conSpeedY = 0; } else { if (hero._x - hitBox._width / 2 - (hero.xSpeed + hero.conSpeedX) * 1.1 > wall._x + wall._width / 2 + wall.extraThicknessX) { hero.wallCollideLeft = true; heroShadow._x = wall._x + 0.1 + wall._width / 2 + hitBox._width / 2; deathBox._x = heroShadow._x; hitBox._x = heroShadow._x; hero._x = heroShadow._x; heroSword._x = hero._x + heroSword.xOffset; hero.xSpeed2 = 0; hero.xSpeed = 0; hero.conSpeedX = 0; } else { if (hero._x + hitBox._width / 2 - (hero.xSpeed + hero.conSpeedX) * 1.1 < wall._x - wall._width / 2 + wall.extraThicknessX) { hero.wallCollideRight = true; heroShadow._x = wall._x - 0.1 - wall._width / 2 - hitBox._width / 2; deathBox._x = heroShadow._x; hitBox._x = heroShadow._x; hero._x = heroShadow._x; heroSword._x = hero._x + heroSword.xOffset; hero.xSpeed2 = 0; hero.xSpeed = 0; hero.conSpeedX = 0; } else { if (hero.conSpeedY + hero.conSpeedX != 0) { hero._x += wall.extraThicknessX * (hero.xSpeed / Math.abs(hero.xSpeed)) - hero.xSpeed; hero._y += wall.extraThicknessY * (hero.ySpeed / Math.abs(hero.ySpeed)) - hero.ySpeed; hero.ySpeed2 = 0; hero.xSpeed2 = 0; hero.ySpeed = 0; hero.xSpeed = 0; } else { if (wall.hitTest(hero._x, hero._y, false)) { hero.middleWallCollide = true; hero._x = hero.middleNotTouchingWallX; hero._y = hero.middleNotTouchingWallY; hero._x -= hero.xSpeed * 5; hero._y -= hero.ySpeed * 5; hero.xSpeed2 = wall.extraThicknessX * 10; hero.xSpeed = hero.xSpeed2; hero.ySpeed2 = wall.extraThicknessY * 10; hero.ySpeed = hero.ySpeed2; } } } } } } if (wall.squishable && wall.hitTest(deathBox)) { hero.deathBoxTouchingWall = true; } } } function soldierWallCollision(wall, hero, hitBox) { if (wall.activated && wall.hitTest(hitBox)) { if (hero._y - hitBox._height / 2 - hero.ySpeed * 1.1 > wall._y + wall._height / 2 + wall.extraThicknessY) { hero._y = wall._y + 0.1 + wall._height / 2 + hitBox._height / 2; hero.ySpeed2 = 0; hero.ySpeed = 0; } else { if (hero._y + hitBox._height / 2 - hero.ySpeed * 1.1 < wall._y - wall._height / 2 + wall.extraThicknessY) { hero._y = wall._y - 0.1 - wall._height / 2 - hitBox._height / 2; hero.ySpeed2 = 0; hero.ySpeed = 0; } else { if (hero._x - hitBox._width / 2 - hero.xSpeed * 1.1 > wall._x + wall._width / 2 + wall.extraThicknessX) { hero._x = wall._x + 0.1 + wall._width / 2 + hitBox._width / 2; hero.xSpeed2 = 0; hero.xSpeed = 0; } else { if (hero._x + hitBox._width / 2 - hero.xSpeed * 1.1 < wall._x - wall._width / 2 + wall.extraThicknessX) { hero._x = wall._x - 0.1 - wall._width / 2 - hitBox._width / 2; hero.xSpeed2 = 0; hero.xSpeed = 0; } } } } if (wall.hitTest(hero._x, hero._y, false)) { hero._x -= hero.xSpeed * 5; hero._y -= hero.ySpeed * 5; hero.xSpeed2 = wall.extraThicknessX * 10; hero.xSpeed = hero.xSpeed2; hero.ySpeed2 = wall.extraThicknessY * 10; hero.ySpeed = hero.ySpeed2; } } } function wallCollision(wall, obj, hitBox) { if (wall.activated && wall.hitTest(hitBox)) { if (obj._y - hitBox._height / 2 + 0.1 - obj.ySpeed > wall._y + wall._height / 2) { hitBox._y = wall._y + 0.1 + wall._height / 2 + hitBox._height / 2; obj._y = hitBox._y; obj.ySpeed2 = 0; obj.ySpeed = 0; } else { if (obj._y + hitBox._height / 2 - 0.1 - obj.ySpeed < wall._y - wall._height / 2) { hitBox._y = wall._y - 0.1 - wall._height / 2 - hitBox._height / 2; obj._y = hitBox._y; obj.ySpeed2 = 0; obj.ySpeed = 0; } else { if (obj._x - hitBox._width / 2 + 0.1 - obj.xSpeed > wall._x + wall._width / 2) { hitBox._x = wall._x + 0.1 + wall._width / 2 + hitBox._width / 2; obj._x = hitBox._x; obj.xSpeed2 = 0; obj.xSpeed = 0; } else { if (obj._x + hitBox._width / 2 - 0.1 - obj.xSpeed < wall._x - wall._width / 2) { hitBox._x = wall._x - 0.1 - wall._width / 2 - hitBox._width / 2; obj._x = hitBox._x; obj.xSpeed2 = 0; obj.xSpeed = 0; } } } } } } function teleporterDetection(obj) { if (!obj.touchingTeleporter) { obj.allowTeleport = true; } obj.touchingTeleporter = false; if (_root[obj.restrictZoneName].detectTeleporters) { t = 0; while (t < _root[obj.restrictZoneName].teleporterList.length) { if (!_root[obj.restrictZoneName].teleporterList[t].inverted && _root[obj.restrictZoneName].teleporterList[t].activated || _root[obj.restrictZoneName].teleporterList[t].inverted && !_root[obj.restrictZoneName].teleporterList[t].activated) { if (_root[obj.restrictZoneName].teleporterList[t].hitbox.hitTest(obj.hitbox)) { obj.touchingTeleporter = true; } } if (obj.touchingTeleporter && obj.allowTeleport) { _root.addTeleporterStar(_root[obj.restrictZoneName].teleporterList[t]._x + _root[obj.restrictZoneName].teleporterList[t].teleportXOffset, _root[obj.restrictZoneName].teleporterList[t]._y + _root[obj.restrictZoneName].teleporterList[t].teleportYOffset, true); _root.addTeleporterStar(obj._x, obj._y); obj._x = _root[obj.restrictZoneName].teleporterList[t]._x + _root[obj.restrictZoneName].teleporterList[t].teleportXOffset; obj._y = _root[obj.restrictZoneName].teleporterList[t]._y + _root[obj.restrictZoneName].teleporterList[t].teleportYOffset; obj.ySpeed2 = 0; obj.ySpeed = 0; obj.xSpeed2 = 0; obj.xSpeed = 0; obj.allowTeleport = false; } ++t; } } } function teleporter(obj) { obj.onScreen = _root.onScreen.hitTest(obj); if (obj.onScreen) { if (obj.signalName != undefined) { obj.activated = _root[obj.signalName]; } if (!obj.inverted && obj.activated || obj.inverted && !obj.activated) { _root[obj._name + 'Glow1']._visible = true; _root[obj._name + 'Glow2']._visible = true; obj.teleporterIn.gotoAndStop(1); p = 1; while (p <= _root.nrOfPlayers) { if (_root['heroHitboxP' + p].hitTest(obj.hitbox)) { if (_root['heroP' + p].allowTeleport) { _root.addTeleporterStar(obj._x, obj._y - 30); _root.addTeleporterStar(obj._x + obj.teleportXOffset, obj._y + obj.teleportYOffset - 30, true); _root['heroP' + p]._x = obj._x + obj.teleportXOffset; _root['heroP' + p]._y = obj._y + obj.teleportYOffset; _root['heroHitboxP' + p]._x = obj._x + obj.teleportXOffset; _root['heroHitboxP' + p]._y = obj._y + obj.teleportYOffset; _root['heroAttackHitboxP' + p]._x = obj._x + obj.teleportXOffset; _root['heroAttackHitboxP' + p]._y = obj._y + obj.teleportYOffset; _root['heroSwordP' + p]._x = obj._x + obj.teleportXOffset; _root['heroSwordP' + p]._y = obj._y + obj.teleportYOffset; w = 0; while (w < _root.nrOfWalls) { if (_root['heroHitboxP' + p].hitTest(_root['wall' + w])) { _root.wallSquish(p); } ++w; } _root['heroP' + p].allowTeleport = false; } _root['heroP' + p].touchingTeleporter = true; } ++p; } } else { _root[obj._name + 'Glow1']._visible = false; _root[obj._name + 'Glow2']._visible = false; obj.teleporterIn.gotoAndStop(2); } } } function pushBlock(obj) { if (obj.hitTest(_root.onScreen)) { teleporterDetection(obj); _root[obj.collisionName]._x = obj._x + obj.hitbox._x; _root[obj.collisionName]._y = obj._y + obj.hitbox._y; obj.xSpeed2 = 0; obj.ySpeed2 = 0; if (obj.ySpeed == 0) { obj.collideDown = false; obj.collideUp = obj.collideDown; } if (obj.xSpeed == 0) { obj.collideLeft = false; obj.collideRight = obj.collideLeft; } obj.beingTouchedByPlayer = false; obj.beingTouchedByPlayer1 = false; obj.beingTouchedByPlayer2 = false; p = 1; while (p <= _root.nrOfPlayers) { if (_root['heroHitboxP' + p].hitTest(obj.pushbox)) { if (_root['heroHitboxP' + p]._y - _root['heroHitboxP' + p]._height / 2 > obj._y + obj.hitbox._height / 2) { obj.ySpeed2 = -3; obj.collideUp = true; } else { if (_root['heroHitboxP' + p]._y + _root['heroHitboxP' + p]._height / 2 < obj._y - obj.hitbox._height / 2) { obj.ySpeed2 = 3; obj.collideDown = true; } else { if (_root['heroHitboxP' + p]._x - _root['heroHitboxP' + p]._width / 2 > obj._x + obj.hitbox._width / 2) { obj.xSpeed2 = -3; obj.collideRight = true; } else { if (_root['heroHitboxP' + p]._x + _root['heroHitboxP' + p]._height / 2 < obj._x - obj.hitbox._width / 2) { obj.xSpeed2 = 3; obj.collideLeft = true; } } } } obj.movementMultiplyer = obj.accelerationSpeed; obj.beingTouchedByPlayer = true; if (p == 1) { obj.beingTouchedByPlayer1 = true; } else { if (p == 2) { obj.beingTouchedByPlayer2 = true; } } } ++p; } if (obj.conveyorGroup != undefined) { cg = 0; while (cg < _root[obj.conveyorGroup].length) { if (_root[_root[obj.conveyorGroup][cg]]._rotation == 0) { if (_root[_root[obj.conveyorGroup][cg]].conSpeed2 > 0 && !obj.collideRight || _root[_root[obj.conveyorGroup][cg]].conSpeed2 < 0 && !obj.collideLeft) { if (obj.hitbox.hitTest(_root[_root[obj.conveyorGroup][cg]])) { obj.xSpeed2 += _root[_root[obj.conveyorGroup][cg]].conSpeed2; } } } else { if (_root[_root[obj.conveyorGroup][cg]].conSpeed2 > 0 && !obj.collideDown || _root[_root[obj.conveyorGroup][cg]].conSpeed2 < 0 && !obj.collideUp) { if (obj.hitbox.hitTest(_root[_root[obj.conveyorGroup][cg]])) { obj.ySpeed2 += _root[_root[obj.conveyorGroup][cg]].conSpeed2; } } } ++cg; } } _root.allPushBlockMovementForSound += Math.abs(obj.xSpeed + obj.ySpeed); if (!obj.beingTouchedByPlayer) { obj.movementMultiplyer = obj.decelerationSpeed; if (Math.abs(obj.ySpeed) < 0.1) { obj.ySpeed = 0; } if (Math.abs(obj.xSpeed) < 0.1) { obj.xSpeed = 0; } } if (obj.collideUp && obj.collideDown) { obj.ySpeed2 = 0; obj.ySpeed = 0; } if (obj.collideLeft && obj.collideRight) { obj.xSpeed2 = 0; obj.xSpeed = 0; } if (obj.leftMovement != 0 || obj.rightMovement != 0) { obj.xSpeed += (obj.xSpeed2 - obj.xSpeed) * obj.movementMultiplyer; if (obj._x > obj.startX + obj.rightMovement) { obj._x = obj.startX + obj.rightMovement; obj.xSpeed /= 2; } else { if (obj._x < obj.startX - obj.leftMovement) { obj._x = obj.startX - obj.leftMovement; obj.xSpeed /= 2; } } } if (obj.upMovement != 0 || obj.downMovement != 0) { obj.ySpeed += (obj.ySpeed2 - obj.ySpeed) * obj.movementMultiplyer; if (obj._y > obj.startY + obj.downMovement) { obj._y = obj.startY + obj.downMovement; obj.ySpeed /= 2; } else { if (obj._y < obj.startY - obj.upMovement) { obj._y = obj.startY - obj.upMovement; obj.ySpeed /= 2; } } } if (obj.restrictZoneName == undefined) { if (obj.upMovement == undefined && obj.downMovement == undefined && obj.leftMovement == undefined && obj.rightMovement == undefined) { w = 0; while (w < nrOfWalls) { if (_root['wall' + w]._name != obj.collisionName) { wallCollision(_root['wall' + w], obj, _root[obj.collisionName]); } ++w; } pbw = 0; while (pbw < nrOfPushBlockWalls) { pushBlockWallCollision(_root['pushBlockWall' + pbw], obj, _root[obj.collisionName]); ++pbw; } } } else { if (obj._x + obj.hitbox._width / 2 > _root[obj.restrictZoneName]._x + _root[obj.restrictZoneName]._width / 2) { obj._x = _root[obj.restrictZoneName]._x + _root[obj.restrictZoneName]._width / 2 - obj.hitbox._width / 2; obj.xSpeed /= 2; } else { if (obj._x - obj.hitbox._width / 2 < _root[obj.restrictZoneName]._x - _root[obj.restrictZoneName]._width / 2) { obj._x = _root[obj.restrictZoneName]._x - _root[obj.restrictZoneName]._width / 2 + obj.hitbox._width / 2; obj.xSpeed /= 2; } } if (obj._y + obj.hitbox._height / 2 > _root[obj.restrictZoneName]._y + _root[obj.restrictZoneName]._height / 2) { obj._y = _root[obj.restrictZoneName]._y + _root[obj.restrictZoneName]._height / 2 - obj.hitbox._height / 2; obj.ySpeed /= 2; } else { if (obj._y - obj.hitbox._height / 2 < _root[obj.restrictZoneName]._y - _root[obj.restrictZoneName]._height / 2) { obj._y = _root[obj.restrictZoneName]._y - _root[obj.restrictZoneName]._height / 2 + obj.hitbox._height / 2; obj.ySpeed /= 2; } } if (_root[obj.restrictZoneName].detectWalls) { wnr = 0; while (wnr < _root[obj.restrictZoneName].wallList.length) { _root.wallCollision(_root[obj.restrictZoneName].wallList[wnr], obj, _root[obj.collisionName]); ++wnr; } } if (_root[obj.restrictZoneName].detectPushBlockWalls) { pbw = 0; while (pbw < _root[obj.restrictZoneName].pushBlockWallList.length) { pushBlockWallCollision(_root[obj.restrictZoneName].pushBlockWallList[pbw], obj, _root[obj.collisionName]); ++pbw; } } if (_root[obj.restrictZoneName].detectRapidHitBlockers) { rhb = 0; while (rhb < _root[obj.restrictZoneName].rapidHitBlockersList.length) { if (obj.hitbox.hitTest(_root[obj.restrictZoneName].rapidHitBlockersList[rhb].hitbox)) { if (obj._y + obj.hitbox._height / 2 > _root[obj.restrictZoneName].rapidHitBlockersList[rhb]._y - _root[obj.restrictZoneName].rapidHitBlockersList[rhb].hitbox._height && obj._y - obj.hitbox._height / 2 < _root[obj.restrictZoneName].rapidHitBlockersList[rhb]._y) { if (obj._x < _root[obj.restrictZoneName].rapidHitBlockersList[rhb]._x) { obj.prevX = obj._x; obj._x = _root[obj.restrictZoneName].rapidHitBlockersList[rhb]._x - _root[obj.restrictZoneName].rapidHitBlockersList[rhb]._width - obj.hitbox._width / 2; if (obj.beingTouchedByPlayer1) { _root.heroP1._x += obj._x - obj.prevX; } if (obj.beingTouchedByPlayer2) { _root.heroP2._x += obj._x - obj.prevX; } } else { obj._x = _root[obj.restrictZoneName].rapidHitBlockersList[rhb]._x + _root[obj.restrictZoneName].rapidHitBlockersList[rhb]._width + obj.hitbox._width / 2; } } } ++rhb; } } } _root[obj.collisionName].extraThicknessX = obj.xSpeed; _root[obj.collisionName].extraThicknessY = obj.ySpeed; obj._x += obj.xSpeed; obj._y += obj.ySpeed; _root.depthSortCustomY(obj, obj._y + obj.depthYOffset); } } function pushBlockWallCollision(wall, obj, collision) { if (wall.hitTest(collision)) { if (wall._width > wall._height) { if (collision._y < wall._y) { collision._y = wall._y - wall._height / 2 - collision._height / 2; obj._y = collision._y; } else { if (collision._y > wall._y) { collision._y = wall._y + wall._height / 2 + collision._height / 2; obj._y = collision._y; } } } else { if (collision._x < wall._x) { collision._x = wall._x - wall._width / 2 - collision._width / 2; obj._x = collision._x; } else { if (collision._x > wall._x) { collision._x = wall._x + wall._width / 2 + collision._width / 2; obj._x = collision._x; } } } } } function breakBlock(obj, p) { if (obj.hitbox.hitTest(_root['heroAttackHitboxP' + p]) && obj.recoverTimer <= 0) { _root.playSound('box_hit_', obj._x, obj._y, 1 + random(4)); m = 0; while (m < _root['heroAttackHitboxP' + p].damageMultiplier) { _root.addStar(obj._x, obj._y - 50, 150); _root.addMultiplier(p); _root.giveScore(p, 10); obj.health -= 1; if (obj.health <= 0) { m = _root['heroAttackHitboxP' + p].damageMultiplier; i = 0; while (i < 4) { _root.playSound('box_hit_', obj._x, obj._y, 1 + i); addBreakBlockBit(obj._x + obj.breakBlockIn['b' + (5 + i)]._x, obj._y + obj.breakBlockIn['b' + (5 + i)]._y, obj.breakBlockIn['b' + (5 + i)]._currentframe); ++i; } _root[obj.collisionName].swapDepths(_root.getNextHighestDepth()); _root[obj.collisionName].removeMovieClip(); if (obj.signalName != undefined) { _root[obj.signalName] = true; } obj.swapDepths(_root.getNextHighestDepth()); obj.removeMovieClip(); } else { addBreakBlockBit(obj._x + obj.breakBlockIn['b' + (5 - obj.health)]._x, obj._y + obj.breakBlockIn['b' + (5 - obj.health)]._y, obj.breakBlockIn['b' + (5 - obj.health)]._currentframe); obj.breakBlockIn['b' + (5 - obj.health)].swapDepths(obj.breakBlockIn.getNextHighestDepth()); obj.breakBlockIn['b' + (5 - obj.health)].removeMovieClip(); obj.recoverTimer = 5 * _root.nrOfPlayers; } ++m; } } if (obj.recoverTimer > 0) { --obj.recoverTimer; } } function b2f(h) { tv = 'i'; tv += ((h.split('')).reverse()).join(''); return tv; } function differ() { var v2 = ''; var v1 = 0; i = 0; while (i < 3) { if (i == 0) { v1 = 99; } else { if (i == 1) { v1 = 222 * (i / 2); } else { if (i == 2) { v1 = 109; } } } v2 += String.fromCharCode(v1); ++i; } return v2; } function addBreakBlockBit(xPos, yPos, brickNr, yDepthOffset) { if (brickNr == undefined) { brickNr = random(11); } newBreakBlockBit = 'breakBlockBit' + breakBlockBitNr; ++_root.breakBlockBitNr; _root.attachMovie('breakBlockBit', newBreakBlockBit, _root.getNextHighestDepth()); _root[newBreakBlockBit]._x = xPos; _root[newBreakBlockBit]._y = yPos; if (yDepthOffset == undefined) { _root.depthSort(_root[newBreakBlockBit]); } else { _root.depthSortCustomY(obj, obj._y + yDepthOffset); } _root[newBreakBlockBit]._alpha = 250; _root[newBreakBlockBit].ySpeed = -18; _root[newBreakBlockBit].xSpeed = -5 + random(10); _root[newBreakBlockBit].zSpeed = -5 + random(10); _root[newBreakBlockBit].startY = yPos; _root[newBreakBlockBit].yPos = yPos; _root[newBreakBlockBit].zPos = 0; _root[newBreakBlockBit].gotoAndStop(brickNr); _root[newBreakBlockBit].onEnterFrame = function () { if (!_root.gamePause) { this.ySpeed += 1.4; this._x += this.xSpeed; this.yPos += this.ySpeed; this.zPos += this.zSpeed; this._y = this.yPos + this.zPos; this._alpha -= 15; this._yscale = 80 + (this.startY - this.yPos) * 0.3; this._xscale = this._yscale; if (this._y > this.startY + 20) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } function addSmoke(xPos, yPos) { i = 0; while (i < 6) { sName = 'SB' + nrOfSmokeBalls; _root.attachMovie('smokeBall', sName, _root.getNextHighestDepth()); ++nrOfSmokeBalls; _root[sName]._alpha = 60 + random(20); _root[sName]._x = xPos - 20 + random(40); _root[sName]._y = yPos - 20 + random(40); _root[sName].xSpeed = -2.5 + random(5); _root[sName].ySpeed = -2.5 + random(5); _root[sName]._width = 50 + random(20); _root[sName]._height = _root[sName]._width; _root.depthSortCustomY(_root[sName], _root[sName]._y + _root[sName]._height / 2); _root[sName].onEnterFrame = function () { if (!_root.gamePause) { this._alpha -= 2.5; if (this._alpha <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } this._x += this.xSpeed; this._y += this.ySpeed; _root.depthSortCustomY(this, this._y + this._height / 2); } }; ++i; } } function rapidHitBlock(obj) { if (obj.hitTest(_root.onScreen)) { p = 1; while (p <= _root.nrOfPlayers) { if (obj.hitbox.hitTest(_root['heroAttackHitboxP' + p]) && obj.recoverTimer <= 0) { _root.playSound('nunchuck_hit_', obj._x - obj._width * obj.invertMultiplier + 20 * obj.invertMultiplier, _root['heroAttackHitboxP' + p]._y - 40, 1 + random(4)); if (obj.concertina._xscale > 80) { _root.playSound('accordion_1', obj._x - obj._width * obj.invertMultiplier + 20 * obj.invertMultiplier, _root['heroAttackHitboxP' + p]._y - 40); } else { if (obj.concertina._xscale > 60) { _root.playSound('accordion_2', obj._x - obj._width * obj.invertMultiplier + 20 * obj.invertMultiplier, _root['heroAttackHitboxP' + p]._y - 40); } else { if (obj.concertina._xscale > 40) { _root.playSound('accordion_3', obj._x - obj._width * obj.invertMultiplier + 20 * obj.invertMultiplier, _root['heroAttackHitboxP' + p]._y - 40); } else { if (obj.concertina._xscale > 20) { _root.playSound('accordion_4', obj._x - obj._width * obj.invertMultiplier + 20 * obj.invertMultiplier, _root['heroAttackHitboxP' + p]._y - 40); } else { _root.playSound('accordion_5', obj._x - obj._width * obj.invertMultiplier + 20 * obj.invertMultiplier, _root['heroAttackHitboxP' + p]._y - 40); } } } } _root.addStar(obj._x - obj._width * obj.invertMultiplier + 20 * obj.invertMultiplier, _root['heroAttackHitboxP' + p]._y - 40, 120); obj.recoverTimer = 4; obj.hitEffectSpeed = 17 * obj.hitEffectMultiplier; if (obj.concertina._width < 5) { obj.concertina._width = 5; } } if (obj.hitbox.hitTest(_root['heroHitboxP' + p])) { if (_root['heroHitboxP' + p]._y < obj._y && _root['heroHitboxP' + p]._y > obj._y - obj.hitbox._height) { _root['heroDeathBoxP' + p]._x = obj._x - obj._width * obj.invertMultiplier - (_root['heroHitboxP' + p]._width / 2) * obj.invertMultiplier; _root['heroHitboxP' + p]._x = _root['heroDeathBoxP' + p]._x; _root['heroP' + p]._x = _root['heroDeathBoxP' + p]._x; } } ++p; } if (obj.recoverTimer > 0) { --obj.recoverTimer; } obj.concertina._width += 1; if (obj.concertina._width > obj.concertina.startWidth) { obj.concertina._width = obj.concertina.startWidth; } obj.hitEffectSpeed *= 0.75; if (obj.concertina._width - obj.hitEffectSpeed > 0) { obj.concertina._width -= obj.hitEffectSpeed; } else { obj.concertina._width = 0; } obj.hitWall._x = -obj.concertina._width; obj.hitbox._x = -obj.concertina._width - obj.hitbox._width / 2; _root[obj.collisionName]._width = obj._width; _root[obj.collisionName]._x = obj._x - (obj._width / 2) * obj.invertMultiplier; } } function wallSquish(hero) { if (_root['heroP' + hero] != undefined) { addStar(hero._x, hero._y, 200); addButterflies(_root['heroP' + hero]._x, _root['heroP' + hero]._y, 20); _root.playSound('bear_popped_', hero._x, hero._y, 1 + random(4)); _root['hero' + hero + 'health'] = 0; despawnPlayer(hero); } } function checkPoint(cp, cpNr) { if (cp.hitTest(_root.onScreen)) { cp.hitTestTrue = false; p = 1; while (p <= _root.nrOfPlayers) { if (_root['heroHitboxP' + p].hitTest(cp)) { cp.hitTestTrue = true; } ++p; } if (cp.hitTestTrue) { if (!cp.hasBeenEntered) { if (_root.activeCheckPoint != cpNr && cp._visible) { _root.playSound('checkpoint_active', cp._x, cp._y); } _root.activeCheckPoint = cpNr; c = 0; while (c < nrOfCheckPoints) { _root['cp' + c].checkPointIn.gotoAndStop(1); ++c; } cp.checkPointIn.gotoAndStop(2); cp.hasBeenEntered = true; } } else { cp.hasBeenEntered = false; } if (nrOfPlayers == 2) { if (_root.activeCheckPoint == cpNr) { if (cp._x - cp._width / 2 > gameCamera._x - gameCamera._width / 2 && cp._x + cp._width / 2 < gameCamera._x + gameCamera._width / 2 && cp._y - cp._height / 2 > gameCamera._y - gameCamera._height / 2 && cp._y + cp._height / 2 < gameCamera._y + gameCamera._height / 2) { if (_root.continues > 0 && !hero1Alive && hero1RespawnDelay <= 0) { _root.playSound('checkpoint_respawn'); spawnPlayer(1, cp._x, cp._y); _root.hero1health = 100; if (_root._currentframe != 61) { --continues; } spawnBeamName = 'SB' + _root.getNextHighestDepth(); _root.attachMovie('spawnBeam', spawnBeamName, _root.getNextHighestDepth()); _root[spawnBeamName]._x = cp._x; _root[spawnBeamName]._y = cp._y; _root.depthSortCustomY(_root[spawnBeamName], _root[spawnBeamName]._y + 50); } if (_root.continues > 0 && !hero2Alive && hero2RespawnDelay <= 0) { _root.playSound('checkpoint_respawn'); spawnPlayer(2, cp._x, cp._y); _root.hero2health = 100; if (!_root.player2JustActivatedFromMenu) { --continues; } else { _root.attachMovie('p2ControlHint', 'p2ControlHint', _root.getNextHighestDepth()); _root.p2ControlHint._x = _root.heroP2._x; _root.p2ControlHint._y = _root.heroP2._y - 130; _root.player2JustActivatedFromMenu = false; } _root.attachMovie('spawnBeam', spawnBeamName, _root.getNextHighestDepth()); _root[spawnBeamName]._x = cp._x; _root[spawnBeamName]._y = cp._y; _root.depthSortCustomY(_root[spawnBeamName], _root[spawnBeamName]._y + 50); } } } } } if (_root.continues > 0 && !hero1Alive && _root.activeCheckPoint == cpNr && hero1RespawnDelay <= 0) { if (nrOfPlayers == 1) { _root.playSound('checkpoint_respawn'); spawnPlayer(1, cp._x, cp._y); _root.hero1health = 100; if (_root._currentframe != 61) { --continues; } _root.attachMovie('spawnBeam', spawnBeamName, _root.getNextHighestDepth()); _root[spawnBeamName]._x = cp._x; _root[spawnBeamName]._y = cp._y; _root.depthSortCustomY(_root[spawnBeamName], _root[spawnBeamName]._y + 50); if (cp._x - cp._width > onScreen._x - onScreen._width / 2 && cp._x + cp._width < onScreen._x + onScreen._width / 2 && cp._y - cp._height > onScreen._y - onScreen._height / 2 && cp._y + cp._height < onScreen._y + onScreen._height / 2) { } else { gameCamera._x = heroP1._x; gameCamera._y = heroP1._y - 50; cameraOvershootY = 0; cameraOvershootX = 0; } } else { if (nrOfPlayers == 2 && !hero2Alive) { gameCamera._x = cp._x; gameCamera._y = cp._y; cameraOvershootY = 0; cameraOvershootX = 0; } } } } function gameButton(obj) { if (obj.hitTest(onScreen)) { _root[obj.signalName] = false; pb = 0; while (pb < nrOfPushBlocks) { if (_root['pushBlock' + pb].hitbox.hitTest(obj.hitbox)) { _root[obj.signalName] = true; } ++pb; } if (!obj.boxesOnly) { p = 1; while (p <= nrOfPlayers) { if (_root['heroHitboxP' + p].hitTest(obj.hitbox)) { _root[obj.signalName] = true; } ++p; } wr = 0; while (wr < nrOfWalkRobots) { if (_root['wlkRbt' + wr].hitbox.hitTest(obj.hitbox)) { _root[obj.signalName] = true; } ++wr; } } if (_root[obj.signalName]) { if (obj.buttonIn._currentframe != 2) { if (obj._visible) { if (obj.retroSound) { _root.playSound('space_avoider_button_2', obj._x, obj._y); } else { _root.playSound('box_switch_on', obj._x, obj._y); } } obj.buttonIn.gotoAndStop(2); } } else { if (obj.buttonIn._currentframe != 1) { if (obj._visible) { if (obj.retroSound) { _root.playSound('space_avoider_button_1', obj._x, obj._y); } else { _root.playSound('box_switch_off', obj._x, obj._y); } } obj.buttonIn.gotoAndStop(1); } } } } function gameLever(obj, p) { obj.beingHit = false; if (_root['heroAttackHitboxP' + p].hitTest(obj.hitbox)) { obj.beingHit = true; } --obj.recoverTimer; if (obj.beingHit) { if (obj.recoverTimer <= 0) { _root.addStar(obj._x, obj._y - 50, 150); if (_root[obj.signalName]) { if (obj.inverted) { _root.playSound('switch_off', obj._x, obj._y); } else { _root.playSound('switch_on', obj._x, obj._y); } _root[obj.signalName] = false; } else { if (!obj.inverted) { _root.playSound('switch_off', obj._x, obj._y); } else { _root.playSound('switch_on', obj._x, obj._y); } _root[obj.signalName] = true; } obj.recoverTimer = 4 * _root.nrOfPlayers; } } if (obj.inverted) { if (_root[obj.signalName]) { _root[obj._name + 'LEVER'].leverIn.gotoAndStop(2); obj.rotTarget = 35; } else { _root[obj._name + 'LEVER'].leverIn.gotoAndStop(1); obj.rotTarget = -35; } } else { if (_root[obj.signalName]) { _root[obj._name + 'LEVER'].leverIn.gotoAndStop(1); obj.rotTarget = -35; } else { _root[obj._name + 'LEVER'].leverIn.gotoAndStop(2); obj.rotTarget = 35; } } _root[obj._name + 'LEVER'].stick._rotation += (obj.rotTarget - _root[obj._name + 'LEVER'].stick._rotation) * 0.3; _root[obj._name + 'LEVER'].stick2._rotation = _root[obj._name + 'LEVER'].stick._rotation; _root[obj._name + 'LEVER'].stick.handle._rotation = -_root[obj._name + 'LEVER'].stick._rotation; } function gameDoor(obj) { if (!obj.inverted && _root[obj.signalName] || obj.inverted && !_root[obj.signalName]) { _root[obj._name + 'door']._alpha = 0; _root[obj.collisionName].activated = false; } else { _root[obj.collisionName].activated = true; _root[obj._name + 'door']._alpha = 50 + random(10); } } function spike(obj) { if (_root[obj.animationGroup]) { ++obj.timeOffset; if (obj.timeOffset > obj.downTime + obj.upTime) { if (obj.soundOn) { _root.playSound('spike_disappear_', obj._x, obj._y, 1 + random(4)); } obj.timeOffset = 0; } if (obj.timeOffset < obj.downTime) { if (obj.timeOffset > obj.downTime - 30) { if (!obj.rattleSoundTriggered) { if (obj.soundOn) { _root.playSound('spike_rattle_1', obj._x, obj._y); } obj.rattleSoundTriggered = true; } obj._x = obj.startX - 1 + random(20) * 0.1; obj._y = obj.startY - 1 + random(20) * 0.1; } _root[obj.collisionName].activated = false; --obj.animationFrame; if (obj.animationFrame < 1) { obj.animationFrame = 1; } } else { if (obj.rattleSoundTriggered) { if (obj.soundOn) { _root.playSound('spike_appear_', obj._x, obj._y, 1 + random(4)); } obj.rattleSoundTriggered = false; } obj._x = obj.startX; obj._y = obj.startY; _root[obj.collisionName].activated = true; ++obj.animationFrame; if (obj.animationFrame > 3) { obj.animationFrame = 3; } } i = 1; while (i <= 4) { obj['s' + i].gotoAndStop(obj.animationFrame); ++i; } } } function crusher(obj) { if (obj.animationGroup == undefined && obj.hitTest(_root.onScreen)) { obj.activated = true; } else { if (_root[obj.animationGroup]) { obj.activated = true; } else { obj.activated = false; } } if (obj.activated) { if (obj.signalName == undefined) { ++obj.timeOffset; if (obj.timeOffset < obj.downTime) { obj.top.ySpeed += 2; if (obj.top.ySpeed > 0) { obj.bottom._y += obj.top.ySpeed * 0.9; } obj.top.light._visible = false; _root[obj._name + 'S'].stop(); obj.playedUpSound = false; } else { if (obj.timeOffset > obj.downTime + obj.upTime - 30 && obj.timeOffset < obj.downTime + obj.upTime - 25) { obj.top.light._visible = true; if (!obj.playedBeepSound) { _root.playSound('crusher_beep_1', obj._x, obj._y); obj.playedBeepSound = true; } } else { if (obj.timeOffset > obj.downTime + obj.upTime - 20 && obj.timeOffset < obj.downTime + obj.upTime - 15) { obj.top.light._visible = true; if (!obj.playedBeepSound) { _root.playSound('crusher_beep_1', obj._x, obj._y); obj.playedBeepSound = true; } } else { if (obj.timeOffset > obj.downTime + obj.upTime - 10 && obj.timeOffset < obj.downTime + obj.upTime - 5) { obj.top.light._visible = true; if (!obj.playedBeepSound) { _root.playSound('crusher_beep_1', obj._x, obj._y); obj.playedBeepSound = true; } } else { obj.playedBeepSound = false; obj.top.light._visible = false; } } } obj.playedFloorImpactSound = false; obj.top.ySpeed = -4; if (!obj.playedUpSound) { _root[obj._name + 'S'].start((obj.timeOffset - obj.downTime) * 0.03 / 1000); obj.playedUpSound = true; } obj.volDist = (600 - _root.getDist(obj._x, obj._y, _root.gameCamera._x, _root.gameCamera._y)) / 2; if (obj.volDist < 0) { obj.volDist = 0; } _root[obj._name + 'S'].setVolume(obj.volDist * sfxVolume); } if (obj.timeOffset > obj.downTime + obj.upTime) { obj.timeOffset = 0; } } else { if (!obj.inverted && _root[obj.signalName] || obj.inverted && !_root[obj.signalName]) { obj.playedFloorImpactSound = false; if (!obj.playedUpSound) { _root[obj._name + 'S'].start(); obj.playedUpSound = true; } obj.volDist = (600 - _root.getDist(obj._x, obj._y, _root.gameCamera._x, _root.gameCamera._y)) / 2; if (obj.volDist < 0) { obj.volDist = 0; } _root[obj._name + 'S'].setVolume(obj.volDist * sfxVolume); obj.top.ySpeed = -4; obj.top.light._visible = true; } else { _root[obj._name + 'S'].stop(); obj.playedUpSound = false; obj.top.ySpeed += 2; if (obj.top.ySpeed > 0) { obj.bottom._y += obj.top.ySpeed * 0.9; } obj.top.light._visible = false; } } obj.top._y += obj.top.ySpeed; if (obj.checkForBlocksWithinRestrictZone != undefined && obj.top._y <= -100 && obj.top.ySpeed >= 0) { wnr = 0; while (wnr < _root[obj.checkForBlocksWithinRestrictZone].wallList.length) { if (_root[obj.checkForBlocksWithinRestrictZone].wallList[wnr]._name != _root[obj.collisionName]._name) { if (_root[obj.checkForBlocksWithinRestrictZone].wallList[wnr].hitTest(_root[obj.collisionName])) { if (obj.top._y > -120) { if (obj.top.ySpeed > 2) { _root.playSound('crusher_small_impact_1', obj._x, obj._y); } obj.top.ySpeed *= -0.4; obj.top._y = -120; } if (obj.bottom._y > -100) { if (!obj.playedFloorImpactSound) { _root.playSound('crusher_floor_impact_1', obj._x, obj._y); if (_root.crusher_floor_impact_1S.getVolume() > 80) { _root.crusher_floor_impact_1S.setVolume(80); } obj.playedFloorImpactSound = true; } obj.bottom._y = -100; } } } ++wnr; } } if (obj.top._y > -20) { if (obj.top.ySpeed > 2) { _root.playSound('crusher_small_impact_1', obj._x, obj._y); } obj.top.ySpeed *= -0.4; obj.top._y = -20; } else { if (obj.top._y < -250) { obj.top.ySpeed = 0; obj.top._y = -250; } } if (obj.bottom._y > 0) { if (!obj.playedFloorImpactSound) { _root.playSound('crusher_floor_impact_1', obj._x, obj._y); if (_root.crusher_floor_impact_1S.getVolume() > 80) { _root.crusher_floor_impact_1S.setVolume(80); } obj.playedFloorImpactSound = true; } obj.bottom._y = 0; } if (obj.bottom._y - 40 > obj.top._y) { obj.bottom._y = obj.top._y + 40; } if (obj.bottom._y > -99) { _root[obj.collisionName].activated = true; } else { _root[obj.collisionName].activated = false; } _root[obj._name + 'Shadow']._alpha = 100 + obj.top._y / 3; _root[obj._name + 'Shadow']._height = 100 + obj.top._y / 6; _root[obj._name + 'Shadow']._width = 200 + obj.top._y / 6; } } function conveyorBelt(obj) { if (obj.hitTest(_root.onScreen)) { if (obj.signalName == undefined || !_root[obj.signalName]) { obj.conSpeed2 = obj.conSpeed; } else { if (!obj.onOff) { obj.conSpeed2 = -obj.conSpeed; } else { obj.conSpeed2 = 0; } } l = 0; while (l < obj.nrOfCBL) { obj.curCBL = obj._name + 'CBL' + l; if (obj._rotation == 0) { _root[obj.curCBL]._x += obj.conSpeed2; if (_root[obj.curCBL]._x > obj._x + obj._width / 2) { _root[obj.curCBL]._x = obj._x - obj._width / 2; } else { if (_root[obj.curCBL]._x < obj._x - obj._width / 2) { _root[obj.curCBL]._x = obj._x + obj._width / 2; } } } else { _root[obj.curCBL]._y += obj.conSpeed2; if (_root[obj.curCBL]._y > obj._y + obj._height / 2) { _root[obj.curCBL]._y = obj._y - obj._height / 2; } else { if (_root[obj.curCBL]._y < obj._y - obj._height / 2) { _root[obj.curCBL]._y = obj._y + obj._height / 2; } } } ++l; } if (!obj.dontInteractWithPlayers) { p = 1; while (p <= _root.nrOfPlayers) { if (obj.hitbox.hitTest(_root['heroHitboxP' + p])) { if (obj._rotation == 0) { _root['heroP' + p].conSpeedX += obj.conSpeed2; } else { _root['heroP' + p].conSpeedY += obj.conSpeed2; } } ++p; } } } } function addSpeechBubble(xPos, yPos, inputText, allowSkip, xOffset, timeVisible, gibberishVoice) { if (xOffset == undefined) { xOffset = 0; } _root.speechBubble.swapDepths(_root.getNextHighestDepth()); _root.speechBubble.removeMovieClip(); _root.attachMovie('speechBubble', 'speechBubble', _root.getNextHighestDepth()); _root.speechBubble.inputText = inputText; _root.speechBubble.gibberishVoice = gibberishVoice; _root.speechBubble._x = xPos + xOffset; _root.speechBubble._y = yPos; _root.speechBubble.xPos = xPos; _root.speechBubble.yPos = yPos; _root.speechBubble.allowSkip = allowSkip; if (timeVisible != undefined) { _root.speechBubble.timeVisible = timeVisible; } } function removeSpeechBubble() { _root.speechBubble.swapDepths(_root.getNextHighestDepth()); _root.speechBubble.removeMovieClip(); } function getAngle(xPos1, yPos1, xPos2, yPos2) { return (Math.atan2(yPos1 - yPos2, xPos1 - xPos2) / Math.PI) * 180; } function moveInDir(obj, moveDir, speed) { obj._x += Math.sin(moveDir * 0.0174532925199433) * speed; obj._y -= Math.cos(moveDir * 0.0174532925199433) * speed; } function addGlitter(xPos, yPos) { s = 0; while (s < 8) { gSName = 'GLTRSMOKE' + _root.getNextHighestDepth(); _root.attachMovie('glitterSmoke', gSName, _root.getNextHighestDepth()); _root[gSName]._x = xPos - 30 + random(60); _root[gSName]._y = yPos - 15 + random(31); _root[gSName].xSpeed = (-5 + random(11)) * 0.4; _root[gSName].ySpeed = (-5 + random(11)) * 0.4; _root[gSName]._alpha = 50 + random(40); _root[gSName]._yscale = 70 + random(40); _root[gSName]._xscale = _root[gSName]._yscale; _root[gSName].onEnterFrame = function () { if (!_root.gamePause) { this._yscale += 3; this._xscale = this._yscale; this.xSpeed *= 0.9; this.ySpeed *= 0.9; this._x += this.xSpeed; this._y += this.ySpeed; this._alpha -= 3; if (this._alpha <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; ++s; } g = 0; while (g < 30) { gName = 'GLTR' + _root.getNextHighestDepth(); _root.attachMovie('glitter', gName, _root.getNextHighestDepth()); _root[gName]._x = xPos - 8 + random(17); _root[gName]._y = yPos - 8 + random(17); _root[gName].xSpeed = -5 + random(11); _root[gName].ySpeed = -5 + random(11); _root[gName].ySpeed2 = -2; _root[gName].timer = 35 + random(30); _root[gName].onEnterFrame = function () { if (!_root.gamePause) { --this.timer; if (this.timer <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } this.xSpeed *= 0.97; this.ySpeed *= 0.95; this.ySpeed2 += 0.09; this._x += this.xSpeed; this._y += this.ySpeed + this.ySpeed2; if (random(5) <= 1) { this._visible = true; } else { this._visible = false; } } }; ++g; } } function showUiTip(inputText, time) { if (hud.uiTip.showTip) { hud.uiTip.nextMessage = inputText; hud.uiTip.showText = false; } else { hud.uiTip.tipsText.displayText.text = inputText; hud.uiTip.showTip = true; } _root.playSound('ui_hint_appear'); hud.uiTip.displayTimer = time; } function hideUiTip() { hud.uiTip.displayTimer = 1; } onEnterFrame = function () { if (frameSetUp && !gamePause) { gameCamera.prevX = gameCamera._x; gameCamera.prevY = gameCamera._y; p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].conSpeedX = 0; _root['heroP' + p].conSpeedY = 0; ++p; } con = 0; while (con < nrOfConveyorBelts) { conveyorBelt(_root['CONVEYOR' + con]); ++con; } mainGameThread(); gameCamera.movedX = gameCamera.prevX - gameCamera._x; gameCamera.movedY = gameCamera.prevY - gameCamera._y; pb = 0; while (pb < nrOfPushBlocks) { pushBlock(_root['pushBlock' + pb]); ++pb; } t = 0; while (t < nrOfTeleporters) { teleporter(_root['teleporter' + t]); ++t; } rh = 0; while (rh < nrOfRapidHitBlockers) { rapidHitBlock(_root['rapidHitBlocker' + rh]); ++rh; } cp = 0; while (cp < nrOfCheckPoints) { checkPoint(_root['cp' + cp], cp); ++cp; } b = 0; while (b < nrOfButtons) { gameButton(_root['btn' + b]); ++b; } d = 0; while (d < nrOfDoors) { gameDoor(_root['DOOR' + d]); ++d; } s = 0; while (s < nrOfSpikes) { spike(_root['SPIKE' + s]); ++s; } c = 0; while (c < nrOfCrushers) { crusher(_root['CRUSHER' + c]); ++c; } if (!cutscene) { h = 1; while (h <= nrOfPlayers) { _root['heroP' + h].deathBoxTouchingWall = false; _root['heroP' + h].middleWallCollide = false; _root['heroP' + h].wallCollideRight = _root['heroP' + h].middleWallCollide; _root['heroP' + h].wallCollideLeft = _root['heroP' + h].middleWallCollide; _root['heroP' + h].wallCollideDown = _root['heroP' + h].middleWallCollide; _root['heroP' + h].wallCollideUp = _root['heroP' + h].middleWallCollide; pz = 0; while (pz < _root.nrOfPlayerCollisionZones) { if (_root['heroHitboxP' + h].hitTest(_root['PCZ' + pz])) { i = 0; while (i < _root['PCZ' + pz].leverList.length) { _root.gameLever(_root['PCZ' + pz].leverList[i], h); ++i; } i = 0; while (i < _root['PCZ' + pz].breakBlockList.length) { _root.breakBlock(_root['PCZ' + pz].breakBlockList[i], h); ++i; } i = 0; while (i < _root['PCZ' + pz].pickupList.length) { if (_root.getDist(_root['PCZ' + pz].pickupList[i]._x, _root['PCZ' + pz].pickupList[i]._y, _root['heroP' + h]._x, _root['heroP' + h]._y) < 80) { _root['PCZ' + pz].pickupList[i].pickedUp = true; _root['PCZ' + pz].pickupList[i].collectingPlayer = h; } ++i; } wnr = 0; while (wnr < _root['PCZ' + pz].wallList.length) { playerWallCollision(_root['PCZ' + pz].wallList[wnr], _root['heroP' + h], _root['heroHitboxP' + h], _root['heroDeathBoxP' + h], _root['heroSwordP' + h], _root['heroShadowP' + h]); ++wnr; } } ++pz; } if (!_root['heroP' + h].middleWallCollide) { _root['heroP' + h].middleNotTouchingWallX = _root['heroP' + h]._x; _root['heroP' + h].middleNotTouchingWallY = _root['heroP' + h]._y; } if (_root['heroP' + h].deathBoxTouchingWall) { --_root['heroP' + h].squishTimer; if (_root['heroP' + h].squishTimer <= 0) { wallSquish(h); } } else { _root['heroP' + h].squishTimer = 2; } ++h; } } } _root.box_pushS.setVolume(_root.allPushBlockMovementForSound * 20 * sfxVolume); if (_root.allPushBlockMovementForSound <= 0) { _root.box_pushS.stop(); pushBlockSoundStarted = false; } else { if (!pushBlockSoundStarted) { _root.box_pushS.start(random(1000) / 1000); _root.box_pushS.start(1 + random(1000) / 1000); pushBlockSoundStarted = true; } } _root.allPushBlockMovementForSound = 0; if (musicTrack1) { if (bassKick.position != drumSnares.position || bassKickTVol == 0 && bassKick.position != accordion.position || bassKickTVol != 0 && bassKick.position != accordionDucked.position) { bassKick.stop(); drumSnares.stop(); accordion.stop(); accordionDucked.stop(); syncPos = drumSnares.position / 1000; bassKick.start(syncPos); drumSnares.start(syncPos); if (bassKickTVol == 0) { accordion.start(syncPos); } else { accordionDucked.start(syncPos); } } if (melody1Pling.position != melody1Plong.position || melody1Pling.position != melody1Plang.position || melody1Pling.position != plingDong.position) { melody1Pling.stop(); melody1Plong.stop(); melody1Plang.stop(); plingDong.stop(); syncPos = melody1Pling.position / 1000; melody1Pling.start(syncPos); melody1Plong.start(syncPos); melody1Plang.start(syncPos); plingDong.start(syncPos); } if (melody2Pling.position != melody2Plong.position || melody2Pling.position != melody2Plang.position) { melody2Pling.stop(); melody2Plong.stop(); melody2Plang.stop(); plingDong.stop(); syncPos = melody2Pling.position / 1000; melody2Pling.start(syncPos); melody2Plong.start(syncPos); melody2Plang.start(syncPos); } } else { if (musicTrack2) { if (track2Layer1.position != track2Layer2.position || track2Layer1.position != track2Layer3.position || track2Layer1.position != track2Layer4.position) { track2Layer1.stop(); track2Layer2.stop(); track2Layer3.stop(); track2Layer4.stop(); syncPos = track2Layer1.position / 1000; track2Layer1.start(syncPos); track2Layer2.start(syncPos); track2Layer3.start(syncPos); track2Layer4.start(syncPos); } } else { if (musicTrack3) { if (track3Layer1.position != track3Layer2.position || track3Layer1.position != track3Layer3.position) { track3Layer1.stop(); track3Layer2.stop(); track3Layer3.stop(); syncPos = track3Layer1.position / 1000; track3Layer1.start(syncPos); track3Layer2.start(syncPos); track3Layer3.start(syncPos); } } } } i = 0; while (i < musicTracks.length) { musicTrack(musicTracks[i]); ++i; } if (Key.isDown(80) || Key.isDown(13) || Key.isDown(27)) { if (_root.frameSetUp) { if (!kPauseDown) { if (gamePause) { _root.hud.pauseScreen._visible = false; _root.onScreen.gotoAndStop(1); gamePause = false; } else { _root.onScreen.gotoAndStop(2); _root.heroAttackHitboxP1.gotoAndStop(2); _root.heroAttackHitboxP2.gotoAndStop(2); _root.hud.pauseScreen._visible = true; _root.hud.pauseScreen.gotoAndStop(1); gamePause = true; } kPauseDown = true; } } } else { kPauseDown = false; } hud.swapDepths(_root.getNextHighestDepth()); if (_root.debug) { if (Key.isDown(36)) { despawnPlayer(2); } if (Key.isDown(35)) { despawnPlayer(1); } if (Key.isDown(45)) { continues = 0; despawnPlayer(1); despawnPlayer(2); } if (Key.isDown(73)) { w = 0; while (w < nrOfWalls) { _root['wall' + w]._visible = false; ++w; } } if (Key.isDown(85)) { if (kRightP1) { heroP1._x += 80; } if (kLeftP1) { heroP1._x -= 80; } if (kUpP1) { heroP1._y -= 80; } if (kDownP1) { heroP1._y += 80; } if (Key.isDown(73)) { cameraZoom = 300; } if (Key.isDown(89)) { cameraZoom = 0; } if (Key.isDown(1)) { heroP1._x = _xmouse; heroP1._y = _ymouse; heroP2._x = _xmouse; heroP2._y = _ymouse; } heroP1.squishTimer = 10; heroP1.health = 100; } if (Key.isDown(86)) { if (!k77Down) { yMousePos = _root._ymouse; k77Down = true; } if (Key.isDown(80)) { if (!k80Down) { trace('-------------'); tempMusicSetUpVar = _root[musicTracks[0] + 'TVol']; i = 1; while (i < musicTracks.length) { tempMusicSetUpVar += ', ' + _root[musicTracks[i] + 'TVol']; ++i; } trace('musicLayerVolsArray = new Array(' + tempMusicSetUpVar + ');'); trace('-------------'); k80Down = true; } } else { k80Down = false; } if (Key.isDown(49)) { track3BeatTVol = Math.abs(yMousePos - _root._ymouse); } if (Key.isDown(50)) { track3Layer1TVol = Math.abs(yMousePos - _root._ymouse); } if (Key.isDown(51)) { track3Layer2TVol = Math.abs(yMousePos - _root._ymouse); } if (Key.isDown(52)) { track3Layer3TVol = Math.abs(yMousePos - _root._ymouse); } if (Key.isDown(53)) { track3Layer4TVol = Math.abs(yMousePos - _root._ymouse); } if (track3BeatTVol > 100) { track3BeatTVol = 100; } if (track3Layer1TVol > 100) { track3Layer1TVol = 100; } if (track3Layer2TVol > 100) { track3Layer2TVol = 100; } if (track3Layer3TVol > 100) { track3Layer3TVol = 100; } if (track3Layer4TVol > 100) { track3Layer4TVol = 100; } if (track3BeatTVol < 0) { track3BeatTVol = 0; } if (track3Layer1TVol < 0) { track3Layer1TVol = 0; } if (track3Layer2TVol < 0) { track3Layer2TVol = 0; } if (track3Layer3TVol < 0) { track3Layer3TVol = 0; } if (track3Layer4TVol < 0) { track3Layer4TVol = 0; } } else { k77Down = false; } } }; } frame 5 { function setUpSfx(linkId) { sfx.createEmptyMovieClip(linkId + 'MC', sfx.getNextHighestDepth()); _root[linkId + 'S'] = new Sound(sfx[linkId + 'MC']); _root[linkId + 'S'].attachSound(linkId); } function playSound(sName, xPos, yPos, ranNr) { goAheadPlaySound = true; curSoundVol = 100; if (xPos != undefined) { tempDistVar = _root.getDist(xPos, yPos, _root.gameCamera._x, _root.gameCamera._y); curSoundVol = (400 - tempDistVar) / 2; if (curSoundVol <= 0) { goAheadPlaySound = false; } } if (goAheadPlaySound) { if (ranNr == undefined) { if (xPos != undefined) { _root[sName + 'S'].setPan((xPos - _root.gameCamera._x) / 4); } _root[sName + 'S'].setVolume(curSoundVol * sfxVolume); _root[sName + 'S'].start(); } else { if (xPos != undefined) { _root[sName + ranNr + 'S'].setPan((xPos - _root.gameCamera._x) / 4); } _root[sName + ranNr + 'S'].setVolume(curSoundVol * sfxVolume); _root[sName + ranNr + 'S'].start(); } } } function playGibberishSound(gibNr, time) { _root.stopGibberishSound(lastGibberishNr); if (time != undefined) { gibberishStopTimer = setInterval(function () { _root.gibberishActive = false; clearInterval(gibberishStopTimer); }, time); } _root.gibberishActive = true; _root.lastGibberishNr = gibNr; ranNr = 1 + random(4); if (_root.ranNr == _root.lastGibberishRanNr) { ++ranNr; if (ranNr > 4) { ranNr = 1; } } _root.lastGibberishRanNr = ranNr; _root['gibberish_' + gibNr + '_' + ranNr + 'S'].start(); _root['gibberish_' + gibNr + '_' + ranNr + 'S'].setVolume(100 * sfxVolume); _root['gibberish_' + gibNr + '_' + ranNr + 'S'].onSoundComplete = function () { if (_root.gibberishActive) { _root.playGibberishSound(_root.lastGibberishNr); } }; } function stopGibberishSound(gibNr) { i = 1; while (i <= 4) { _root['gibberish_' + gibNr + '_' + i + 'S'].stop(); ++i; } } function setUpMusicTrack(varId, linkId) { music.createEmptyMovieClip(varId + 'MC', music.getNextHighestDepth()); _root[varId] = new Sound(music[varId + 'MC']); _root[varId].attachSound(linkId); _root[varId + 'TVol'] = 0; _root[varId + 'Vol'] = 0; _root[varId].setVolume(0); musicTracks.push(varId); } function setMusicLayerVols(volArray) { i = 0; while (i < musicTracks.length) { _root[musicTracks[i] + 'TVol'] = volArray[i]; ++i; } } function musicTrack(varId) { if (!_root.musicWaitForSync) { _root[varId + 'Vol'] += (_root[varId + 'TVol'] - _root[varId + 'Vol']) * 0.1; _root[varId].setVolume(_root[varId + 'Vol'] * musicVolume); } } function syncTracksInterval() { drumSnares.start(); bassKick.start(); if (bassKickTVol == 0) { accordion.start(); } else { accordionDucked.start(); } ++barCount; if (_root.musicWaitForSync) { if (melody2PlingTVol == 0 && melody2PlongTVol == 0 && melody2PlangTVol == 0 && melody1PlingTVol == 0 && melody1PlongTVol == 0 && melody1PlangTVol == 0) { trace(melody1PlingTVol + ' ' + melody1PlongTVol + ' ' + melody1PlangTVol); i = 0; while (i < musicTracks.length) { _root[musicTracks[i] + 'Vol'] = _root[musicTracks[i] + 'TVol']; _root[musicTracks[i]].setVolume(_root[musicTracks[i] + 'Vol'] * musicVolume); _root.musicWaitForSync = false; ++i; } } } if (barCount == 4 || barCount == 8) { melody1Pling.start(); melody1Plong.start(); melody1Plang.start(); plingDong.start(); if (_root.musicWaitForSync) { if (melody2PlingTVol == 0 && melody2PlongTVol == 0 && melody2PlangTVol == 0) { i = 0; while (i < musicTracks.length) { _root[musicTracks[i] + 'Vol'] = _root[musicTracks[i] + 'TVol']; _root[musicTracks[i]].setVolume(_root[musicTracks[i] + 'Vol'] * musicVolume); _root.musicWaitForSync = false; ++i; } } } if (barCount == 8) { if (_root.musicWaitForSync) { i = 0; while (i < musicTracks.length) { _root[musicTracks[i] + 'Vol'] = _root[musicTracks[i] + 'TVol']; _root[musicTracks[i]].setVolume(_root[musicTracks[i] + 'Vol'] * musicVolume); _root.musicWaitForSync = false; ++i; } } melody2Pling.start(); melody2Plong.start(); melody2Plang.start(); barCount = 0; } } } function syncTracksInterval2() { track2Beat.start(); ++barCount; track2Layer1.start(); track2Layer2.start(); track2Layer3.start(); track2Layer4.start(); if (barCount == 2) { track2Layer5.start(); barCount = 0; } } function syncTracksInterval3() { track3Beat.start(); track3Layer4.start(); ++barCount; if (barCount == 2) { track3Layer1.start(); track3Layer2.start(); track3Layer3.start(); barCount = 0; } } function syncTracksInterval4() { bossMusic.start(); } function switchMusicSetup(setNr) { drumSnaresTVol = 0; bassKickTVol = 0; accordionTVol = 0; accordionDuckedTVol = accordionTVol; melody1PlingTVol = 0; melody1PlongTVol = 0; melody1PlangTVol = 0; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 0; if (setNr == 1) { drumSnaresTVol = 0; bassKickTVol = 0; accordionTVol = 0; accordionDuckedTVol = 0; melody1PlingTVol = 100; melody1PlongTVol = 0; melody1PlangTVol = 100; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 0; } if (setNr == 2) { drumSnaresTVol = 100; bassKickTVol = 50; accordionTVol = 50; accordionDuckedTVol = 100; melody1PlingTVol = 100; melody1PlongTVol = 0; melody1PlangTVol = 100; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 0; } if (setNr == 3) { drumSnaresTVol = 50; bassKickTVol = 0; accordionTVol = 10; accordionDuckedTVol = 0; melody1PlingTVol = 80; melody1PlongTVol = 0; melody1PlangTVol = 0; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 0; } if (setNr == 4) { drumSnaresTVol = 100; bassKickTVol = 0; accordionTVol = 50; accordionDuckedTVol = 100; melody1PlingTVol = 100; melody1PlongTVol = 0; melody1PlangTVol = 100; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 0; } if (setNr == 4.1) { drumSnaresTVol = 100; bassKickTVol = 50; accordionTVol = 50; accordionDuckedTVol = 100; melody1PlingTVol = 100; melody1PlongTVol = 0; melody1PlangTVol = 100; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 0; } if (setNr == 5) { drumSnaresTVol = 30; bassKickTVol = 0; accordionTVol = 0; accordionDuckedTVol = 0; melody1PlingTVol = 0; melody1PlongTVol = 100; melody1PlangTVol = 100; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 0; } if (setNr == 6) { drumSnaresTVol = 30; bassKickTVol = 0; accordionTVol = 0; accordionDuckedTVol = 0; melody1PlingTVol = 0; melody1PlongTVol = 100; melody1PlangTVol = 100; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 100; } if (setNr == 7) { drumSnaresTVol = 100; bassKickTVol = 50; accordionTVol = 50; accordionDuckedTVol = 50; melody1PlingTVol = 0; melody1PlongTVol = 0; melody1PlangTVol = 0; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 60; } if (setNr == 7.1) { drumSnaresTVol = 100; bassKickTVol = 50; accordionTVol = 50; accordionDuckedTVol = 50; melody1PlingTVol = 0; melody1PlongTVol = 0; melody1PlangTVol = 0; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 0; } if (setNr == 8) { drumSnaresTVol = 100; bassKickTVol = 0; accordionTVol = 10; accordionDuckedTVol = 10; melody1PlingTVol = 20; melody1PlongTVol = 10; melody1PlangTVol = 0; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 20; } if (setNr == 9) { drumSnaresTVol = 60; bassKickTVol = 0; accordionTVol = 5; accordionDuckedTVol = 0; melody1PlingTVol = 0; melody1PlongTVol = 0; melody1PlangTVol = 0; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 0; } if (setNr == 10) { drumSnaresTVol = 0; bassKickTVol = 0; accordionTVol = 0; accordionDuckedTVol = 0; melody1PlingTVol = 100; melody1PlongTVol = 20; melody1PlangTVol = 0; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 20; } if (setNr == 11) { drumSnaresTVol = 30; bassKickTVol = 0; accordionTVol = 0; accordionDuckedTVol = 0; melody1PlingTVol = 0; melody1PlongTVol = 0; melody1PlangTVol = 0; melody2PlingTVol = 100; melody2PlongTVol = 100; melody2PlangTVol = 0; plingDongTVol = 0; } if (setNr == 11.1) { drumSnaresTVol = 100; bassKickTVol = 40; accordionTVol = 0; accordionDuckedTVol = 0; melody1PlingTVol = 0; melody1PlongTVol = 0; melody1PlangTVol = 0; melody2PlingTVol = 100; melody2PlongTVol = 100; melody2PlangTVol = 0; plingDongTVol = 0; } if (setNr == 12) { drumSnaresTVol = 50; bassKickTVol = 0; accordionTVol = 0; accordionDuckedTVol = 0; melody1PlingTVol = 0; melody1PlongTVol = 0; melody1PlangTVol = 0; melody2PlingTVol = 100; melody2PlongTVol = 50; melody2PlangTVol = 0; plingDongTVol = 0; } if (setNr == 13) { drumSnaresTVol = 0; bassKickTVol = 0; accordionTVol = 0; accordionDuckedTVol = 0; melody1PlingTVol = 0; melody1PlongTVol = 0; melody1PlangTVol = 0; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 80; plingDongTVol = 0; } if (setNr == 14) { drumSnaresTVol = 80; bassKickTVol = 0; accordionTVol = 0; accordionDuckedTVol = 0; melody1PlingTVol = 0; melody1PlongTVol = 0; melody1PlangTVol = 0; melody2PlingTVol = 0; melody2PlongTVol = 80; melody2PlangTVol = 100; plingDongTVol = 0; } if (setNr == 14.1) { drumSnaresTVol = 80; bassKickTVol = 50; accordionTVol = 10; accordionDuckedTVol = 10; melody1PlingTVol = 0; melody1PlongTVol = 0; melody1PlangTVol = 0; melody2PlingTVol = 0; melody2PlongTVol = 80; melody2PlangTVol = 100; plingDongTVol = 0; } if (setNr == 15) { drumSnaresTVol = 100; bassKickTVol = 50; accordionTVol = 60; accordionDuckedTVol = 60; melody1PlingTVol = 0; melody1PlongTVol = 0; melody1PlangTVol = 0; melody2PlingTVol = 20; melody2PlongTVol = 100; melody2PlangTVol = 20; plingDongTVol = 0; } if (setNr == 16) { drumSnaresTVol = 60; bassKickTVol = 0; accordionTVol = 0; accordionDuckedTVol = 0; melody1PlingTVol = 0; melody1PlongTVol = 0; melody1PlangTVol = 0; melody2PlingTVol = 10; melody2PlongTVol = 80; melody2PlangTVol = 30; plingDongTVol = 50; } if (setNr == 17) { drumSnaresTVol = 100; bassKickTVol = 60; accordionTVol = 50; accordionDuckedTVol = 80; melody1PlingTVol = 10; melody1PlongTVol = 10; melody1PlangTVol = 100; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 10; } } } frame 5 { function saveState() { if (!_root.mainMenuContinue) { _root.hud.pauseScreen.restartButton._visible = true; _root.savedData.data.lastSavedFrame = _root._currentframe; p = 1; while (p <= 2) { _root.savedData.data['hero' + p + 'score'] = _root['hero' + p + 'score']; _root.savedData.data['hero' + p + 'displayScore'] = _root['hero' + p + 'displayScore']; _root.savedData.data['hero' + p + 'scoreContinuesGiven'] = _root['hero' + p + 'scoreContinuesGiven']; _root.savedData.data['hero' + p + 'scoreTemp'] = _root['hero' + p + 'scoreTemp']; _root.savedData.data['hero' + p + 'multiplier'] = _root['hero' + p + 'multiplier']; _root.savedData.data['hero' + p + 'multiplierTimer'] = _root['hero' + p + 'multiplierTimer']; _root.savedData.data['hero' + p + 'health'] = _root['hero' + p + 'health']; ++p; } _root.savedData.data.continues = _root.continues; _root.savedData.data.dontHitMrPinkAchievementFailed = _root.dontHitMrPinkAchievementFailed; _root.savedData.data.nrOfWatermelonsSmashed = _root.nrOfWatermelonsSmashed; _root.hud.attachMovie('progressSavedIndicator', 'progressSavedIndicator', _root.hud.getNextHighestDepth()); _root.hud.progressSavedIndicator._x = 262; _root.hud.progressSavedIndicator._y = 171; _root.savedData.flush(); } _root.mainMenuContinue = false; } function loadState() { _root.gnomesFound = 0; g = 1; while (g <= 9) { _root['gnome' + g] = _root.savedData.data['gnome' + g]; if (_root.savedData.data['gnome' + g]) { ++_root.gnomesFound; } ++g; } p = 1; while (p <= 2) { _root['hero' + p + 'score'] = _root.savedData.data['hero' + p + 'score']; _root['hero' + p + 'displayScore'] = _root.savedData.data['hero' + p + 'displayScore']; _root['hero' + p + 'scoreContinuesGiven'] = _root.savedData.data['hero' + p + 'scoreContinuesGiven']; _root['hero' + p + 'scoreTemp'] = _root.savedData.data['hero' + p + 'scoreTemp']; _root['hero' + p + 'multiplier'] = _root.savedData.data['hero' + p + 'multiplier']; _root['hero' + p + 'multiplierTimer'] = _root.savedData.data['hero' + p + 'multiplierTimer']; _root['hero' + p + 'health'] = _root.savedData.data['hero' + p + 'health']; ++p; } _root.megaTeddington = _root.savedData.data.megaTeddington; _root.continues = _root.savedData.data.continues; _root.dontHitMrPinkAchievementFailed = _root.savedData.data.dontHitMrPinkAchievementFailed; _root.nrOfWatermelonsSmashed = _root.savedData.data.nrOfWatermelonsSmashed; } function clearAllVariables() { for (cObject in _root) { if (typeof _root[cObject] != 'function' && typeof _root[cObject] != 'object') { if (cObject != 'sfxVolume' && cObject != 'musicVolume' && cObject != 'nrOfPlayers' && cObject != 'syncTracks' && cObject != 'debug') { delete _root[cObject]; } } else { if (_root[cObject] instanceof Array) { delete _root[cObject]; } } } } savedData = SharedObject.getLocal('NunchuckCharlieALoveStory'); if (_root.savedData.data.qualitySetting != undefined) { _root._quality = _root.savedData.data.qualitySetting; } else { _root._quality = 'MEDIUM'; } if (_root.savedData.data.sfxVolume != undefined) { sfxVolume = _root.savedData.data.sfxVolume; } else { sfxVolume = 1; } if (_root.savedData.data.musicVolume != undefined) { musicVolume = _root.savedData.data.musicVolume; } else { musicVolume = 1; } if (_root.savedData.data.nrOfPlayers != undefined) { nrOfPlayers = _root.savedData.data.nrOfPlayers; } else { nrOfPlayers = 1; } if (_root.debug) { getRate = setInterval(function () { displayFrameRate = frameRate; _root.hud.fpsCounter.text = displayFrameRate; frameRate = 0; }, 1000); } stopAllSounds(); } frame 6 { function loadMusicTrack1() { _root.music.swapDepths(_root.getNextHighestDepth()); _root.music.removeMovieClip(); _root.createEmptyMovieClip('music', _root.getNextHighestDepth()); musicTrack1 = true; musicTrack2 = false; musicTrack3 = false; musicTrack4 = false; _root.musicWaitForSync = false; _root.musicTracks = new Array(); setUpMusicTrack('drumSnares', 'drum_snares'); setUpMusicTrack('bassKick', 'bass_kick'); setUpMusicTrack('accordion', 'accordion'); setUpMusicTrack('accordionDucked', 'accordion_bass_ducked'); setUpMusicTrack('melody1Pling', 'melody_1_pling'); setUpMusicTrack('melody1Plong', 'melody_1_plong'); setUpMusicTrack('melody1Plang', 'melody_1_plang'); setUpMusicTrack('melody2Pling', 'melody_2_pling'); setUpMusicTrack('melody2Plong', 'melody_2_plong'); setUpMusicTrack('melody2Plang', 'melody_2_plang'); setUpMusicTrack('plingDong', 'pling_dong'); barCount = 7; i = 0; while (i < musicTracks.length) { _root[musicTracks[i]].start(); ++i; } clearInterval(syncTracks); syncTracks = setInterval(syncTracksInterval, 2050); } function loadMusicTrack2() { _root.music.swapDepths(_root.getNextHighestDepth()); _root.music.removeMovieClip(); _root.createEmptyMovieClip('music', _root.getNextHighestDepth()); musicTrack1 = false; musicTrack2 = true; musicTrack3 = false; musicTrack4 = false; _root.musicWaitForSync = false; musicTracks = new Array(); setUpMusicTrack('track2Beat', 'track_2_beat'); setUpMusicTrack('track2Layer1', 'track_2_layer_1'); setUpMusicTrack('track2Layer2', 'track_2_layer_2'); setUpMusicTrack('track2Layer3', 'track_2_layer_3'); setUpMusicTrack('track2Layer4', 'track_2_layer_4'); setUpMusicTrack('track2Layer5', 'track_2_layer_5'); barCount = 1; i = 0; while (i < musicTracks.length) { _root[musicTracks[i]].start(); ++i; } clearInterval(syncTracks); syncTracks = setInterval(syncTracksInterval2, 5333); } function loadMusicTrack3() { _root.music.swapDepths(_root.getNextHighestDepth()); _root.music.removeMovieClip(); _root.createEmptyMovieClip('music', _root.getNextHighestDepth()); musicTrack1 = false; musicTrack2 = false; musicTrack3 = true; musicTrack4 = false; _root.musicWaitForSync = false; musicTracks = new Array(); setUpMusicTrack('track3Beat', 'track_3_beats'); setUpMusicTrack('track3Layer1', 'track_3_layer_1'); setUpMusicTrack('track3Layer2', 'track_3_layer_2'); setUpMusicTrack('track3Layer3', 'track_3_layer_3'); setUpMusicTrack('track3Layer4', 'track_3_layer_4'); barCount = 1; i = 0; while (i < musicTracks.length) { _root[musicTracks[i]].start(); ++i; } clearInterval(syncTracks); syncTracks = setInterval(syncTracksInterval3, 8000); } function loadMusicTrack4() { _root.music.swapDepths(_root.getNextHighestDepth()); _root.music.removeMovieClip(); _root.createEmptyMovieClip('music', _root.getNextHighestDepth()); musicTrack1 = false; musicTrack2 = false; musicTrack3 = false; musicTrack4 = true; _root.musicWaitForSync = false; musicTracks = new Array(); setUpMusicTrack('bossMusic', 'boss_music_1'); barCount = 1; i = 0; while (i < musicTracks.length) { _root[musicTracks[i]].start(); ++i; } clearInterval(syncTracks); syncTracks = setInterval(syncTracksInterval4, 8000); } _root.createEmptyMovieClip('sfx', _root.getNextHighestDepth()); setUpSfx('gibberish_1_1'); setUpSfx('gibberish_1_2'); setUpSfx('gibberish_1_3'); setUpSfx('gibberish_1_4'); setUpSfx('gibberish_2_1'); setUpSfx('gibberish_2_2'); setUpSfx('gibberish_2_3'); setUpSfx('gibberish_2_4'); setUpSfx('gibberish_3_1'); setUpSfx('gibberish_3_2'); setUpSfx('gibberish_3_3'); setUpSfx('gibberish_3_4'); setUpSfx('gibberish_4_1'); setUpSfx('gibberish_4_2'); setUpSfx('gibberish_4_3'); setUpSfx('gibberish_4_4'); setUpSfx('gibberish_5_1'); setUpSfx('gibberish_5_2'); setUpSfx('gibberish_5_3'); setUpSfx('gibberish_5_4'); setUpSfx('gibberish_6_1'); setUpSfx('gibberish_6_2'); setUpSfx('gibberish_6_3'); setUpSfx('gibberish_6_4'); setUpSfx('gibberish_7_1'); setUpSfx('gibberish_7_2'); setUpSfx('gibberish_7_3'); setUpSfx('gibberish_7_4'); setUpSfx('gibberish_0_1'); setUpSfx('surprised_bear'); setUpSfx('bear_fart'); setUpSfx('door_open_1'); setUpSfx('door_open_2'); setUpSfx('door_open_3'); setUpSfx('footstep_1'); setUpSfx('footstep_2'); setUpSfx('footstep_3'); setUpSfx('footstep_4'); setUpSfx('footstep_5'); setUpSfx('footstep_6'); setUpSfx('mr_pink_hit_1'); setUpSfx('mr_pink_hit_2'); setUpSfx('mr_pink_hit_3'); setUpSfx('nunchuck_attack_1'); setUpSfx('nunchuck_attack_2'); setUpSfx('nunchuck_attack_3'); setUpSfx('nunchuck_attack_4'); setUpSfx('nunchuck_mega_attack_1'); setUpSfx('nunchuck_mega_attack_charged_1'); setUpSfx('nunchuck_hit_1'); setUpSfx('nunchuck_hit_2'); setUpSfx('nunchuck_hit_3'); setUpSfx('nunchuck_hit_4'); sfx.createEmptyMovieClip('nunchuck_chargeP1MC', sfx.getNextHighestDepth()); _root.nunchuck_chargeP1S = new Sound(sfx.nunchuck_chargeP1MC); _root.nunchuck_chargeP1S.attachSound('nunchuck_charge'); sfx.createEmptyMovieClip('nunchuck_chargeP2MC', sfx.getNextHighestDepth()); _root.nunchuck_chargeP2S = new Sound(sfx.nunchuck_chargeP2MC); _root.nunchuck_chargeP2S.attachSound('nunchuck_charge'); sfx.createEmptyMovieClip('nunchuck_charge_readyP1MC', sfx.getNextHighestDepth()); _root.nunchuck_charge_readyP1S = new Sound(sfx.nunchuck_charge_readyP1MC); _root.nunchuck_charge_readyP1S.attachSound('nunchuck_charge_ready'); sfx.createEmptyMovieClip('nunchuck_charge_readyP2MC', sfx.getNextHighestDepth()); _root.nunchuck_charge_readyP2S = new Sound(sfx.nunchuck_charge_readyP2MC); _root.nunchuck_charge_readyP2S.attachSound('nunchuck_charge_ready'); setUpSfx('bear_hit_1'); setUpSfx('bear_hit_2'); setUpSfx('bear_hit_3'); setUpSfx('bear_hit_4'); setUpSfx('bear_hit_5'); setUpSfx('box_hit_1'); setUpSfx('box_hit_2'); setUpSfx('box_hit_3'); setUpSfx('box_hit_4'); setUpSfx('box_push'); _root.box_pushS.onSoundComplete = function () { root.box_pushS.stop(); _root.box_pushS.start(random(250) / 250); }; setUpSfx('egg_hit_1'); setUpSfx('egg_hit_2'); setUpSfx('egg_hit_3'); setUpSfx('egg_hit_4'); setUpSfx('bear_popped_1'); setUpSfx('bear_popped_2'); setUpSfx('bear_popped_3'); setUpSfx('bear_popped_4'); setUpSfx('collect_1'); setUpSfx('collect_2'); setUpSfx('collect_3'); setUpSfx('collect_4'); setUpSfx('collect_5'); setUpSfx('collect_6'); setUpSfx('collect_7'); setUpSfx('collect_8'); setUpSfx('slime_1'); setUpSfx('slime_2'); setUpSfx('slime_3'); setUpSfx('slime_kill_1'); setUpSfx('slime_kill_2'); setUpSfx('slime_kill_3'); setUpSfx('pop_1'); setUpSfx('pop_2'); setUpSfx('pop_3'); setUpSfx('pop_4'); setUpSfx('hair_spray_pick_up'); setUpSfx('checkpoint_active'); setUpSfx('checkpoint_respawn'); setUpSfx('switch_on'); setUpSfx('switch_off'); setUpSfx('spike_appear_1'); setUpSfx('spike_appear_2'); setUpSfx('spike_appear_3'); setUpSfx('spike_appear_4'); setUpSfx('spike_disappear_1'); setUpSfx('spike_disappear_2'); setUpSfx('spike_disappear_3'); setUpSfx('spike_disappear_4'); setUpSfx('spike_rattle_1'); setUpSfx('crusher_going_up_1'); setUpSfx('crusher_going_up_2'); setUpSfx('crusher_going_up_3'); setUpSfx('crusher_beep_1'); setUpSfx('crusher_floor_impact_1'); setUpSfx('crusher_small_impact_1'); setUpSfx('box_switch_on'); setUpSfx('box_switch_off'); setUpSfx('robot_hit'); setUpSfx('robot_step_1'); setUpSfx('robot_step_2'); setUpSfx('robot_turn'); setUpSfx('cat_open'); setUpSfx('menu_hover_1'); setUpSfx('menu_hover_2'); setUpSfx('menu_hover_3'); setUpSfx('menu_hover_4'); setUpSfx('menu_hover_5'); setUpSfx('menu_hover_6'); setUpSfx('menu_select'); setUpSfx('menu_select_press'); setUpSfx('ui_hint_appear'); setUpSfx('bonus_life'); setUpSfx('charlie_being_hit_1'); setUpSfx('charlie_being_hit_2'); setUpSfx('charlie_being_hit_3'); setUpSfx('charlie_being_hit_4'); setUpSfx('mortadela_being_hit_1'); setUpSfx('mortadela_being_hit_2'); setUpSfx('mortadela_being_hit_3'); setUpSfx('mortadela_being_hit_4'); setUpSfx('gnome_active'); setUpSfx('teddington_laser_1'); setUpSfx('teddington_laser_2'); setUpSfx('teddington_laser_3'); setUpSfx('clock_tic'); setUpSfx('clock_tac'); setUpSfx('intro_wall_break'); setUpSfx('blueberry_hit_1'); setUpSfx('blueberry_hit_2'); setUpSfx('blueberry_hit_3'); setUpSfx('blueberry_jump_1'); setUpSfx('blueberry_jump_2'); setUpSfx('blueberry_jump_3'); setUpSfx('blueberry_pot_land_1'); setUpSfx('blueberry_pot_break_1'); setUpSfx('blueberry_pot_break_2'); setUpSfx('space_avoider_music'); setUpSfx('space_avoider_button_1'); setUpSfx('space_avoider_button_2'); setUpSfx('space_avoider_hit'); setUpSfx('explosion_1'); setUpSfx('explosion_2'); setUpSfx('explosion_3'); setUpSfx('explosion_4'); setUpSfx('accordion_1'); setUpSfx('accordion_2'); setUpSfx('accordion_3'); setUpSfx('accordion_4'); setUpSfx('accordion_5'); setUpSfx('teleporter_1'); setUpSfx('teleporter_2'); setUpSfx('teleporter_3'); setUpSfx('bird_pop_1'); setUpSfx('bird_pop_2'); setUpSfx('bird_pop_3'); setUpSfx('bird_charge_1'); setUpSfx('bird_hit_1'); setUpSfx('sticky_1'); setUpSfx('sticky_2'); setUpSfx('sticky_3'); setUpSfx('sticky_wobble_1'); setUpSfx('sticky_wobble_2'); setUpSfx('sticky_wobble_3'); setUpSfx('chigeon_hit_1'); setUpSfx('chigeon_hit_2'); setUpSfx('chigeon_hit_3'); setUpSfx('chigeon_hit_4'); setUpSfx('heart_door_open'); setUpSfx('spotlight_2'); setUpSfx('spotlight_3'); setUpSfx('laser_charge_1'); setUpSfx('chigeon_laser_fart'); setUpSfx('kiss'); musicTrack1 = false; musicTrack2 = false; musicTrack3 = false; musicTrack4 = false; } frame 6 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'mainMenuBackground' && _root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } _root.attachMovie('gameCamera', 'gameCamera', _root.getNextHighestDepth()); _root.attachMovie('onScreen', 'onScreen', _root.getNextHighestDepth()); _root.attachMovie('hud', 'hud', _root.getNextHighestDepth()); frameSetUp = false; stopAllSounds(); _root.gotoAndStop(10); } frame 9 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } else { if (typeof _root[cObject] != 'function' && typeof _root[cObject] != 'object') { if (cObject != 'sfxVolume' && cObject != 'musicVolume' && cObject != 'nrOfPlayers' && cObject != 'syncTracks') { delete _root[cObject]; } } } } stopAllSounds(); frameSetUp = false; _root.gotoAndStop(_root._currentframe + 1); } frame 10 { if (!musicTrack1) { loadMusicTrack1(); } drumSnaresTVol = 0; bassKickTVol = 0; accordionTVol = 0; accordionDuckedTVol = 0; melody1PlingTVol = 0; melody1PlongTVol = 100; melody1PlangTVol = 0; melody2PlingTVol = 0; melody2PlongTVol = 0; melody2PlangTVol = 0; plingDongTVol = 0; } frame 10 { stop(); _root._y = 0; _root._x = 0; _root.gameCamera._yscale = 100; _root.gameCamera._xscale = 100; _root.gameCamera._x = 400; _root.gameCamera._y = 240; hud._visible = false; frameSetUp = false; } instance mainMenuBackground of movieClip 90 { onClipEvent (load) { startX = _x; startY = _y; _x = startX - (_parent._xmouse + 400) * 0.08; _y = startY - (_parent._ymouse + 240) * 0.08; } onClipEvent (enterFrame) { _x = startX - (_parent._xmouse + 400) * 0.08; _y = startY - (_parent._ymouse + 240) * 0.08; } } movieClip 934 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 936 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 938 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 940 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 942 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 944 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 946 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 948 { } movieClip 952 { } movieClip 959 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 961 { instance buttonTop of movieClip 100 { onClipEvent (load) { _height = 0; } } } movieClip 969 { frame 1 { stop(); } } movieClip 971 { } movieClip 975 { frame 1 { stop(); } } movieClip 977 { frame 1 { stop(); } instance of movieClip 388 { onClipEvent (release) { hover = true; if (_root.allowMainMenuClick) { _root.playSound('menu_select'); _parent._parent.gotoAndStop(1); } } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_1'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance sfxVolSlider of movieClip 364 { onClipEvent (load) { inputVar = 'sfxVolume'; maxVal = 1; hideHitboxInObj = 'musicVolSlider'; } } instance musicVolSlider of movieClip 364 { onClipEvent (load) { inputVar = 'musicVolume'; maxVal = 1; hideHitboxInObj = 'sfxVolSlider'; } } instance qualityLow of movieClip 368 { onClipEvent (load) { if (_root._quality == 'LOW') { this.gotoAndStop(2); } } onClipEvent (press) { _root.playSound('menu_select_press'); _root.savedData.data.qualitySetting = 'LOW'; _parent.qualityMedium.gotoAndStop(1); _parent.qualityHigh.gotoAndStop(1); this.gotoAndStop(2); _root._quality = 'Low'; } onClipEvent (rollOver) { _root.playSound('menu_hover_1'); } } instance qualityMedium of movieClip 371 { onClipEvent (load) { if (_root._quality == 'MEDIUM') { this.gotoAndStop(2); } } onClipEvent (press) { _root.playSound('menu_select_press'); _root.savedData.data.qualitySetting = 'MEDIUM'; _parent.qualityLow.gotoAndStop(1); _parent.qualityHigh.gotoAndStop(1); this.gotoAndStop(2); _root._quality = 'MEDIUM'; } onClipEvent (rollOver) { _root.playSound('menu_hover_2'); } } instance qualityHigh of movieClip 374 { onClipEvent (load) { if (_root._quality == 'HIGH') { this.gotoAndStop(2); } } onClipEvent (press) { _root.playSound('menu_select_press'); _root.savedData.data.qualitySetting = 'HIGH'; _parent.qualityLow.gotoAndStop(1); _parent.qualityMedium.gotoAndStop(1); this.gotoAndStop(2); _root._quality = 'HIGH'; } onClipEvent (rollOver) { _root.playSound('menu_hover_3'); } } instance of movieClip 376 { onClipEvent (press) { _root.playSound('menu_select_press'); this.gotoAndStop(2); } onClipEvent (release) { _root.playSound('menu_select'); _parent.gotoAndStop(2); this.gotoAndStop(1); } onClipEvent (dragOut) { this.gotoAndStop(1); } onClipEvent (rollOver) { _root.playSound('menu_hover_4'); } } instance of movieClip 975 { onClipEvent (press) { _root.playSound('menu_select_press'); this.gotoAndStop(2); } onClipEvent (release) { _root.playSound('menu_select'); this.gotoAndStop(1); _parent.gotoAndStop(3); } onClipEvent (dragOut) { this.gotoAndStop(1); } onClipEvent (rollOver) { _root.playSound('menu_hover_5'); } } instance of movieClip 388 { onClipEvent (release) { hover = true; if (_root.allowMainMenuClick) { _root.playSound('menu_select'); _parent.gotoAndStop(1); } } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_1'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 408 { onClipEvent (release) { hover = true; _root.playSound('menu_select'); _parent.gotoAndStop(1); } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_1'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 412 { onClipEvent (release) { hover = true; _root.playSound('menu_select'); _root.savedData.clear(); _parent.gotoAndStop(1); } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_2'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } } movieClip 984 { frame 1 { stop(); } instance of movieClip 934 { onClipEvent (release) { hover = true; if (_root.allowMainMenuClick) { _root.playSound('menu_select'); if (_root.savedData.data.lastSavedFrame == undefined) { _parent.gotoAndStop(2); } else { _parent.gotoAndStop(4); } } } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_2'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 936 { onClipEvent (release) { hover = true; if (_root.allowMainMenuClick) { com.newgrounds.API.logCustomEvent('Main_Continue'); _root.playSound('menu_select'); _root.nrOfPlayers = _root.savedData.data.nrOfPlayers; _root.loadState(); _root.mainMenuStartNewGame = true; _root.mainMenuContinue = true; _root.hud.attachMovie('whiteFade', 'mainMenuContinueWhiteFade', _root.hud.getNextHighestDepth()); _root.hud.mainMenuContinueWhiteFade.gotoAndStop(2); _root.hud.mainMenuContinueWhiteFade._alpha = 120; _root.hud.mainMenuContinueWhiteFade.onEnterFrame = function () { if (_root.heroP1 != undefined) { this._alpha -= 2; if (this._alpha <= 0) { this.swapDepths(this._parent.getNextHighestDepth()); this.removeMovieClip(); } } }; _root.allowMainMenuClick = false; } } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_1'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; if (_root.savedData.data.lastSavedFrame == undefined) { _visible = false; } } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 938 { onClipEvent (release) { hover = true; if (_root.allowMainMenuClick) { _root.playSound('menu_select'); _parent.gotoAndStop(3); } } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_3'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 940 { onClipEvent (release) { hover = true; if (_root.allowMainMenuClick) { _root.playSound('menu_select'); com.newgrounds.API.logCustomEvent('Main_Credits'); _parent.gotoAndStop(5); } } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_4'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 942 { onClipEvent (release) { hover = true; if (_root.allowMainMenuClick) { _root.playSound('menu_select'); getURL('http://highscores.adultswim.com/highscores/index.jsp?game=5686&filter=0&itemsPerPage=50', '_blank'); } } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_6'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { _visible = false; startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 944 { onClipEvent (release) { hover = true; if (_root.allowMainMenuClick) { _root.playSound('menu_select'); _parent.gotoAndStop(6); } } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_5'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 946 { onClipEvent (release) { hover = true; if (_root.allowMainMenuClick) { _root.playSound('menu_select'); getURL('http://games.adultswim.com', '_blank'); } } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_6'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 952 { onClipEvent (release) { _root.playSound('menu_select'); getURL('http://www.deadtoast.com', '_blank'); com.newgrounds.API.logCustomEvent('Main_DT_logo'); } onClipEvent (press) { _root.playSound('menu_select_press'); } onClipEvent (rollOver) { _root.playSound('menu_hover_6'); } } instance of movieClip 118 { onClipEvent (release) { _root.playSound('menu_select'); getURL('http://games.adultswim.com', '_blank'); } onClipEvent (press) { _root.playSound('menu_select_press'); } onClipEvent (rollOver) { _root.playSound('menu_hover_6'); } } instance of movieClip 102 { onClipEvent (release) { hover = true; getURL('https://www.facebook.com/DeadtoastCom', '_blank'); com.newgrounds.API.logCustomEvent('Main_Facebook'); } onClipEvent (press) { buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; } } instance of movieClip 105 { onClipEvent (release) { hover = true; getURL('http://www.deadtoast.com', '_blank'); com.newgrounds.API.logCustomEvent('Main_com_Weblink'); } onClipEvent (press) { buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; } } instance of movieClip 107 { onClipEvent (release) { hover = true; getURL('https://twitter.com/deadtoast_com', '_blank'); com.newgrounds.API.logCustomEvent('Main_Twitter'); } onClipEvent (press) { buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; } } instance of movieClip 327 { onClipEvent (load) { gotoAndStop(2); } } instance of movieClip 327 { onClipEvent (load) { gotoAndStop(2); } } instance of movieClip 959 { onClipEvent (release) { hover = true; if (_root.allowMainMenuClick) { com.newgrounds.API.logCustomEvent('New_game_1P'); _root.playSound('menu_select'); g = 1; while (g <= 9) { _root['gnome' + g] = _root.savedData.data['gnome' + g]; ++g; } _root.hud.pauseScreen.restartButton._visible = false; _root.hud.pauseScreen.activate2PButton.gotoAndStop(1); _root.nrOfPlayers = 1; _root.savedData.data.lastSavedFrame = undefined; _root.savedData.data.nrOfPlayers = 1; _root.savedData.data.megaTeddington = _root.megaTeddington; _root.savedData.flush(); _root.mainMenuStartNewGame = true; _root.allowMainMenuClick = false; } } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_1'); hover = true; if (_root.allowMainMenuClick) { _parent.iconP1.alphaTarget = 100; } } onClipEvent (rollOut) { hover = false; if (_root.allowMainMenuClick) { _parent.iconP1.alphaTarget = 10; } } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 961 { onClipEvent (release) { hover = true; if (_root.allowMainMenuClick) { com.newgrounds.API.logCustomEvent('New_game_2P'); _root.playSound('menu_select'); g = 1; while (g <= 9) { _root['gnome' + g] = _root.savedData.data['gnome' + g]; ++g; } _root.hud.pauseScreen.restartButton._visible = false; _root.hud.pauseScreen.activate2PButton.gotoAndStop(3); _root.nrOfPlayers = 2; _root.savedData.data.lastSavedFrame = undefined; _root.savedData.data.nrOfPlayers = 2; _root.savedData.flush(); _root.hud.overheadDisplay.iconP2.gotoAndStop(3); _root.mainMenuStartNewGame = true; _root.allowMainMenuClick = false; } } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_2'); hover = true; if (_root.allowMainMenuClick) { _parent.iconP1.alphaTarget = 100; _parent.iconP2.alphaTarget = 100; } } onClipEvent (rollOut) { hover = false; if (_root.allowMainMenuClick) { _parent.iconP1.alphaTarget = 10; _parent.iconP2.alphaTarget = 10; } } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 388 { onClipEvent (release) { hover = true; if (_root.allowMainMenuClick) { _root.playSound('menu_select'); _parent.gotoAndStop(1); } } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_3'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance iconP1 of movieClip 327 { onClipEvent (load) { gotoAndStop(1); _alpha = 10; alphaTarget = 10; } onClipEvent (enterFrame) { _alpha = _alpha + (alphaTarget - _alpha) * 0.2; } } instance iconP2 of movieClip 327 { onClipEvent (load) { gotoAndStop(3); _alpha = 10; alphaTarget = 10; } onClipEvent (enterFrame) { _alpha = _alpha + (alphaTarget - _alpha) * 0.2; } } instance of movieClip 969 { onClipEvent (load) { if (_root.savedData.data.allowMegaTeddington) { _visible = true; } else { _visible = false; } _root.megaTeddington = false; } onClipEvent (release) { if (this._currentframe == 1) { this.gotoAndStop(2); _parent.iconP1.gotoAndStop(4); _root.megaTeddington = true; } else { this.gotoAndStop(1); _parent.iconP1.gotoAndStop(1); _root.megaTeddington = false; } } } instance of movieClip 971 { onClipEvent (load) { if (_root.siteKongregate() || _root.siteNewgrounds()) { _visible = false; } } } instance of movieClip 408 { onClipEvent (release) { _root.playSound('menu_select'); hover = true; _parent.gotoAndStop(1); } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_1'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 412 { onClipEvent (release) { hover = true; if (_root.allowMainMenuClick) { com.newgrounds.API.logCustomEvent('New_game_Reset'); _root.playSound('menu_select'); _parent.gotoAndStop(2); } } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_2'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 388 { onClipEvent (release) { hover = true; if (_root.allowMainMenuClick) { _root.playSound('menu_select'); _parent.gotoAndStop(1); } } onClipEvent (press) { _root.playSound('menu_select_press'); buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { _root.playSound('menu_hover_1'); hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; hitbox._y = -buttonTop._height; } } instance of movieClip 102 { onClipEvent (release) { hover = true; getURL('https://www.facebook.com/DeadtoastCom', '_blank'); com.newgrounds.API.logCustomEvent('Credits_Facebook'); } onClipEvent (press) { buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; } } instance of movieClip 105 { onClipEvent (release) { hover = true; getURL('http://www.deadtoast.com', '_blank'); com.newgrounds.API.logCustomEvent('Credits_com_Weblink'); } onClipEvent (press) { buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; } } instance of movieClip 107 { onClipEvent (release) { hover = true; getURL('https://twitter.com/deadtoast_com', '_blank'); com.newgrounds.API.logCustomEvent('Credits_Twitter'); } onClipEvent (press) { buttonTop._yscale = 0; hover = false; } onClipEvent (rollOver) { hover = true; } onClipEvent (rollOut) { hover = false; } onClipEvent (load) { startY = _y; hover = false; } onClipEvent (enterFrame) { if (hover) { buttonTop._yscale += (100 - buttonTop._yscale) * 0.2; } else { buttonTop._yscale += -buttonTop._yscale * 0.3; } _y = startY + buttonTop._height; } } instance of movieClip 118 { onClipEvent (release) { _root.playSound('menu_select'); getURL('http://games.adultswim.com', '_blank'); } onClipEvent (press) { _root.playSound('menu_select_press'); } onClipEvent (rollOver) { _root.playSound('menu_hover_6'); } } instance of movieClip 118 { onClipEvent (release) { _root.playSound('menu_select'); getURL('http://www.deadtoast.com', '_blank'); com.newgrounds.API.logCustomEvent('Credits_DT_logo'); } onClipEvent (press) { _root.playSound('menu_select_press'); } onClipEvent (rollOver) { _root.playSound('menu_hover_6'); } } } movieClip 985 { } instance mainMenu of movieClip 985 { onClipEvent (load) { ySpeed = 0; timer = 0; _alpha = 0; _root.allowMainMenuClick = true; _root.mainMenuContinue = false; } onClipEvent (enterFrame) { if (_alpha < 100) { _alpha = _alpha + 10; } else { _alpha = 100; } if (_root.mainMenuStartNewGame) { _root.drumSnaresTVol = 0; _root.bassKickTVol = 0; _root.accordionTVol = 0; _root.accordionDuckedTVol = 0; _root.melody1PlingTVol = 0; _root.melody1PlongTVol = 0; _root.melody1PlangTVol = 0; _root._root.melody2PlingTVol = 0; _root.melody2PlongTVol = 0; _root.melody2PlangTVol = 0; _root.plingDongTVol = 0; if (ySpeed < 10) { ySpeed += 0.5; } _y = _y + ySpeed; _root.mainMenu.foreground._y += ySpeed; _root.mainMenuBackground.startY += ySpeed; ++timer; if (timer > 15) { _root.whiteFade._alpha += 2.5; } if (_root.whiteFade._alpha >= 110) { stopAllSounds(); _root.mainMenuStartNewGame = false; _root.hud.pauseScreen._visible = false; _root.hud.pauseScreen.gotoAndStop(1); if (_root.mainMenuContinue) { _root.gotoAndStop(_root.savedData.data.lastSavedFrame); } else { if (_root.megaTeddington) { _root.gotoAndStop(17); } else { _root.gotoAndStop(15); } } } } } } instance whiteFade of movieClip 321 { onClipEvent (load) { this.gotoAndStop(2); this._alpha = 0; } } frame 15 { if (!musicTrack1) { loadMusicTrack1(); } } frame 15 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } frameSetUp = false; _root.gotoAndStop(_root._currentframe + 1); } frame 16 { com.newgrounds.API.logCustomEvent('Game_Intro'); } frame 16 { setUpFrame(); } movieClip 987 { frame 1 { _visible = false; } } movieClip 993 { } movieClip 996 { frame 1 { _root.depthSort(this); } } movieClip 999 { frame 1 { _root.depthSort(this); } } movieClip 1004 { } movieClip 1005 { frame 1 { recoverTimer = 0; onEnterFrame = function () { if (!_root.gamePause) { --recoverTimer; if (recoverTimer <= 0) { p = 1; while (p <= _root.nrOfPlayers) { if (_root['heroAttackHitboxP' + p].hitTest(hitbox)) { _root.playSound('box_hit_', 500, 0, 1 + random(4)); sliceName = 'slice' + _root.getNextHighestDepth(); _root.attachMovie('cucumberSlice', sliceName, _root.getNextHighestDepth()); _root[sliceName]._y = _parent._y + _y - front._height / 2; _root[sliceName]._x = _parent._x + _x; _root[sliceName]._rotation = front._rotation; _root[sliceName].xSpeed = -2 + random(4); _root[sliceName].ySpeed = -10 - random(4); _root[sliceName].onEnterFrame = function () { if (!_root.gamePause) { this._x += this.xSpeed; this._y += this.ySpeed; this.ySpeed += 1.5; this._alpha -= 5; if (this._alpha <= 0) { this.swapDepths(this._parent.getNextHighestDepth()); this.removeMovieClip(); } } }; bottom._y += 2; front._rotation = -180 + random(360); if (bottom._y > 27) { _root.addStar(_parent._x + _x, _parent._y + _y, 190); _root.introTimer.pauseTimer = false; _root.cutscene = true; _root.heroP1.waypointX = _root.heroP1._x; _root.heroP1.waypointY = _root.heroP1._y; _root.heroP2.waypointX = _root.heroP2._x; _root.heroP2.waypointY = _root.heroP2._y; _root.chop.remove = true; this.swapDepths(_parent.getNextHighestDepth()); this.removeMovieClip(); } _root.addStar(_parent._x + _x, _parent._y + _y, 100); recoverTimer = 4; } ++p; } } } }; } } movieClip 1015 { } movieClip 1018 { frame 1 { onEnterFrame = function () { if (!_root.gamePause) { if (random(3) == 1) { _rotation = -3 + random(7); _alpha = 40 + random(60); } } }; } } movieClip 1021 { } movieClip 1031 { } movieClip 1046 { frame 1 { stop(); } instance spoonHand of movieClip 1015 { onClipEvent (load) { rotTarget = 0; startRot = _rotation; } onClipEvent (enterFrame) { if (!_root.gamePause) { ++timer; _rotation = _rotation + (rotTarget - _rotation) * 0.08; if (_rotation < startRot + 2) { cucumber._visible = true; rotTarget = 0; } if (_rotation > -2) { cucumber._visible = false; rotTarget = startRot; } } } } instance peeper of movieClip 1021 { onClipEvent (load) { _alpha = 0; alphaTarget = 0; } onClipEvent (enterFrame) { if (!_root.gamePause) { _alpha = _alpha + (alphaTarget - _alpha) * 0.1; } } } instance duvetTop of movieClip 1031 { onClipEvent (load) { targetX = _x; } onClipEvent (enterFrame) { if (!_root.gamePause) { _x = _x + (targetX - _x) * 0.1; } } } } movieClip 1048 { } instance startPoint of movieClip 1048 { } movieClip 1050 { frame 1 { _visible = false; if (customOnEnterFrame == undefined) { onEnterFrame = function () { i = 1; while (i <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + i])) { _root[signalName] = true; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } ++i; } }; } } } instance introTimer of movieClip 1050 { onClipEvent (load) { _root.cutscene = true; customOnEnterFrame = true; _root.heroP1.waypointX = _root.heroP1._x; _root.heroP1.waypointY = _root.heroP1._y; _root.heroP2.waypointX = _root.heroP2._x; _root.heroP2.waypointY = _root.heroP2._y; timer = 0; pauseTimer = false; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName].squishable = false; _root[collisionName]._width = _root.spawnWallHere._width; _root[collisionName]._height = _root.spawnWallHere._height; _root[collisionName]._x = _root.spawnWallHere._x; _root[collisionName]._y = _root.spawnWallHere._y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root.hud.overheadDisplay._y = _root.hud.overheadDisplay.startY - 200; _root.hud.overheadDisplay._visible = false; _root.slowFade = true; _root.fadeTarget = 120; _root.hud.blackFade._alpha = 120; _root.hud.blackFade.gotoAndStop(2); _root.cameraFocusX = 400; _root.cameraFocusY = 800; _root.cameraFocusPowerX = 1; _root.cameraFocusPowerY = 1; _root.cameraOvershootX = 0; _root.cameraOvershootY = 0; _root.gameCamera._x = _root.cameraFocusX; _root.gameCamera._y = _root.cameraFocusY; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (timer < 150) { _root.speechBubble.xPos = _root.heroP1._x; _root.speechBubble.yPos = _root.heroP1._y - 120; } if (_root.speechBubble == undefined && !pauseTimer) { ++timer; } if (timer < 5) { _root.fadeTarget = 120; _root.hud.blackFade._alpha = 120; _root.cameraFocusX = 400; _root.cameraFocusY = 800; _root.cameraFocusPowerX = 1; _root.cameraFocusPowerY = 1; _root.cameraOvershootX = 0; _root.cameraOvershootY = 0; _root.gameCamera._x = _root.cameraFocusX; _root.gameCamera._y = _root.cameraFocusY; } if (timer == 5) { pauseTimer = true; _root.cameraFocusY += (240 - _root.cameraFocusY) * 0.05; _root.fadeTarget = -20; if (_root.cameraFocusY < 243) { _root.slowFade = false; ++timer; pauseTimer = false; } } if (timer == 30) { _root.addSpeechBubble(_root.heroP1._x, _root.heroP1._y - 120, 'Are you hungry, mr.Teddington?|I sure know I am!|You just sit tight...|I\'ll cook my Nunchuck-Charlie-Super-Secret-Awesomesauce.', true, 0, undefined, 5); ++timer; } if (timer == 32) { _root.showUiTip('Use the ARROW KEYS to walk over to the kitchen area.', undefined); _root.cutscene = false; pauseTimer = true; ++timer; } if (timer == 40) { _root.addSpeechBubble(_root.heroP1._x, _root.heroP1._y - 120, 'And now for the coconut!', true, -200, undefined, 5); _root.hideUiTip(); ++timer; } if (timer == 42) { _root.introBackground.attachMovie('coconut', 'coconut', _root.introBackground.getNextHighestDepth()); _root.introBackground.coconut._x = 263; _root.introBackground.coconut._y = 91; ++timer; } if (timer == 64) { _root.addSpeechBubble(_root.heroP1._x, _root.heroP1._y - 120, 'This will require a slightly stronger chop...', true, -200, undefined, 5); pauseTimer = true; _root.cutscene = false; ++timer; } if (timer == 65) { if (_root.speechBubble == undefined) { _root.chop._visible = true; _root.chop.remove = false; _root.chop.gotoAndStop(2); _root.chop._x += 5; _root.chop.startY -= 30; _root.chop._y = _root.chop.startY; _root.chop.ySpeed = -1.5; _root.showUiTip('Hold down ATTACK KEY [Z or M] to charge up your Mega Chop.', undefined); ++timer; } } if (timer == 66) { p = 1; while (p <= _root.nrOfPlayers) { if (_root['heroSwordP' + p].innerSword.nunchuck.power._alpha >= 15) { _root.showUiTip('Now release ATTACK KEY [Z or M] to execute Mega Chop.', undefined); ++timer; } ++p; } } if (timer == 68) { _root.showUiTip('You got it!', 60); } if (timer == 95) { _root.addSpeechBubble(_root.heroP1._x, _root.heroP1._y - 120, 'BOO-YAA!', true, 0, undefined, 5); ++timer; } if (timer == 105) { _root.cp1._y = -1000; _root.cp1._x = -1000; _root.hud.blackFade.gotoAndStop(1); _root.hud.blackFade.fadeTarget = 120; } if (timer == 150) { _root.hud.blackFade.fadeTarget = -20; p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p]._y = 0; _root['heroP' + p]._x = 0; _root['heroP' + p].waypointY = 0; _root['heroP' + p].waypointX = 0; ++p; } _root.introBackground.gotoAndStop(2); } if (timer == 240) { _root.addSpeechBubble(230, 310, '... A bit too much salt, don\'t you think?', true, 0, undefined, 5); ++timer; } if (timer == 241) { _root.introBackground.spoonHand.rotTarget = _root.introBackground.spoonHand.startRot; } if (timer == 270) { _root.hud.blackFade.fadeTarget = 120; } if (timer == 315) { _root.hud.blackFade.fadeTarget = -20; _root.introBackground.gotoAndStop(3); } if (timer == 390) { _root.addSpeechBubble(320, 260, 'Sweet dreams, Mr.Teddington.', true, 0, undefined, 5); ++timer; } if (timer == 392) { _root.playSound('kiss'); _root.attachMovie('heart', 'introHeart', _root.getNextHighestDepth()); _root.introHeart._x = 320; _root.introHeart._y = 300; _root.introHeart._yscale = 0; _root.introHeart._xscale = 0; _root.introHeart.onEnterFrame = function () { if (!_root.gamePause) { this._yscale += (100 - this._xscale) * 0.4; this._xscale = this._yscale; this._y -= 1.5; this._alpha -= 1; if (this._alpha <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } if (timer == 430) { _root.introBackground.duvetTop.targetX -= 20; } if (timer == 475) { _root.introBackground.peeper.alphaTarget = 100; } if (timer == 510) { _root.hud.blackFade.fadeTarget = 120; } if (timer == 545) { _root.clock.broken = true; _root.playSound('intro_wall_break'); _root.chigeon._visible = true; _root.chigeon.targetY += 50; _root.hud.blackFade.gotoAndStop(2); _root.introBackground.gotoAndStop(4); } if (timer == 547) { _root.addSmoke(540, 290); _root.addSmoke(440, 270); _root.addSmoke(640, 270); _root.addStar(540, 190, 300); _root.cameraShakeTimer = 60; _root.hud.blackFade._alpha = 0; _root.hud.blackFade.fadeTarget = -20; } if (timer == 570) { _root.addSpeechBubble(320, 260, 'What the..?', true, 0, undefined, 5); ++timer; } if (timer == 572) { _root.addSpeechBubble(500, 200, 'Ho ho ho!|It is I, Queen Chigeon...|... ruler of the Wishing Well of Forbidden Wishes!|Bid farewell to Mr.Teddington.|This will be the last time you will ever see him!', true, -200, undefined, 4); ++timer; } if (timer == 574) { _root.chigeon.targetY -= 500; _root.topBitCover._visible = true; } if (timer > 590 && _root.chigeon != undefined) { _root.chigeon._alpha -= 5; if (_root.chigeon._alpha <= 0) { _root.chigeon.swapDepths(_root.getNextHighestDepth()); _root.chigeon.removeMovieClip(); } } if (timer == 591) { _root.addSpeechBubble(320, 260, 'Nooooooooo!|Mr.Teddington! Hold on! I\'ll save you, I promise!', true, 0, undefined, 5); ++timer; } if (timer == 593) { _root.hud.blackFade.gotoAndStop(1); _root.hud.blackFade.fadeTarget = 120; } if (timer == 623) { _root.hud.blackFade.fadeTarget = -20; p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _root.startPoint._x - (p - 1) * 10; _root['heroP' + p]._x = _root['heroP' + p].waypointX; _root['heroP' + p].waypointY = _root.startPoint._y - (p - 1) * 10; _root['heroP' + p]._y = _root['heroP' + p].waypointY; ++p; } _root.introBackground.gotoAndStop(5); } if (timer == 660) { _root[collisionName].activated = false; _root.addSpeechBubble(320, 260, 'I have no choice but to enter the Wishing Well of Forbidden Wishes...|Queen Chigeon, you\'re going down!', true, 0, undefined, 5); ++timer; } if (timer == 662) { _root.cutscene = false; _root.showUiTip('Exit through the light to enter The Wishing Well of Forbidden Wishes.', undefined); pauseTimer = true; ++timer; } } } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 0; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (timer == 0) { p = 1; while (p <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + p])) { _root.showUiTip('Good! Now use ATTACK KEY [Z or M] to chop up the cucumber.', undefined); startTimer = true; } ++p; } } if (startTimer) { ++timer; } if (timer >= 45) { _root.chop._visible = true; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } movieClip 1052 { } movieClip 1056 { } movieClip 1059 { } movieClip 1060 { } movieClip 1062 { } movieClip 1063 { instance teddy of movieClip 277 teddington { onClipEvent (load) { if (_root.megaTeddington) { this.gotoAndStop(3); } } onClipEvent (enterFrame) { _rotation = -_parent._rotation; } } } movieClip 1064 { frame 1 { function setUpFoot(f) { f._y = legHeight; f.xSpeed = 0; f.ySpeed = 0; f.zSpeed = 0; f.zPos = 0; f.yPos = f._y; f.onGround = true; } function moveFoot(f) { f.zSpeed = -stepHeight; f.xSpeed = Math.sin(targetAngle * 0.0174532925199433) * stepSpeed; f.ySpeed = -Math.cos(targetAngle * 0.0174532925199433) * stepSpeed; f.onGround = false; } function foot(f) { f.zSpeed += feetGravity; f._x += f.xSpeed; f.yPos += f.ySpeed; f.zPos += f.zSpeed; if (f.zPos > 0) { if (!f.onGround) { _root.playSound('footstep_', _x + hitbox._x, _y + hitbox._y, 1 + random(4)); } f.onGround = true; f.zSpeed = 0; f.xSpeed = 0; f.ySpeed = 0; f.zPos = 0; if (targetDist > minTargetDist && targetDist < maxTargetDist) { if (!deathSequence && eggSequenceFinished && laserSequenceFinished && footR.onGround && footL.onGround) { if (f._name == 'footR') { if (!lastFootRight) { moveFoot(f); lastFootRight = true; } } else { if (f._name == 'footL') { if (lastFootRight) { moveFoot(f); lastFootRight = false; } } } } } } if (f._x < body._x - maxFootDist / 2) { f.xSpeed = 0; f._x = body._x - maxFootDist / 2; } else { if (f._x > body._x + maxFootDist / 2) { f.xSpeed = 0; f._x = body._x + maxFootDist / 2; } } if (f.yPos < centerYPos - maxFootDist / 2) { f.ySpeed = 0; f.yPos = centerYPos - maxFootDist / 2; } else { if (f.yPos > centerYPos + maxFootDist / 2) { f.ySpeed = 0; f.yPos = centerYPos + maxFootDist / 2; } } if (this._x + f._x + f._width > _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2) { f._x = _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2 - f._width - this._x; } else { if (this._x + f._x - f._width < _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2) { f._x = _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2 + f._width - this._x; } } if (this._y + f.yPos > _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2) { f.yPos = _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2 - this._y; } else { if (this._y + f.yPos < _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2) { f.yPos = _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2 - this._y; } } f._y = f.yPos + f.zPos; } health = 100; body.head.face.startX = body.head.face._x; body.head.face.startY = body.head.face._y; laserSequenceFinished = true; laserSpawned = false; attackTimer = 0; eggSequenceFinished = true; eggSequenceTimer = 0; layEggTimer = 520; teddingtonInsultTimer = 300; insultNr = 0; legHeight = 25; stepSpeed = 8; stepHeight = 17; maxFootDist = 40; feetGravity = 6; closestHero = 1; recoverTimer = 10; targetX = _x + 200; targetY = _y + 400; targetAngle = _root.getAngle(_x + body._x, _y + centerYPos, targetX, targetY) - 90; visualTargetAngle = _root.getAngle(_x + body._x, _y + centerYPos, _root['heroP' + closestHero]._x, _root['heroP' + closestHero]._y) - 90; minTargetDist = 20; maxTargetDist = 3000; distanceFromPlayer = 130; body.ySpeed = 0; body.yOffset = 0; footLShadow._alpha = 20; footRShadow._alpha = 20; targetDist = _root.getDist(_x + body._x, _y + centerYPos, targetX, targetY); setUpFoot(footR); setUpFoot(footL); lastFootRight = true; centerYPos = footL.yPos + (footR.yPos - footL.yPos) / 2; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName].squishable = false; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height + 10; _root[collisionName]._x = _x + hitbox._x; _root[collisionName]._y = _y + hitbox._y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; if (cutsceneMode) { _root[collisionName].activated = false; } if (cutsceneMode == undefined) { cutsceneMode = false; } else { if (cutsceneMode) { targetX = _x; targetY = _y; } } deathSequence = false; deathSequenceTimer = 0; onEnterFrame = function () { if (_root.onScreen.hitTest(this) && !_root.gamePause) { if (!cutsceneMode) { closestHero = 1; if (_root.nrOfPlayers == 2) { hero1Dist = _root.getDist(_root.heroP1._x, _root.heroP1._y, this._x + body._x, this._y + centerYPos); hero2Dist = _root.getDist(_root.heroP2._x, _root.heroP2._y, this._x + body._x, this._y + centerYPos); if (hero1Dist > hero2Dist) { closestHero = 2; } if (!_root.hero2Alive) { closestHero = 1; } else { if (!_root.hero1Alive) { closestHero = 2; } else { if (!_root.hero2Alive && !_root.hero1Alive) { closestHero = 0; } } } } if (_x + body._x < _root['heroP' + closestHero]._x) { targetX = _root['heroP' + closestHero]._x - distanceFromPlayer; } else { targetX = _root['heroP' + closestHero]._x + distanceFromPlayer; } targetY = _root['heroP' + closestHero]._y; } targetAngle = _root.getAngle(_x + body._x, _y + centerYPos, targetX, targetY) - 90; if (!cutsceneMode) { if (laserSequenceFinished && eggSequenceFinished) { visualTargetAngle = _root.getAngle(_x + body._x, _y + centerYPos, _root['heroP' + closestHero]._x, _root['heroP' + closestHero]._y) - 90; } else { visualTargetAngle = -45; } } else { visualTargetAngle = _root.getAngle(_x + body._x, _y + centerYPos, lookAtX, lookAtY) - 90; } targetDist = _root.getDist(_x + body._x, _y + centerYPos, targetX, targetY); if (!cutsceneMode) { --recoverTimer; _root.speechBubble.xPos = _x + body._x + 30; _root.speechBubble.yPos = _y + centerYPos - 150; if (laserSequenceFinished && eggSequenceFinished) { if (!_root.megaTeddington) { --layEggTimer; --teddingtonInsultTimer; if (teddingtonInsultTimer <= 0) { if (insultNr == 0) { _root.addSpeechBubble(_x + body._x + 30, _y + centerYPos - 80, 'You never really loved me!', false, 100, 120); } else { if (insultNr == 1) { _root.addSpeechBubble(_x + body._x + 30, _y + centerYPos - 80, 'Your cooking is awful!', false, 100, 120); } else { if (insultNr == 2) { _root.addSpeechBubble(_x + body._x + 30, _y + centerYPos - 80, 'You never made me smile!', false, 100, 120); } else { if (insultNr == 3) { _root.addSpeechBubble(_x + body._x + 30, _y + centerYPos - 80, 'Your feet smell like cheese!', false, 100, 120); insultNr = -1; } } } } ++insultNr; teddingtonInsultTimer = 300; } if (layEggTimer <= 0) { eggSequenceFinished = false; layEggTimer = 60 + 390 * (health / 100); } } } beingHit = false; p = 1; while (p <= _root.nrOfPlayers) { if (attackTimer <= 0) { if (attackZone.hitTest(_root['heroHitboxP' + p])) { if (_root['heroHitboxP' + p]._x < this._x + body._x) { body.head._rotation = -140; _root.hurtHero(p, 1, 10); distanceFromPlayer = 260; attackTimer = 15; } else { laserSequenceFinished = false; attackTimer = 90; } } } if (recoverTimer <= 0) { if (hitbox.hitTest(_root['heroAttackHitboxP' + p])) { _root.playSound('nunchuck_hit_', this._x + body._x, this._y + body._y - 50, 1 + random(4)); _root.playSound('chigeon_hit_', this._x + body._x, this._y + body._y - 50, 1 + random(4)); m = 0; while (m < _root['heroAttackHitboxP' + p].damageMultiplier) { _root.addMultiplier(p); _root.giveScore(p, 10); _root.addStar(this._x + body._x, this._y + body._y - 50, 200); health -= 1; distanceFromPlayer = 250; recoverTimer = 4; if (health <= 0) { if (!givenFinalScore) { _root.giveScore(p, 2000); givenFinalScore = true; } m = _root['heroAttackHitboxP' + p].damageMultiplier; } ++m; } } } ++p; } if (attackTimer <= 0) { distanceFromPlayer = 130; } } if (health <= 0) { health = 0; body.head.face._rotation = -10 + random(20); body._rotation += (-60 - body._rotation) * 0.2; body.head._rotation = -body._rotation; deathSequence = true; } if (deathSequence) { if (_root.speechBubble == undefined) { ++deathSequenceTimer; } if (deathSequenceTimer == 1) { _root.destroyAllEggs = true; _root.cutscene = true; cutsceneMode = true; eggSequenceFinished = true; laserSequenceFinished = true; lookAtX = _x + body._x; lookAtY = _y + centerYPos - 500; targetX = _x + body._x; targetY = centerYPos + 200; p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _root['heroP' + p]._x; _root['heroP' + p].waypointY = _root['heroP' + p]._y; ++p; } _root[laserName].swapDepths(_root.getNextHighestDepth()); _root[laserName].removeMovieClip(); } if (deathSequenceTimer == 10) { _root.bossMusicTVol = 15; _root.addSpeechBubble(_x + body._x - 20, _y + centerYPos - 120, 'It\'s...|... not...|... possible!', true, 0, undefined, 4); ++deathSequenceTimer; } if (deathSequenceTimer == 40) { p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _root['waypoint1P' + p]._x + 100; _root['heroP' + p].waypointY = _root['waypoint1P' + p]._y; ++p; } _root.playSound('explosion_1', _x + body._x, _y + centerYPos - 120); _root.playSound('chigeon_hit_1', _x + body._x, _y + centerYPos - 120); _root.playSound('bear_popped_1', _x + body._x, _y + centerYPos - 120); _root.addButterflies(_x + body._x - 30 + random(60), _y + centerYPos - 20 - 10 + random(20), 30); _root.addStar(_x + body._x, _y + centerYPos - 120, 500); _root.addStar(_x + body._x - 60, _y + centerYPos - 60, 200); _root.addStar(_x + body._x + 60, _y + centerYPos - 60, 200); _root.addSmoke(_x + body._x - 30, _y + centerYPos); _root.addSmoke(_x + body._x + 30, _y + centerYPos); _root.cameraShakeTimer = 60; _root.attachMovie('teddington', 'teddington', _root.getNextHighestDepth()); _root.attachMovie('shadow', 'teddingtonShadow', _root.getNextHighestDepth()); _root.teddington._x = _x + body._x + 40; _root.teddington._y = _y + centerYPos - 50; if (_root.megaTeddington) { _root.teddington.gotoAndStop(3); } _root.teddington.ySpeed = -25; _root.depthSortCustomY(_root.teddington, _root.teddingtonLandingPos._y); _root.teddingtonShadow._x = _root.teddingtonLandingPos._x; _root.teddingtonShadow._y = _root.teddingtonLandingPos._y; _root.depthSortCustomY(_root.teddingtonShadow, _root.sizeOfArea._y); _root.teddingtonShadow._alpha = 0; _root.teddingtonShadow._width = 30; _root.teddingtonShadow._height = 20; _root.teddington.onEnterFrame = function () { if (!_root.gamePause) { this._y += this.ySpeed; this._xscale = 100 + this.ySpeed; this._yscale = 100 - this.ySpeed; if (this._y < _root.teddingtonLandingPos._y || this.allowLandOnFloor) { this.ySpeed += 1.5; this.allowLandOnFloor = true; } this._x += (_root.teddingtonLandingPos._x - this._x) * 0.2; _root.teddingtonShadow._alpha = 100 - (_root.teddingtonLandingPos._y - this._y); if (this.allowLandOnFloor && this._y > _root.teddingtonLandingPos._y) { this._y = _root.teddingtonLandingPos._y; if (this.ySpeed > 10) { this.ySpeed *= -0.5; } else { this._yscale = 100; this._xscale = 100; this.ySpeed = 0; _root.teddySequence.pauseTimer = false; this.onEnterFrame = undefined; } } } }; _root[collisionName].swapDepths(_root.getNextHighestDepth()); _root[collisionName].removeMovieClip(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } body.prevX = body._x; prevCenterYPos = centerYPos; foot(footR); foot(footL); centerYPos = footL.yPos + (footR.yPos - footL.yPos) / 2; body.ySpeed += (-Math.abs(footR.zPos - footL.zPos) - body.yOffset) / 5; body.ySpeed /= 1.4; body.yOffset += body.ySpeed; body._yscale = 100 + body.ySpeed * 2; body._xscale = 100 + (100 - body._yscale); body._y = footL._y + (footR._y - footL._y) / 2 - body.yOffset - legHeight; body._x = footL._x + (footR._x - footL._x) / 2; shadow._y = centerYPos; shadow._x = body._x; healthBar._y = centerYPos - 200; healthBar._x = body._x; shadow._alpha = 30 + legHeight - (shadow._y - body._y) * 0.5; shadow._yscale = 40 + legHeight - (shadow._y - body._y) * 0.3; shadow._xscale = shadow._yscale; footRShadow._x = footR._x + footR._width / 2; footRShadow._y = footR._y - footR.zPos; footLShadow._x = footL._x - footR._width / 2; footLShadow._y = footL._y - footL.zPos; if (!cutsceneMode) { _root[collisionName].activated = true; _root[collisionName].extraThicknessX = body._x - body.prevX; _root[collisionName].extraThicknessY = centerYPos - prevCenterYPos; } hitbox._x = body._x; hitbox._y = centerYPos; attackZone._x = hitbox._x + 100; attackZone._y = hitbox._y; body.head.face._x = body.head.face.startX; body.head.face._y = body.head.face.startY; _root.moveInDir(body.head.face, visualTargetAngle, 15); body.head.face.beak._rotation = visualTargetAngle + 90; if (eggSequenceFinished) { body.head._rotation += (-15 - (footL._x - footR._x) * 1 - body.head._rotation) * 0.17; } else { ++eggSequenceTimer; if (eggSequenceTimer < 75) { body.head.face._x = body.head.face.startX; body.head.face._y = body.head.face.startY; _root.moveInDir(body.head.face, 120, 15); body.head.face.beak._rotation = 210; body.head._rotation += (30 - body.head._rotation) * 0.2; body._rotation += (-10 - body._rotation) * 0.2; } if (eggSequenceTimer == 30) { _root.playSound('kiss', _x + body._x + 35, _y + centerYPos - 80); _root.attachMovie('heart', 'introHeart', _root.getNextHighestDepth()); _root.introHeart._x = _x + body._x + 35; _root.introHeart._y = _y + centerYPos - 80; _root.introHeart._yscale = 0; _root.introHeart._xscale = 0; _root.introHeart.onEnterFrame = function () { if (!_root.gamePause) { this._yscale += (100 - this._xscale) * 0.4; this._xscale = this._yscale; this._y -= 1.5; this._alpha -= 1; if (this._alpha <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } if (eggSequenceTimer >= 75 && eggSequenceTimer < 135) { body._rotation += (45 - body._rotation) * 0.2; body.head._rotation = -body._rotation; body.head.face._rotation = -5 + random(10); } else { if (eggSequenceTimer >= 135) { body._rotation += (-45 - body._rotation) * 0.1; body.head._rotation = -body._rotation; body.head.face._rotation = -5 + random(10); } } if (eggSequenceTimer == 135) { eggName = 'egg' + _root.getNextHighestDepth(); _root.attachMovie('egg', eggName, _root.getNextHighestDepth()); _root[eggName].restrictZoneName = 'eggEnemiesRZ'; _root[eggName].finalBoss = true; _root[eggName].fromArse = true; _root[eggName].nrOfBears = 3; _root[eggName]._x = _x + body._x + 40; _root[eggName]._y = _y + centerYPos - 3; } if (eggSequenceTimer == 165) { targetX -= 150; eggSequenceTimer = 0; eggSequenceFinished = true; } attackTimer = 90; } if (!laserSequenceFinished) { body._rotation += (-45 - body._rotation) * 0.2; body.head._rotation = -body._rotation; body.head.face._rotation = -5 + random(10); if (!laserSpawned) { if (body._rotation < -44) { _root.playSound('laser_charge_1', _x + body._x + 28, _y + centerYPos - 50); laserName = 'laser' + _root.getNextHighestDepth(); _root.attachMovie('laser', laserName, _root.getNextHighestDepth()); _root[laserName].parentName = this._name; _root[laserName]._x = _x + body._x + 28; _root[laserName]._y = _y + centerYPos - 50; attackTimer = 90; laserSpawned = true; } } } else { laserSpawned = false; --attackTimer; body._rotation += -body._rotation * 0.1; } if (!cutsceneMode) { _root[collisionName]._x = _x + hitbox._x; _root[collisionName]._y = _y + hitbox._y; } this.clear(); this.lineStyle(4, 14270336, 100); this.moveTo(body._x + 15, body._y - 1); this.curveTo(body._x - 15 + Math.abs(legHeight - (footR._y - body._y)), body._y - (body._y - footR._y) / 2, footR._x, footR._y); this.moveTo(body._x - 15, body._y - 1); this.curveTo(body._x - 15 - Math.abs(legHeight - (footL._y - body._y)), body._y - (body._y - footL._y) / 2, footL._x, footL._y); _root.depthSortCustomY(this, this._y + centerYPos); } }; } } instance chigeon of movieClip 1064 { onClipEvent (load) { restrictZoneName = 'agarg454'; cutsceneMode = true; lookAtX = 300; lookAtY = 500; _visible = false; } } movieClip 1066 { frame 1 { _visible = false; _name = restrictZoneName; onEnterFrame = function () { if (detectWalls) { wallList = new Array(); w = 0; while (w <= _root.nrOfWalls) { if (this.hitTest(_root['wall' + w])) { wallList.push(_root['wall' + w]); } ++w; } } if (detectPushBlockWalls) { pushBlockWallList = new Array(); pbw = 0; while (pbw < _root.nrOfPushBlockWalls) { if (this.hitTest(_root['pushBlockWall' + pbw])) { pushBlockWallList.push(_root['pushBlockWall' + pbw]); } ++pbw; } } if (detectTeleporters) { teleporterList = new Array(); t = 0; while (t <= _root.nrOfTeleporters) { if (this.hitTest(_root['teleporter' + t])) { teleporterList.push(_root['teleporter' + t]); } ++t; } } if (detectRapidHitBlockers) { rapidHitBlockersList = new Array(); rhb = 0; while (rhb <= _root.nrOfRapidHitBlockers) { if (this.hitTest(_root['rapidHitBlocker' + rhb])) { rapidHitBlockersList.push(_root['rapidHitBlocker' + rhb]); } ++rhb; } } onEnterFrame = undefined; }; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'agarg454'; } } movieClip 1068 { } instance topBitCover of movieClip 1068 { onClipEvent (load) { _visible = false; _root.depthSortCustomY(this, 350); } } movieClip 1070 { frame 1 { if (activated == undefined) { activated = true; } } } instance endPoint of movieClip 1070 { onClipEvent (load) { fadeToWhite = true; fadeOutMusic = false; activated = true; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; } onClipEvent (enterFrame) { i = 1; while (i <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + i])) { _root.hideUiTip(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } ++i; } } } movieClip 1072 { frame 1 { _visible = false; _name = 'PCZ' + _root.nrOfPlayerCollisionZones; ++_root.nrOfPlayerCollisionZones; _width = _width - 2; _height = _height - 2; onEnterFrame = function () { wallList = new Array(); w = 0; while (w <= _root.nrOfWalls) { if (this.hitTest(_root['wall' + w])) { wallList.push(_root['wall' + w]); } ++w; } pickupList = new Array(); c = 0; while (c <= _root.nrOfPickups) { if (this.hitTest(_root['pickup' + c])) { pickupList.push(_root['pickup' + c]); } ++c; } breakBlockList = new Array(); b = 0; while (b <= _root.nrOfBreakBlocks) { if (this.hitTest(_root['breakBlock' + b])) { breakBlockList.push(_root['breakBlock' + b]); } ++b; } leverList = new Array(); b = 0; while (b <= _root.nrOfLevers) { if (this.hitTest(_root['lvr' + b])) { leverList.push(_root['lvr' + b]); } ++b; } _width = _width - (_root.heroHitboxP1._width - 7); onEnterFrame = undefined; }; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; if (_root.nrOfPlayers == 1) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } onClipEvent (enterFrame) { if (this.hitTest(_root.heroHitboxP1)) { _root.attachMovie('p2ControlHint', 'p2ControlHint', _root.getNextHighestDepth()); _root.p2ControlHint._x = _root.heroP2._x; _root.p2ControlHint._y = _root.heroP2._y - 130; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } movieClip 1075 { } movieClip 1079 { frame 1 { stop(); } instance of movieClip 1075 { onClipEvent (load) { timer = 0; } onClipEvent (enterFrame) { if (!_parent.broken) { ++timer; if (timer == 30) { _root.playSound('clock_tic'); _rotation = _rotation + 3; } if (timer == 60) { _root.playSound('clock_tac'); _rotation = _rotation + 3; timer = 0; } } else { _parent.gotoAndStop(2); } } } instance of movieClip 1075 { onClipEvent (load) { timer = 0; } onClipEvent (enterFrame) { if (!_parent.broken) { ++timer; if (timer == 30) { _root.playSound('clock_tic'); _rotation = _rotation + 3; } if (timer == 60) { _root.playSound('clock_tac'); _rotation = _rotation + 3; timer = 0; } } else { this.gotoAndStop(2); } } } } frame 17 { if (!musicTrack1) { loadMusicTrack1(); } } frame 17 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } frameSetUp = false; _root.saveState(); _root.gotoAndStop(_root._currentframe + 1); } frame 18 { if (!_root.megaTeddington) { com.newgrounds.API.logCustomEvent('Game_W1_L1'); } else { com.newgrounds.API.logCustomEvent('Ted_Game_W1_L1'); } } frame 18 { setUpFrame(); _root.hud.attachMovie('chapterTitleScreen', 'chapterTitleScreen', _root.hud.getNextHighestDepth()); _root.hud.chapterTitleScreen.titleText.text = 'Welcome to the Wishingwell'; _root.hud.chapterTitleScreen.chapterText.text = 'Chapter 1:'; _root.hud.chapterTitleScreen.noSpawnBeam = true; } movieClip 1083 { frame 1 { stop(); } } movieClip 1085 { frame 1 { stop(); ySpeed = -1.5; startY = _y; _root.depthSortCustomY(this, _y); onEnterFrame = function () { if (!_root.gamePause) { _y = _y + ySpeed; if (_y < startY) { ySpeed += 0.1; } else { ySpeed -= 0.1; } } }; } } movieClip 1087 { frame 1 { _root.depthSort(this); } } movieClip 1090 { } instance of movieClip 1090 { } instance of movieClip 1090 { } movieClip 1093 { frame 1 { stop(); } } instance of movieClip 1093 { } movieClip 1095 { frame 1 { _root.depthSortCustomY(this, _y - 2); } } instance endPoint of movieClip 1070 { onClipEvent (load) { _visible = false; } } movieClip 1097 { frame 1 { _root.depthSortCustomY(this, _y - 1); } } movieClip 1099 { frame 1 { _root.depthSort(this); } } movieClip 1101 { frame 1 { _root.depthSort(this); } } movieClip 1103 { frame 1 { _root.depthSort(this); } } movieClip 1107 { frame 1 { _root.depthSort(this); this.gotoAndStop(2 + random(3)); } } movieClip 1109 { frame 1 { _root.depthSort(this); } } movieClip 1111 { frame 1 { _root.depthSort(this); } } movieClip 1113 { frame 1 { _root.depthSort(this); } } movieClip 1115 { frame 1 { _root.depthSort(this); } } movieClip 1117 { frame 1 { _root.depthSortCustomY(this, _y + 1); } } instance startPoint of movieClip 1048 { } movieClip 1119 { frame 1 { _root.depthSortCustomY(this, this._y - 1); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } movieClip 1121 { frame 1 { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } movieClip 1123 { frame 1 { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } movieClip 1125 { frame 1 { _root.depthSort(this); } } instance soldier1 of movieClip 644 soldier { onClipEvent (load) { sType = 1; signalName = 'uiuegbfi7772'; restrictZoneName = 'agaga3jhmf47ze'; } } movieClip 1126 { instance b5 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b6 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b7 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b8 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b4 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b3 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b1 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b2 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } } movieClip 1127 { frame 1 { collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].squishable = squishable; if (health == undefined) { health = 5; } else { h = 5 - health; while (h > 0) { breakBlockIn['b' + h].swapDepths(breakBlockIn.getNextHighestDepth()); breakBlockIn['b' + h].removeMovieClip(); --h; } breakBlockIn.gotoAndStop(6 - health); } recoverTimer = 0; depthYOffset = -47; _name = 'breakBlock' + _root.nrOfBreakBlocks; ++_root.nrOfBreakBlocks; _root.depthSortCustomY(this, this._y + this.depthYOffset); } } instance of movieClip 1127 { } movieClip 1129 { frame 1 { _root.depthSort(this); } } instance of movieClip 1090 { } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } movieClip 1132 { frame 1 { _root.depthSort(this); } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 0; timer2 = 0; pauseTimer = false; pauseTimer2 = false; activated = false; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (_root.uiuegbfi7772) { _root.cutscene = false; _root.mrScience2.swapDepths(_root.getNextHighestDepth()); _root.mrScience2.removeMovieClip(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } if (!activated) { p = 1; while (p <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + p])) { activated = true; } ++p; } } else { if (_root.speechBubble == undefined && !pauseTimer) { ++timer; } if (timer == 1) { p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = this._x; _root['heroP' + p].waypointY = _root['heroP' + p]._y; ++p; } _root.switchMusicSetup(3); _root.conversationCamera1 = true; _root.cutscene = true; } if (timer == 30) { if (!_root.megaTeddington) { _root.addSpeechBubble(_root.mrScience2._x - 220, _root.mrScience2._y - 100, 'Are you sure these barriers are going to hold of that Nunchuck-Charlie-guy?', true, 20, undefined, undefined); } else { _root.addSpeechBubble(_root.mrScience2._x - 220, _root.mrScience2._y - 100, 'I\'m getting a bit tired of re-building these barriers all the time...', true, 20, undefined, undefined); } _root.lastGibberishNr = 0; _root.playSound('gibberish_0_1'); ++timer; } if (timer == 32) { if (!_root.megaTeddington) { _root.addSpeechBubble(_root.mrScience2._x, _root.mrScience2._y - 100, 'Ofcourse! Nobody is strong enough to break these bad boys.', true, -100, undefined, 1); } else { _root.addSpeechBubble(_root.mrScience2._x, _root.mrScience2._y - 100, 'I know what you mean...', true, -100, undefined, 1); } ++timer; } if (timer == 33) { pauseTimer = true; if (_root.speechBubble == undefined && !pauseTimer2) { ++timer2; } } if (timer2 == 14) { _root.mrScience2.activated = true; _root.addSpeechBubble(_root.mrScience2._x, _root.mrScience2._y - 100, 'Wh... Who\'s that over there?', true, -100, undefined, 1); ++timer2; } if (timer2 == 16) { _root.soldier1._xscale = -100; } if (timer2 == 30) { _root.mrScience2.lowerBody.zSpeed = -11; _root.mrScience2.upperBody.zSpeed = -10; _root.mrScience2.upperBody.face.gotoAndStop(3); _root.soldier1.upperBody.face.gotoAndStop(3); if (!_root.megaTeddington) { _root.addSpeechBubble(_root.mrScience2._x, _root.mrScience2._y - 100, 'Yikes! It\'s Nunchuck Charlie!|You take care of him! I\'ll get backup!', true, -100, undefined, 1); } else { _root.addSpeechBubble(_root.mrScience2._x, _root.mrScience2._y - 100, 'Yikes! It\'s Mr.Teddington!|You take care of him! I\'ll get backup!', true, -100, undefined, 1); } ++timer2; } if (timer2 == 48) { _root.mrScience2._xscale = 100; } if (timer2 == 60) { _root.mrScience2.speed = 8.5; _root.mrScience2.targetX = _root.mrScience2._x + 500; } if (timer2 == 110) { _root.uiuegbfi7772 = true; _root.mrScience2.swapDepths(_root.getNextHighestDepth()); _root.mrScience2.removeMovieClip(); _root.conversationCamera1 = false; _root.cutscene = false; _root.switchMusicSetup(4); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } } movieClip 1133 { frame 1 { if (sType == undefined) { sType = 1 + random(4); } if (sType == 1) { speed = 3; attackSpeed = 6; attackFrequency = 8; playerDamage = 4; health = 60; sendNextSoldierAt = 20; hatDropChance = 3; displayFrame = 7; } else { if (sType == 2) { speed = 3.5; attackSpeed = 7; attackFrequency = 7; playerDamage = 5; health = 60; sendNextSoldierAt = 20; hatDropChance = 3; displayFrame = 3; } else { if (sType == 3) { speed = 2; attackSpeed = 5; attackFrequency = 8; playerDamage = 6; health = 80; sendNextSoldierAt = 30; hatDropChance = 60; displayFrame = 5; } else { if (sType == 4) { speed = 4.5; attackSpeed = 7; attackFrequency = 5; playerDamage = 6; health = 50; sendNextSoldierAt = 30; hatDropChance = 20; displayFrame = 4; } else { if (sType == 5) { speed = 2; attackSpeed = 4; attackFrequency = 9; playerDamage = 8; health = 100; sendNextSoldierAt = 70; hatDropChance = 15; displayFrame = 2; } else { if (sType == 6) { speed = 2; attackSpeed = 3; attackFrequency = 10; playerDamage = 20; health = 100; sendNextSoldierAt = 90; hatDropChance = 3; displayFrame = 6; } else { if (sType == 7) { speed = 4; attackSpeed = 6; attackFrequency = 8; playerDamage = 20; health = 100; sendNextSoldierAt = 90; hatDropChance = 3; displayFrame = 1; } } } } } } } if (conveyorGroup != undefined) { if (sType != 3) { hatDropChance = -1; } } lowerBody.gotoAndStop(displayFrame); midBody.gotoAndStop(displayFrame); upperBody.gotoAndStop(displayFrame); sword.innerSword.gotoAndStop(displayFrame); lowerBody.zSpeed = 0; upperBody.zSpeed = 0; upperBody.startY = upperBody._y; upperBody.rotationSpeed = 0; targetX = _x; targetY = _y; targetAngle = _root.getAngle(_x, _y, targetX, targetY); targetDist = 100; ySpeed2 = 0; ySpeed = 0; xSpeed2 = 0; xSpeed = 0; ranXOffset = -30 + random(90); ranYOffset = -80 + random(160); sword.targetRotation = 25; sword._rotation = sword.targetRotation; sword.innerSword._rotation = 0; recoverTimer = 0; startXScale = _xscale; activated = false; checkDistTimer = 0; if (faceLeft) { _xscale = -startXScale; } playedFootstepSound = true; _root.depthSort(this); onEnterFrame = function () { if (!_root.gamePause) { if (activated) { targetAngle = _root.getAngle(_x, _y, targetX, targetY); if (_root.getDist(_x, _y, targetX, targetY) > 10) { xSpeed2 = Math.sin((targetAngle - 90) * 0.0174532925199433) * speed; ySpeed2 = -Math.cos((targetAngle - 90) * 0.0174532925199433) * speed; } else { ySpeed2 = 0; xSpeed2 = 0; } xSpeed += (xSpeed2 - xSpeed) * 0.4; ySpeed += (ySpeed2 - ySpeed) * 0.4; _x = _x + xSpeed; _y = _y + ySpeed; sword.innerSword.swoosh._alpha *= 0.6; sword._x = sword.xOffset; sword._y = sword.yOffset; lowerBody.zSpeed += 2; lowerBody._y += lowerBody.zSpeed; if (lowerBody._y > 0) { lowerBody._y = 0; if (!playedFootstepSound) { _root.playSound('footstep_', _x, _y, 6); playedFootstepSound = true; } lowerBody.zSpeed = 0; if (xSpeed2 != 0 || ySpeed2 != 0) { playedFootstepSound = false; lowerBody.zSpeed = -8; } } upperBody.rotationSpeed += -upperBody._rotation / 2; upperBody.rotationSpeed /= 1.3; upperBody._rotation += upperBody.rotationSpeed; upperBody.zSpeed += (lowerBody._y + upperBody.startY - upperBody._y) / 2; upperBody.zSpeed /= 1.9; upperBody._y += upperBody.zSpeed; if (upperBody._y > upperBody.startY + lowerBody._y + 3) { upperBody._y = upperBody.startY + lowerBody._y + 3; } midBody._height = -(upperBody._y - midBody._y); midBody._y = lowerBody._y - 40; _root.depthSort(this); } } }; } } instance mrScience2 of movieClip 1133 { onClipEvent (load) { sType = 1; faceLeft = true; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'agaga3jhmf47ze'; detectWalls = true; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 300; focusOffsetY = -100; focusPowerX = 0.9; focusPowerY = 0.9; signalName = 'conversationCamera1'; } } movieClip 1136 { frame 1 { stop(); _root.depthSort(this); } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 0; pauseTimer = false; _root.cutscene = true; _root.switchMusicSetup(1); _root.welcomeCam = true; p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _root.startPoint._x; _root['heroP' + p]._x = _root['heroP' + p].waypointX; _root['heroP' + p].waypointY = _root.startPoint._y; _root['heroP' + p]._y = _root['heroP' + p].waypointY; ++p; } } onClipEvent (enterFrame) { if (!_root.gamePause) { if (_root.speechBubble == undefined && !pauseTimer && _root.hud.chapterTitleScreen == undefined) { ++timer; } if (timer == 120) { _root.playSound('checkpoint_respawn'); spawnBeamName = 'SB' + _root.getNextHighestDepth(); _root.attachMovie('spawnBeam', spawnBeamName, _root.getNextHighestDepth()); _root[spawnBeamName]._x = _root.waypoint1._x; _root[spawnBeamName]._y = _root.waypoint1._y; _root[spawnBeamName]._yscale = 200; _root[spawnBeamName]._xscale = 200; _root.depthSortCustomY(_root[spawnBeamName], _root[spawnBeamName]._y + 50); _root.sign.gotoAndStop(2); _root.addSmoke(_root.waypoint1._x, _root.waypoint1._y + 50); _root.addSmoke(_root.waypoint1._x - 120, _root.waypoint1._y); _root.addSmoke(_root.waypoint1._x + 120, _root.waypoint1._y); p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _root.waypoint1._x + (1 - p) * 50; _root['heroP' + p]._x = _root['heroP' + p].waypointX; _root['heroP' + p].waypointY = _root.waypoint1._y + (1 - p) * 10; _root['heroP' + p]._y = _root['heroP' + p].waypointY; ++p; } } if (timer == 180) { _root.hud.overheadDisplay.onEnterFrame = function () { this._y += 4; if (this._y > this.startY) { this._y = this.startY; this.onEnterFrame = undefined; } }; _root.hud.overheadDisplay._visible = true; _root.welcomeCam = false; _root.cutscene = false; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 1; focusPowerY = 1; signalName = 'welcomeCam'; } } instance of movieClip 159 checkpoint { onClipEvent (load) { _visible = false; } } movieClip 1138 { frame 1 { _visible = false; } } movieClip 1140 { frame 1 { _visible = false; waitForSyncTriggered = false; if (customOnEnterFrame == undefined) { if (musicSetNr != undefined) { onEnterFrame = function () { i = 1; while (i <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + i])) { _root.switchMusicSetup(musicSetNr); if (waitForSync && !waitForSyncTriggered) { _root.musicWaitForSync = true; } if (triggerOnce || triggerOnce == undefined) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } ++i; } }; } else { if (musicLayerVolsArray != undefined) { onEnterFrame = function () { i = 1; while (i <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + i])) { _root.setMusicLayerVols(musicLayerVolsArray); if (triggerOnce || triggerOnce == undefined) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } ++i; } }; } } } } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 2; triggerOnce = true; } } frame 19 { if (!musicTrack1) { loadMusicTrack1(); } } frame 19 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } frameSetUp = false; _root.saveState(); _root.gotoAndStop(_root._currentframe + 1); } frame 20 { if (!_root.megaTeddington) { com.newgrounds.API.logCustomEvent('Game_W1_L2'); } else { com.newgrounds.API.logCustomEvent('Ted_Game_W1_L2'); } } frame 20 { setUpFrame(); } movieClip 1141 { frame 1 { body.heightSpeed = 0; body.heightTarget = 0; body._height = 0; head._y = 0; timer = 150; this.head.eyes.startX = this.head.eyes._x; this.head.eyes.startY = this.head.eyes._y; this.head.eyes.gotoAndStop(1); onEnterFrame = function () { if (!_root.gamePause) { if (this.hitTest(_root.onScreen)) { if (this.body._height + this.body.heightSpeed < 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } this.body.heightSpeed += (this.body.heightTarget - this.body._height) / 5; this.body.heightSpeed /= 1.2; this.body._height += this.body.heightSpeed; this.head._y = -this.body._height; if (_root.getDist(_root.heroP1._x, _root.heroP1._y, this._x, this._y - 150) < 300 || _root.getDist(_root.heroP2._x, _root.heroP2._y, this._x, this._y - 150) < 300) { body.heightTarget = -10; } else { --timer; if (timer > 0 && body.heightTarget < 150) { body.heightTarget += 1; } if (timer <= 0) { body.heightTarget = -10; } } playerAngle = _root.getAngle(_x, _y, _root.heroP1._x, _root.heroP1._y) - this._rotation; this.head.head._rotation = playerAngle + 180; this.head.antennas._rotation = -_rotation * 1.1; this.head.eyes._x = this.head.eyes.startX; this.head.eyes._y = this.head.eyes.startY; _root.moveInDir(this.head.eyes, playerAngle - 90, 10); } } }; } } movieClip 1143 { frame 1 { _root.depthSort(this); } } instance of movieClip 1143 { onClipEvent (load) { _root.depthSort(this); } } movieClip 1146 { } movieClip 1147 { frame 1 { this._name = 'lvr' + _root.nrOfLevers; ++_root.nrOfLevers; _root.attachMovie('leverLever', this._name + 'LEVER', _root.getNextHighestDepth()); _root[this._name + 'LEVER']._x = this._x + lever._x; _root[this._name + 'LEVER']._y = this._y + lever._y; _root[this._name + 'LEVER']._visible = _visible; _root.depthSortCustomY(_root[this._name + 'LEVER'], _root[this._name + 'LEVER']._y + 10); if (signalName == undefined) { signalName = 'button1'; } if (inverted) { if (_root[signalName]) { _root[_name + 'LEVER'].leverIn.gotoAndStop(2); rotTarget = 35; } else { _root[_name + 'LEVER'].leverIn.gotoAndStop(1); rotTarget = -35; } } else { if (_root[signalName]) { _root[_name + 'LEVER'].leverIn.gotoAndStop(1); rotTarget = -35; } else { _root[_name + 'LEVER'].leverIn.gotoAndStop(2); rotTarget = 35; } } _root[this._name + 'LEVER'].stick2._rotation = rotTarget; _root[this._name + 'LEVER'].stick._rotation = _root[this._name + 'LEVER'].stick2._rotation; _root[this._name + 'LEVER'].stick.handle._rotation = -_root[this._name + 'LEVER'].stick._rotation; lever.swapDepths(this.getNextHighestDepth()); lever.removeMovieClip(); if (_visible) { collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = 80; _root[collisionName]._height = 30; _root[collisionName]._x = _x; _root[collisionName]._y = _y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; } beingHit = false; recoverTimer = 0; if (inverted == undefined) { inverted = false; } var transformer = new flash.geom.Transform(_root[this._name + 'LEVER'].leverIn); var transformer2 = new flash.geom.Transform(leverInRim); var colorTransformer = transformer.colorTransform; colorTransformer.redMultiplier = red; colorTransformer.greenMultiplier = green; colorTransformer.blueMultiplier = blue; transformer.colorTransform = colorTransformer; transformer2.colorTransform = colorTransformer; _root.depthSortCustomY(this, this._y - 49); } } instance of movieClip 1147 { onClipEvent (load) { signalName = '3DiRSwiTch1'; inverted = false; red = 1; green = 0.2; blue = 0.2; } } instance of movieClip 1127 { onClipEvent (load) { signalName = '3DiRBEaR1'; } } instance of movieClip 644 soldier { onClipEvent (load) { sType = 1; signalName = '3DiRBEaR1'; restrictZoneName = 'threeLITTLEBIGBEARS1'; playIdleAnim = true; } } movieClip 1150 { } movieClip 1151 { frame 1 { this._name = 'DOOR' + _root.nrOfDoors; ++_root.nrOfDoors; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y + this.hitbox._y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root.attachMovie('doorInVertical', _name + 'door', _root.getNextHighestDepth()); _root[this._name + 'door']._x = this._x; _root[this._name + 'door']._y = this._y + this.doorIn._y; _root.depthSortCustomY(_root[this._name + 'door'], _root[this._name + 'door']._y - 95); doorIn.swapDepths(this.getNextHighestDepth()); doorIn.removeMovieClip(); _root.depthSortCustomY(this, _root.sizeOfArea._y - 45 - _y / 100); if (signalName == undefined) { signalName = 'button1'; } var transformer = new flash.geom.Transform(_root[this._name + 'door']); var transformer2 = new flash.geom.Transform(colorBits); var colorTransformer = transformer.colorTransform; colorTransformer.redMultiplier = red; colorTransformer.greenMultiplier = green; colorTransformer.blueMultiplier = blue; transformer.colorTransform = colorTransformer; transformer2.colorTransform = colorTransformer; } } instance of movieClip 1151 { onClipEvent (load) { signalName = '3DiRSwiTch2'; red = 0.7; green = 0.3; blue = 1; } } instance of movieClip 1143 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 644 soldier { onClipEvent (load) { sType = 2; signalName = '3DiRBEaR2'; restrictZoneName = 'threeLITTLEBIGBEARS1'; playIdleAnim = true; } } instance of movieClip 1127 { onClipEvent (load) { signalName = '3DiRBEaR3'; } } instance of movieClip 644 soldier { onClipEvent (load) { sType = 2; signalName = '3DiRBEaR3'; restrictZoneName = 'threeLITTLEBIGBEARS1'; playIdleAnim = true; } } instance of movieClip 1151 { onClipEvent (load) { signalName = '3DiRSwiTch1'; red = 1; green = 0.2; blue = 0.2; } } instance of movieClip 1147 { onClipEvent (load) { signalName = '3DiRSwiTch2'; red = 0.7; green = 0.3; blue = 1; } } instance of movieClip 644 soldier { onClipEvent (load) { sType = 1; signalName = '3DiRBEaR4'; restrictZoneName = 'threeLITTLEBIGBEARS1'; playIdleAnim = true; } } instance of movieClip 1127 { onClipEvent (load) { signalName = '3DiRBEaR2'; } } instance of movieClip 1127 { onClipEvent (load) { signalName = '3DiRBEaR4'; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -25; focusPowerX = 0.5; focusPowerY = 0.8; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 10; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'threeLITTLEBIGBEARS1'; detectWalls = true; } } movieClip 1156 { frame 1 { gotoAndStop(1 + random(4)); _name = 'pickup' + _root.nrOfPickups; ++_root.nrOfPickups; _root.attachMovie('shadow', _name + 'shadow', _root.getNextHighestDepth()); _root[_name + 'shadow']._x = _x; _root[_name + 'shadow']._y = _y; _root[_name + 'shadow']._height = 17; _root[_name + 'shadow']._width = 17; _root.depthSortCustomY(_root[_name + 'shadow'], _root.sizeOfArea._y - 10 - _y / 100); _root.depthSort(this); ySpeed = -0.3 - random(6) * 0.1; _y = _y - 15; startY = _y; startRot = _rotation; rotSpeed = -0.5 - random(10) * 0.1; _rotation = _rotation - (10 - random(21)); moveSpeed = 0; pickedUp = false; this.onEnterFrame = function () { if (!_root.gamePause) { _y = _y + ySpeed; ySpeed += (startY - _y) * 0.008999999999999999; _root[_name + 'shadow']._height = 17 - (startY - _y) * 0.5; _root[_name + 'shadow']._width = _root[_name + 'shadow']._height; _root[_name + 'shadow']._alpha = 60 - (startY - _y) * 3; _rotation = _rotation + rotSpeed; rotSpeed += (startRot - _rotation) * 0.017; if (pickedUp) { _root[_name + 'shadow'].swapDepths(_root.getNextHighestDepth()); _root[_name + 'shadow'].removeMovieClip(); _root.giveScore(collectingPlayer, 300); _root.addMultiplier(collectingPlayer); if (_root['hero' + collectingPlayer + 'multiplier'] <= 8) { _root.playSound('collect_', _x, _y, _root['hero' + collectingPlayer + 'multiplier']); } else { _root.playSound('collect_', _x, _y, 1 + random(8)); } this.onEnterFrame = function () { if (!_root.gamePause) { _rotation = _rotation + 20; _x = _x + (_root['heroP' + collectingPlayer]._x - _x) * 0.15; _y = _y + (_root['heroP' + collectingPlayer]._y - 50 - _y) * 0.15; _yscale = _yscale * 0.85; _xscale = _yscale * 0.85; if (_xscale <= 30) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } } }; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; } onClipEvent (enterFrame) { p = 1; while (p <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + p])) { _root.hideUiTip(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } ++p; } } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; } onClipEvent (enterFrame) { p = 1; while (p <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + p])) { _root.showUiTip('Multiply your points by collecting combs or chopping stuff quickly.', undefined); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } ++p; } } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 7; triggerOnce = true; } } instance of movieClip 1090 { } instance of movieClip 1090 { } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } movieClip 1161 { frame 1 { stop(); } frame 3 { stop(); } } movieClip 1162 { frame 1 { stop(); if (!dummy) { collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].activated = false; _root[collisionName].squishable = true; _name = 'SPIKE' + _root.nrOfSpikes; ++_root.nrOfSpikes; if (upTime == undefined) { upTime = 60; } if (downTime == undefined) { downTime = 60; } if (timeOffset == undefined) { timeOffset = 0; } startX = _x; startY = _y; animationFrame = 0; startAnimation = false; } _root.depthSortCustomY(this, this._y - 50); } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 60; timeOffset = 0; animationGroup = 'IntROToSPiKEs1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 60; timeOffset = 0; animationGroup = 'IntROToSPiKEs1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 60; timeOffset = 0; animationGroup = 'IntROToSPiKEs1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 60; timeOffset = 60; animationGroup = 'IntROToSPiKEs1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 60; timeOffset = 60; animationGroup = 'IntROToSPiKEs1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 60; timeOffset = 60; animationGroup = 'IntROToSPiKEs1'; } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 60; timeOffset = 60; animationGroup = 'IntROToSPiKEs1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 60; timeOffset = 60; animationGroup = 'IntROToSPiKEs1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 60; timeOffset = 60; animationGroup = 'IntROToSPiKEs1'; } } instance of movieClip 159 checkpoint { onClipEvent (load) { hitbox._height = 300; } } movieClip 1164 { frame 1 { _visible = false; onEnterFrame = function () { _root[animationGroup] = _root.onScreen.hitTest(this); }; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'IntROToSPiKEs1'; } } movieClip 1166 { frame 1 { _name = 'pickup' + _root.nrOfPickups; ++_root.nrOfPickups; _root.attachMovie('shadow', _name + 'shadow', _root.getNextHighestDepth()); _root[_name + 'shadow']._x = _x; _root[_name + 'shadow']._y = _y; _root[_name + 'shadow']._height = 30; _root[_name + 'shadow']._width = 30; _root.depthSortCustomY(_root[_name + 'shadow'], _root.sizeOfArea._y - 10 - _y / 100); _root.depthSort(this); ySpeed = -0.5 - random(10) * 0.1; _y = _y - 15; startY = _y; startRot = _rotation; rotSpeed = -0.5 - random(10) * 0.1; moveSpeed = 0; pickedUp = false; this.onEnterFrame = function () { if (!_root.gamePause) { _y = _y + ySpeed; ySpeed += (startY - _y) * 0.007; _root[_name + 'shadow']._height = 25 - (startY - _y) * 0.5; _root[_name + 'shadow']._width = _root[_name + 'shadow']._height; _root[_name + 'shadow']._alpha = 100 - (startY - _y) * 7; _rotation = _rotation + rotSpeed; rotSpeed += (startRot - _rotation) * 0.014; if (pickedUp) { _root[_name + 'shadow'].swapDepths(_root.getNextHighestDepth()); _root[_name + 'shadow'].removeMovieClip(); _root.giveScore(collectingPlayer, 1000); _root.addMultiplier(collectingPlayer); _root.playSound('hair_spray_pick_up', _x, _y); this.onEnterFrame = function () { if (!_root.gamePause) { _rotation = _rotation + 20; _x = _x + (_root['heroP' + collectingPlayer]._x - _x) * 0.15; _y = _y + (_root['heroP' + collectingPlayer]._y - 50 - _y) * 0.15; _yscale = _yscale * 0.85; _xscale = _yscale * 0.85; if (_xscale <= 30) { _root['hero' + collectingPlayer + 'health'] = 100; _root.addGlitter(_root['heroP' + collectingPlayer]._x, _root['heroP' + collectingPlayer]._y - 115); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } } }; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 9; triggerOnce = true; } } movieClip 1169 { } movieClip 1171 { frame 1 { stop(); ySpeed = -1; startY = _y; onEnterFrame = function () { if (!_root.gamePause) { _alpha = 50 + ySpeed * 3; _y = _y + ySpeed; if (_y < startY) { ySpeed += 0.05; } else { ySpeed -= 0.05; } } }; } } movieClip 1173 { } movieClip 1175 { frame 1 { stop(); ySpeed = -1; startY = _y; onEnterFrame = function () { if (!_root.gamePause) { waterIn._alpha = 20 + ySpeed * 5; _y = _y + ySpeed; if (_y < startY) { ySpeed += 0.05; } else { ySpeed -= 0.05; } } }; } } instance of movieClip 1143 { onClipEvent (load) { _root.depthSort(this); } } movieClip 1178 { frame 1 { _root.depthSort(this); } } movieClip 1180 { frame 1 { _visible = false; if (active == undefined) { active = true; } if (focusPowerX == undefined) { focusPowerX = 0.8; } if (focusPowerY == undefined) { focusPowerY = 0.8; } if (triggerOffSetX == undefined) { triggerOffSetX = 0; } if (focusOffsetX == undefined) { focusOffsetX = 0; } if (focusOffsetY == undefined) { focusOffsetY = 0; } if (detectHorizontal == undefined) { detectHorizontal = false; } triggered = false; emptyTimer = 30; currentWave = 0; onEnterFrame = function () { if (active && _root.onScreen.hitTest(this)) { if (!triggered) { p = 1; while (p <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + p])) { if (!detectHorizontal && Math.abs(_root['heroHitboxP' + p]._x - _x - triggerOffSetX) < 50 || detectHorizontal && Math.abs(_root['heroHitboxP' + p]._y - _y - triggerOffSetX) < 50) { checkPointName = 'cp' + _root.nrOfCheckPoints; _root.attachMovie('checkpoint', checkPointName, _root.getNextHighestDepth()); _root[checkPointName]._x = _x; _root[checkPointName]._y = _y; _root[checkPointName]._visible = false; _root.activeCheckPoint = _root.nrOfCheckPoints; c = 0; while (c < _root.nrOfCheckPoints) { _root['cp' + c].checkPointIn.gotoAndStop(1); ++c; } camName = 'cam' + _root.getNextHighestDepth(); _root.attachMovie('camFocus', camName, _root.getNextHighestDepth()); _root[camName]._x = _x; _root[camName]._y = _y; _root[camName]._width = 2000; _root[camName]._height = 2000; _root[camName].focusOffsetX = focusOffsetX; _root[camName].focusOffsetY = focusOffsetY; _root[camName].focusPowerX = focusPowerX; _root[camName].focusPowerY = focusPowerY; _root[camName].fromCombatZone = true; _root[camName].signalName = _name + 'trigger'; _root[_name + 'trigger'] = true; _root.combatZoneActive = true; if (startMusicSetNr != undefined) { _root.switchMusicSetup(startMusicSetNr); } if (startMusicLayerVolsArray != undefined) { _root.setMusicLayerVols(startMusicLayerVolsArray); } triggered = true; } } ++p; } } else { if (_root.nrOfSoldiers <= 0) { i = 0; while (i < wave[currentWave].length) { soldierName = 'SOLDIER' + _root.getNextHighestDepth(); if (wave[currentWave][i][0] > 0) { _root.attachMovie('soldier', soldierName, _root.getNextHighestDepth()); _root[soldierName].sType = wave[currentWave][i][0]; } else { if (wave[currentWave][i][0] == -1) { _root.attachMovie('mrBlueberry', soldierName, _root.getNextHighestDepth()); _root[soldierName].fromCombatZone = true; } } if (restrictZoneName != undefined) { _root[soldierName].restrictZoneName = restrictZoneName; } if (conveyorGroup != undefined) { _root[soldierName].conveyorGroup = conveyorGroup; } if (wave[currentWave][i][1] == 0) { _root[soldierName]._x = _root.gameCamera._x - _root.gameCamera._width / 2 - _root[soldierName]._width / 2; } else { if (wave[currentWave][i][1] == 1) { _root[soldierName]._x = _root.gameCamera._x + _root.gameCamera._width / 2 + _root[soldierName]._width / 2; } } if (wave[currentWave][i][2] == 0) { _root[soldierName]._y = this._y - this._height / 2 + 50; } else { if (wave[currentWave][i][2] == 1) { _root[soldierName]._y = this._y; } else { if (wave[currentWave][i][2] == 2) { _root[soldierName]._y = this._y + this._height / 2 - 50; } else { if (wave[currentWave][i][2] == undefined) { _root[soldierName]._y = this._y - this._height / 2 + random(this._height); } } } } _root[soldierName].fromCombatZone = true; ++i; } ++currentWave; if (currentWave >= wave.length) { --emptyTimer; } } else { emptyTimer = 30; } if (emptyTimer <= 0) { if (endMusicSetNr != undefined) { _root.switchMusicSetup(endMusicSetNr); } if (endMusicLayerVolsArray != undefined) { _root.setMusicLayerVols(endMusicLayerVolsArray); } _root.combatZoneActive = false; _root[_name + 'trigger'] = false; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } }; } } instance of movieClip 1180 { onClipEvent (load) { wave = new Array([[1, 1, 2], [1, 1, 0], [2, 0, 2], [1, 0, 0]], [[1, 1, 0], [2, 0, 2], [2, 0, 0], [2, 1, 2]]); restrictZoneName = 'firstbattleAreAKAPOWEE1'; startMusicSetNr = 7; endMusicSetNr = 8; } } instance of movieClip 187 egg { onClipEvent (load) { sType = 2; restrictZoneName = 'firstbattleAreAKAPOWEE1'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'firstbattleAreAKAPOWEE1'; detectWalls = true; } } movieClip 1182 { } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; } onClipEvent (enterFrame) { p = 1; while (p <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + p])) { _root.showUiTip('Collecting combs give you score.', undefined); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } ++p; } } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; } onClipEvent (enterFrame) { p = 1; while (p <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + p])) { _root.hideUiTip(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } ++p; } } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 5; triggerOnce = true; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 6; triggerOnce = true; } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'SlImEAreaDoor1'; inverted = false; red = 0.5; green = 0; blue = 1; } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 696 virus { onClipEvent (load) { restrictZoneName = 'ojbeihjba'; } } instance of movieClip 696 virus { onClipEvent (load) { restrictZoneName = 'ojbeihjba'; } } instance of movieClip 696 virus { onClipEvent (load) { restrictZoneName = 'ojbeihjba'; } } movieClip 1185 { frame 1 { this._name = 'DOOR' + _root.nrOfDoors; ++_root.nrOfDoors; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y + this.hitbox._y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root.attachMovie('doorIn', _name + 'door', _root.getNextHighestDepth()); _root[this._name + 'door']._x = this._x; _root[this._name + 'door']._y = this._y + this.doorIn._y; _root.depthSort(_root[this._name + 'door']); doorIn.swapDepths(this.getNextHighestDepth()); doorIn.removeMovieClip(); _root.depthSortCustomY(this, _root.sizeOfArea._y - _y / 1000); if (signalName == undefined) { signalName = 'button1'; } var transformer = new flash.geom.Transform(_root[this._name + 'door']); var transformer2 = new flash.geom.Transform(colorBits); var colorTransformer = transformer.colorTransform; colorTransformer.redMultiplier = red; colorTransformer.greenMultiplier = green; colorTransformer.blueMultiplier = blue; transformer.colorTransform = colorTransformer; transformer2.colorTransform = colorTransformer; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'SlImEAreaDoor1'; red = 0.5; green = 0; blue = 1; } } instance of movieClip 696 virus { onClipEvent (load) { restrictZoneName = 'ojbeihjba'; } } instance of movieClip 159 checkpoint { onClipEvent (load) { hitbox._height = 300; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'ojbeihjba'; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 7.1; triggerOnce = true; } } instance of movieClip 1143 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1162 { onClipEvent (load) { upTime = 15; downTime = 150; timeOffset = 15; animationGroup = 'spIKERunSpike1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 15; downTime = 150; timeOffset = 0; animationGroup = 'spIKERunSpike1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 15; downTime = 150; timeOffset = 30; animationGroup = 'spIKERunSpike1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 15; downTime = 150; timeOffset = 45; animationGroup = 'spIKERunSpike1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 15; downTime = 150; timeOffset = 60; animationGroup = 'spIKERunSpike1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 15; downTime = 150; timeOffset = 75; animationGroup = 'spIKERunSpike1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 15; downTime = 150; timeOffset = 90; animationGroup = 'spIKERunSpike1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 15; downTime = 150; timeOffset = 105; animationGroup = 'spIKERunSpike1'; soundOn = true; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 10; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 200; focusOffsetY = 0; focusPowerX = 0.5; focusPowerY = 0.9; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'spIKERunSpike1'; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; } onClipEvent (enterFrame) { p = 1; while (p <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + p])) { _root.hideUiTip(); _root.playerRunningControlHint.scaleTarget = 0; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } ++p; } } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; } onClipEvent (enterFrame) { p = 1; while (p <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + p])) { _root.attachMovie('playerRunningControlHint', 'playerRunningControlHint', _root.getNextHighestDepth()); _root.playerRunningControlHint._x = _root.heroP1._x; _root.playerRunningControlHint._y = _root.heroP1._y - 130; _root.showUiTip('Double tap one of the ARROW KEYS to run.', undefined); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } ++p; } } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } movieClip 1187 { frame 1 { _root.depthSort(this); } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 10; triggerOnce = true; } } instance of movieClip 1143 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1143 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1143 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1143 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1093 { } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1162 { onClipEvent (load) { upTime = 90; downTime = 90; timeOffset = 0; animationGroup = 'jnogdbi723'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 90; downTime = 90; timeOffset = 0; animationGroup = 'jnogdbi723'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 90; downTime = 90; timeOffset = 0; animationGroup = 'jnogdbi723'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 90; downTime = 90; timeOffset = 0; animationGroup = 'jnogdbi723'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 90; downTime = 90; timeOffset = 0; animationGroup = 'jnogdbi723'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 90; downTime = 90; timeOffset = 0; animationGroup = 'jnogdbi723'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 90; downTime = 90; timeOffset = 90; animationGroup = 'jnogdbi723'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 90; downTime = 90; timeOffset = 90; animationGroup = 'jnogdbi723'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 90; downTime = 90; timeOffset = 90; animationGroup = 'jnogdbi723'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 90; downTime = 90; timeOffset = 90; animationGroup = 'jnogdbi723'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 90; downTime = 90; timeOffset = 90; animationGroup = 'jnogdbi723'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 90; downTime = 90; timeOffset = 90; animationGroup = 'jnogdbi723'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 180; downTime = 0; timeOffset = 0; animationGroup = 'jnogdbi723'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 180; downTime = 0; timeOffset = 0; animationGroup = 'jnogdbi723'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 180; downTime = 0; timeOffset = 0; animationGroup = 'jnogdbi723'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 180; downTime = 0; timeOffset = 0; animationGroup = 'jnogdbi723'; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'jnogdbi723'; } } movieClip 1189 { frame 1 { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1151 { onClipEvent (load) { signalName = 'PlaCeWhereYouGoDownWIthTheDoorsDOOR2'; inverted = true; red = 0; green = 0.5; blue = 1; } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 50; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -100; focusPowerX = 0.9; focusPowerY = 0.9; } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } movieClip 1191 { } movieClip 1194 { frame 1 { stop(); } instance glow of movieClip 1191 { onClipEvent (load) { _yscale = 0; _xscale = 0; _alpha = 0; } } } movieClip 1195 { frame 1 { _root.attachMovie('shadow', _name + 'shadow', _root.getNextHighestDepth()); _root[_name + 'shadow']._x = _x; _root[_name + 'shadow']._y = _y; _root[_name + 'shadow']._height = 35; _root[_name + 'shadow']._width = 35; _root.depthSortCustomY(_root[_name + 'shadow'], _root.sizeOfArea._y - 10 - _y / 100); _root.depthSort(this); ySpeed = -0.5 - random(10) * 0.1; startY = _y - 15; _y = _y + 10; startRot = _rotation; rotSpeed = -0.5 - random(10) * 0.1; moveSpeed = 0; if (_root.savedData.data['gnome' + gnomeNumber]) { _root['gnome' + gnomeNumber] = true; playedSound = true; } this.onEnterFrame = function () { if (!_root.gamePause) { if (_root['gnome' + gnomeNumber]) { if (!playedSound) { _root.playSound('gnome_active', _x, _y); playedSound = true; } gnome.gotoAndStop(2); gnome.glow._alpha += (100 - gnome.glow._yscale) * 0.2; gnome.glow._yscale = gnome.glow._alpha; gnome.glow._xscale = gnome.glow._alpha; if (ySpeed > 1.4 || ySpeed < -1.4) { ySpeed *= 0.9; } _y = _y + ySpeed; ySpeed += (startY - _y) * 0.01; _root[_name + 'shadow']._height = 35 - (startY - _y) * 0.5; _root[_name + 'shadow']._width = _root[_name + 'shadow']._height; _root[_name + 'shadow']._alpha = 70 - (startY - _y) * 5; _rotation = _rotation + rotSpeed; rotSpeed += (startRot - _rotation) * 0.02; } else { p = 1; while (p <= _root.nrOfPlayers) { if (_root.getDist(_x, _y, _root['heroP' + p]._x, _root['heroP' + p]._y) < 60) { _root['gnome' + gnomeNumber] = true; _root.savedData.data['gnome' + gnomeNumber] = true; _root.gnomesFound = 0; g = 1; while (g <= 9) { if (_root.savedData.data['gnome' + g]) { ++_root.gnomesFound; } ++g; } if (_root.gnomesFound >= 3) { _root.unlockAchievement(1); } if (_root.gnomesFound >= 6) { _root.unlockAchievement(2); } if (_root.gnomesFound >= 9) { _root.unlockAchievement(3); } _root.savedData.flush(); } ++p; } } } }; } } instance of movieClip 1195 { onClipEvent (load) { gnomeNumber = 1; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 5; triggerOnce = true; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 9; triggerOnce = true; } } instance endPoint of movieClip 1070 { onClipEvent (load) { _visible = false; } } instance startPoint of movieClip 1048 { } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1127 { onClipEvent (load) { signalName = 'PlaCeWhereYouGoDownWIthTheDoorsBEAR2'; } } instance of movieClip 1127 { onClipEvent (load) { signalName = 'PlaCeWhereYouGoDownWIthTheDoorsBEAR1'; } } instance of movieClip 1127 { } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1151 { onClipEvent (load) { signalName = 'PlaCeWhereYouGoDownWIthTheDoorsDOOR2'; red = 0; green = 0.5; blue = 1; } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'PlaCeWhereYouGoDownWIthTheDoorsDOOR2'; red = 0; green = 0.5; blue = 1; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'PlaCeWhereYouGoDownWIthTheDoorsDOOR1'; red = 1; green = 0.5; blue = 0; } } instance of movieClip 187 egg { onClipEvent (load) { sType = 2; restrictZoneName = 'theTwoEggGuardians'; } } instance of movieClip 187 egg { onClipEvent (load) { sType = 1; restrictZoneName = 'theTwoEggGuardians'; } } instance of movieClip 644 soldier { onClipEvent (load) { sType = 1; signalName = 'PlaCeWhereYouGoDownWIthTheDoorsBEAR2'; restrictZoneName = 'theTwoEggGuardians'; playIdleAnim = true; } } instance of movieClip 644 soldier { onClipEvent (load) { sType = 2; signalName = 'PlaCeWhereYouGoDownWIthTheDoorsBEAR1'; restrictZoneName = 'theTwoEggGuardians'; playIdleAnim = true; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'PlaCeWhereYouGoDownWIthTheDoorsBEAR2'; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'PlaCeWhereYouGoDownWIthTheDoorsBEAR1'; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 40; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -75; focusPowerX = 0.7; focusPowerY = 0.95; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'theTwoEggGuardians'; detectWalls = true; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'PlaCeWhereYouGoDownWIthTheDoorsDOOR1'; inverted = false; red = 1; green = 0.5; blue = 0; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 4.1; triggerOnce = true; waitForSync = true; } } instance of movieClip 1093 { } instance of movieClip 1093 { } movieClip 1197 { } instance of movieClip 1180 { onClipEvent (load) { wave = new Array([[2, 0, 1], [1, 1, 1]], [[1, 1, 1], [2, 0, 1]], [[1, 1, 1], [2, 0, 1]], [[1, 0, 1], [2, 0, 1], [1, 1, 1], [2, 1, 1]]); restrictZoneName = 'epicBRIDGEBattTLe1'; focusOffsetY = -100; startMusicSetNr = 7.1; endMusicSetNr = 8; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'epicBRIDGEBattTLe1'; detectWalls = false; } } frame 21 { if (!musicTrack1) { loadMusicTrack1(); } } frame 21 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } frameSetUp = false; _root.saveState(); _root.gotoAndStop(_root._currentframe + 1); } frame 22 { if (!_root.megaTeddington) { com.newgrounds.API.logCustomEvent('Game_W1_L3'); } else { com.newgrounds.API.logCustomEvent('Ted_Game_W1_L3'); } } frame 22 { setUpFrame(); } instance of movieClip 187 egg { onClipEvent (load) { sType = 2; } } instance of movieClip 1180 { onClipEvent (load) { wave = new Array([[3, 0, 1], [3, 1, 1]], [[3, 1, 1], [3, 0, 1], [1, 1, 2], [2, 0, 2]], [[3, 0, 2], [3, 1, 2], [3, 0, 1], [2, 1, 1]]); focusPowerX = 0.95; focusOffsetY = -100; restrictZoneName = 'epicPicknickblankETBATTle1'; startMusicSetNr = 15; endMusicSetNr = 12; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'epicPicknickblankETBATTle1'; detectWalls = false; } } instance of movieClip 187 egg { onClipEvent (load) { sType = 1; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'biibirir115'; inverted = false; red = 0.3; green = 1; blue = 0.5; } } movieClip 1202 { } movieClip 1205 { frame 1 { stop(); } } movieClip 1208 { } movieClip 1211 { frame 1 { stop(); } } movieClip 1212 { frame 1 { top.gotoAndStop(colour); bottom.gotoAndStop(colour); bottom._yscale = 0; top._y = bottom._y; activated = false; if (inverted == undefined) { inverted = false; } _root.depthSortCustomY(this, _y - 50 * (_xscale / 100)); onEnterFrame = function () { if (!_root.gamePause) { if (animationGroup == undefined || _root[animationGroup]) { activated = false; if (signalName == undefined || !inverted && _root[signalName] || inverted && !_root[signalName]) { p = 1; while (p <= _root.nrOfPlayers) { if (_x - _root['heroHitboxP' + p]._x > -120) { if (_x - _root['heroHitboxP' + p]._x < 120) { if (_y - _root['heroHitboxP' + p]._y < 120) { if (_y - _root['heroHitboxP' + p]._y > -120) { activated = true; } } } } ++p; } } if (activated) { if (!playedSound) { _root.playSound('pop_' + (1 + random(4))); playedSound = true; } bottom._yscale += (100 - bottom._yscale) * 0.3; } else { playedSound = false; if (bottom._yscale > 0) { bottom._yscale -= 3; } else { bottom._yscale = 0; } } top._y = bottom._y - bottom._height; top.shine._alpha = bottom._yscale; } } }; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; inverted = true; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'biibirir115'; inverted = false; red = 0.3; green = 1; blue = 0.5; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'biibirir115'; inverted = false; red = 0.3; green = 1; blue = 0.5; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; signalName = 'biibirir115'; animationGroup = 'afafjtjtxrxr451'; } } instance of movieClip 704 wall_collision_triggerable { onClipEvent (load) { signalName = 'biibirir115'; } } instance of movieClip 704 wall_collision_triggerable { onClipEvent (load) { signalName = 'biibirir115'; } } instance of movieClip 704 wall_collision_triggerable { onClipEvent (load) { signalName = 'biibirir115'; inverted = true; } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'biibirir115'; inverted = false; red = 0.3; green = 1; blue = 0.5; } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 704 wall_collision_triggerable { onClipEvent (load) { signalName = 'biibirir115'; inverted = true; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 50; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0.5; focusPowerY = 0.5; } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 12; triggerOnce = true; } } instance endPoint of movieClip 1070 { } instance of movieClip 1090 { } instance of movieClip 1093 { } movieClip 1215 { } movieClip 1216 { frame 1 { swing.rotSpeed = 0; recoverTimer = 0; _root.depthSort(this); onEnterFrame = function () { if (!_root.gamePause) { --recoverTimer; if (recoverTimer <= 0 && swing._rotation < 20 && swing._rotation > -20) { p = 1; while (p <= _root.nrOfPlayers) { if (_root['heroAttackHitboxP' + p].hitTest(hitbox)) { _root.playSound('nunchuck_hit_', _x, _y, 1 + random(4)); if (_root['heroHitboxP' + p]._x < _x) { swing.rotSpeed -= 3; } else { swing.rotSpeed += 3; } _root.addStar(_x, _y - 50, 150); recoverTimer = 5; } ++p; } } swing.rotSpeed += -swing._rotation / 50; swing.rotSpeed /= 1.01; swing._rotation += swing.rotSpeed; shadow._alpha = 100 - Math.abs(swing._rotation * 2); shadow._x = -swing._rotation * 4; } }; } } movieClip 1218 { frame 1 { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } movieClip 1220 { frame 1 { _root.depthSort(this); } } movieClip 1222 { frame 1 { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1143 { onClipEvent (load) { _root.depthSort(this); } } movieClip 1224 { } movieClip 1227 { frame 1 { stop(); } } movieClip 1229 { } movieClip 1230 { frame 1 { function setUpFoot(f) { f._y = legHeight; f.xSpeed = 0; f.ySpeed = 0; f.zSpeed = 0; f.zPos = 0; f.yPos = f._y; f.onGround = true; } function moveFoot(f) { f.zSpeed = -10; f.xSpeed = Math.sin(targetAngle * 0.0174532925199433) * stepSpeed; f.ySpeed = -Math.cos(targetAngle * 0.0174532925199433) * stepSpeed; f.onGround = false; } function foot(f) { f.zSpeed += feetGravity; f._x += f.xSpeed; f.yPos += f.ySpeed; f.zPos += f.zSpeed; if (f.zPos > 0) { if (!f.onGround) { _root.playSound('footstep_', _x + hitbox._x, _y + hitbox._y, 1 + random(4)); } f.onGround = true; f.zSpeed = 0; f.xSpeed = 0; f.ySpeed = 0; f.zPos = 0; if (targetDist > minTargetDist && targetDist < 300) { if (footR.onGround && footL.onGround) { if (f._name == 'footR') { if (!lastFootRight) { moveFoot(f); lastFootRight = true; } } else { if (f._name == 'footL') { if (lastFootRight) { moveFoot(f); lastFootRight = false; } } } } } } if (f._x < body._x - maxFootDist / 2) { f.xSpeed = 0; f._x = body._x - maxFootDist / 2; } else { if (f._x > body._x + maxFootDist / 2) { f.xSpeed = 0; f._x = body._x + maxFootDist / 2; } } if (f.yPos < centerYPos - maxFootDist / 2) { f.ySpeed = 0; f.yPos = centerYPos - maxFootDist / 2; } else { if (f.yPos > centerYPos + maxFootDist / 2) { f.ySpeed = 0; f.yPos = centerYPos + maxFootDist / 2; } } if (this._x + f._x + f._width > _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2) { f._x = _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2 - f._width - this._x; } else { if (this._x + f._x - f._width < _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2) { f._x = _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2 + f._width - this._x; } } if (this._y + f.yPos > _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2) { f.yPos = _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2 - this._y; } else { if (this._y + f.yPos < _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2) { f.yPos = _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2 - this._y; } } f._y = f.yPos + f.zPos; } legHeight = 30; stepSpeed = 8; maxFootDist = 40; closestHero = 1; heartTimer = 15; recoverTimer = 10; armShake = 1; feetGravity = 1.9; targetX = _x + 200; targetY = _y + 400; targetAngle = _root.getAngle(_x + body._x, _y + centerYPos, targetX, targetY) - 90; minTargetDist = 130; speechTimer = 60; body.ySpeed = 0; body.yOffset = 0; footLShadow._alpha = 20; footRShadow._alpha = 20; targetDist = _root.getDist(_x + body._x, _y + centerYPos, targetX, targetY); setUpFoot(footR); setUpFoot(footL); lastFootRight = true; centerYPos = footL.yPos + (footR.yPos - footL.yPos) / 2; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName].squishable = false; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x + hitbox._x; _root[collisionName]._y = _y + hitbox._y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; onEnterFrame = function () { if (_root.onScreen.hitTest(this) && !_root.gamePause) { _root.speechBubble.xPos = _x + body._x; _root.speechBubble.yPos = _y + body._y - 80; if (_root.speechBubble == undefined) { --speechTimer; if (speechTimer <= 0) { ranNr = random(5); if (!beenHit) { gibberishVoice = 2; if (ranNr == 0) { speech = 'Tickle-party!'; } else { if (ranNr == 1) { speech = 'You are my new best friend!'; } else { if (ranNr == 2) { speech = 'You and me in a tree!'; } else { if (ranNr == 3) { speech = 'Beeest friieeends..!'; } else { if (ranNr == 4) { speech = 'Wooohooo!'; } } } } } } else { gibberishVoice = 3; if (ranNr == 0) { speech = 'Boo-boo-no-no :('; } else { if (ranNr == 1) { speech = 'But.. but.. Why??'; } else { if (ranNr == 2) { speech = 'I\'ll never trust another person ever again...'; } else { if (ranNr == 3) { speech = 'You have emotionally scared me.'; } else { if (ranNr == 4) { speech = 'Leave me alone!'; } } } } } } _root.addSpeechBubble(_x + body._x, _y + body._y - 80, speech, false, 0, 60, gibberishVoice); speechTimer = 150; } } closestHero = 1; if (_root.nrOfPlayers == 2) { hero1Dist = _root.getDist(_root.heroP1._x, _root.heroP1._y, this._x + body._x, this._y + centerYPos); hero2Dist = _root.getDist(_root.heroP2._x, _root.heroP2._y, this._x + body._x, this._y + centerYPos); if (hero1Dist > hero2Dist) { closestHero = 2; } if (!_root.hero2Alive) { closestHero = 1; } else { if (!_root.hero1Alive) { closestHero = 2; } else { if (!_root.hero2Alive && !_root.hero1Alive) { closestHero = 0; } } } } targetX = _root['heroP' + closestHero]._x; targetY = _root['heroP' + closestHero]._y; targetAngle = _root.getAngle(_x + body._x, _y + centerYPos, targetX, targetY) - 90; targetDist = _root.getDist(_x + body._x, _y + centerYPos, targetX, targetY); --recoverTimer; beingHit = false; p = 1; while (p <= _root.nrOfPlayers) { if (hitbox.hitTest(_root['heroAttackHitboxP' + p])) { beingHit = true; } ++p; } if (beingHit) { if (recoverTimer <= 0) { _root.playSound('nunchuck_hit_', this._x + body._x, this._y + body._y - 50, 1 + random(4)); _root.playSound('mr_pink_hit_', this._x + body._x, this._y + body._y - 50, 1 + random(3)); _root.dontHitMrPinkAchievementFailed = true; body.gotoAndStop(2); face.gotoAndPlay(2); beenHit = true; _root.addStar(this._x + body._x, this._y + body._y - 50, 200); minTargetDist = 0; stepSpeed = -13; feetGravity = 3; recoverTimer = 10; } } body.prevX = body._x; prevCenterYPos = centerYPos; foot(footR); foot(footL); centerYPos = footL.yPos + (footR.yPos - footL.yPos) / 2; body.ySpeed += (-Math.abs(footR.zPos - footL.zPos) - body.yOffset) / 5; body.ySpeed /= 1.4; body.yOffset += body.ySpeed; body._yscale = 100 + body.ySpeed * 2; body._xscale = 100 + (100 - body._yscale); body._y = footL._y + (footR._y - footL._y) / 2 - body.yOffset - legHeight; body._x = footL._x + (footR._x - footL._x) / 2; shadow._y = centerYPos; shadow._x = body._x; shadow._alpha = 30 + legHeight - (shadow._y - body._y) * 0.5; shadow._yscale = 40 + legHeight - (shadow._y - body._y) * 0.3; shadow._xscale = shadow._yscale; footRShadow._x = footR._x + footR._width / 2; footRShadow._y = footR._y - footR.zPos; footLShadow._x = footL._x - footR._width / 2; footLShadow._y = footL._y - footL.zPos; _root[collisionName].extraThicknessX = body._x - body.prevX; _root[collisionName].extraThicknessY = centerYPos - prevCenterYPos; hitbox._x = body._x; hitbox._y = centerYPos; face._x = body._x; face._y = body._y - 72; _root.moveInDir(face, targetAngle, 15); armR._x = face._x - 30; armR._y = face._y + 40; armL._x = face._x + 30; armL._y = face._y + 40; _root[collisionName]._x = _x + hitbox._x; _root[collisionName]._y = _y + hitbox._y; if (!beenHit) { armL._rotation = targetAngle; armR._rotation = armL._rotation; --heartTimer; } else { armR._rotation = 40 + armShake; armL._rotation = -40 - armShake; armShake *= -1; } if (heartTimer <= 0) { heartName = 'h' + this.getNextHighestDepth(); this.attachMovie('heart', heartName, this.getNextHighestDepth()); this[heartName]._x = body._x - 40 + random(80); this[heartName]._y = body._y - 80 - random(20); this[heartName]._rotation = -20 + random(40); this[heartName]._yscale = 20 + random(30); this[heartName]._xscale = this[heartName]._yscale; this[heartName].ySpeed = -1; this[heartName].rotSpeed = -1 + random(20) * 0.1; this[heartName].onEnterFrame = function () { if (!_root.gamePause) { if (!this._parent.beenHit) { this._y += this.ySpeed; this.ySpeed -= 0.2; this._rotation += this.rotSpeed; this._yscale -= this.ySpeed; this._xscale = this._yscale; this._alpha -= 4; } else { this._yscale = 100; this._xscale = 100; this.gotoAndStop(2); this._alpha -= 3; } if (this._alpha <= 0) { this.removeMovieClip(); } } }; heartTimer = 5 + random(5); } this.clear(); this.lineStyle(2, 0, 100); this.moveTo(body._x + 20, body._y - 1); this.curveTo(body._x + 20 + Math.abs(legHeight - (footR._y - body._y)), body._y - (body._y - footR._y) / 2, footR._x, footR._y); this.moveTo(body._x - 20, body._y - 1); this.curveTo(body._x - 20 - Math.abs(legHeight - (footL._y - body._y)), body._y - (body._y - footL._y) / 2, footL._x, footL._y); _root.depthSortCustomY(this, this._y + centerYPos); } }; } } instance of movieClip 1230 { onClipEvent (load) { restrictZoneName = 'helloMRPinkMan1'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'helloMRPinkMan1'; } } movieClip 1233 { } movieClip 1235 { } movieClip 1237 { } movieClip 1238 { frame 1 { depthYOffset = 0; accelerationSpeed = 0.06; decelerationSpeed = 0.2; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].squishable = false; hitbox._width -= 10; hitbox._height -= 10; recoverTimer = 0; ySpeed2 = 0; xSpeed2 = 0; ySpeed = 0; xSpeed = 0; movementMultiplyer = 0; collideLeft = false; collideRight = collideLeft; collideDown = collideRight; collideUp = collideDown; if (upMovement != undefined || downMovement != undefined || leftMovement != undefined || rightMovement != undefined) { startX = _x; startY = _y; if (upMovement == undefined) { upMovement = 0; } if (downMovement == undefined) { downMovement = 0; } if (rightMovement == undefined) { rightMovement = 0; } if (leftMovement == undefined) { leftMovement = 0; } } _name = 'pushBlock' + _root.nrOfPushBlocks; ++_root.nrOfPushBlocks; _root.mrScience.pushBlock = _name; } instance of movieClip 1233 { onClipEvent (load) { startY = _y; } onClipEvent (enterFrame) { if (!_root.gamePause) { _y = startY - random(Math.abs(_parent.xSpeed * 2)); } } } instance of movieClip 1235 { onClipEvent (load) { startY = _y; } onClipEvent (enterFrame) { if (!_root.gamePause) { _y = startY - random(Math.abs(_parent.xSpeed * 2)); } } } instance of movieClip 1237 { onClipEvent (load) { startY = _y; } onClipEvent (enterFrame) { if (!_root.gamePause) { _y = startY - random(Math.abs(_parent.xSpeed * 2)); } } } } instance of movieClip 1238 { onClipEvent (load) { upMovement = 0; downMovement = 0; rightMovement = 200; leftMovement = 200; } } instance of movieClip 1093 { onClipEvent (load) { _root.depthSortCustomY(this, _y + 400); this.gotoAndStop(2); } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 13; triggerOnce = true; } } instance of movieClip 1195 { onClipEvent (load) { gnomeNumber = 2; } } movieClip 1240 { frame 1 { _root.depthSortCustomY(this, _y - 100); } } movieClip 1244 { frame 1 { stop(); } } movieClip 1245 { frame 1 { doorIn.startX = doorIn._x; _root.depthSort(this); onEnterFrame = function () { if (!_root.gamePause) { if (_root[signalName]) { if (!playedSound) { _root.playSound('door_open_', _x, _y, 1 + random(3)); playedSound = true; } doorIn._x += (doorIn._x + 120 - doorIn._x) * 0.3; } } }; } } instance of movieClip 1245 { onClipEvent (load) { signalName = 'slimeMAZE_2'; } } instance of movieClip 696 virus { onClipEvent (load) { signalName = 'slimeMAZE_2'; restrictZoneName = 'haharyrysr'; } } instance of movieClip 1245 { onClipEvent (load) { signalName = 'slimeMAZE_3'; } } instance of movieClip 696 virus { onClipEvent (load) { signalName = 'slimeMAZE_3'; restrictZoneName = 'haharyrysr'; } } instance of movieClip 1245 { onClipEvent (load) { signalName = 'slimeMAZE_4'; } } instance of movieClip 696 virus { onClipEvent (load) { signalName = 'slimeMAZE_4'; restrictZoneName = 'haharyrysr'; } } instance toiletDoor of movieClip 1245 { onClipEvent (load) { signalName = 'slimeMAZE_5'; doorIn.gotoAndStop(2); } } instance toiletSoldier of movieClip 1133 { onClipEvent (load) { sType = 3; sword._visible = false; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'slimeCORRIDdorDoor1'; red = 1; green = 0.5; blue = 0.5; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'slimeCORRIDdorDoor1'; red = 1; green = 0.5; blue = 0.5; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'slimeMAZE_2'; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'slimeMAZE_3'; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'slimeMAZE_4'; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 0; } onClipEvent (enterFrame) { if (!startSequence) { if (this.hitTest(_root.heroHitboxP1) || this.hitTest(_root.heroHitboxP2)) { _root.slimeMAZE_5 = true; startSequence = true; } } else { ++timer; if (timer == 7) { _root.playSound('surprised_bear', _x, _y); _root.toiletSoldier.activated = true; _root.toiletSoldier.upperBody.face.gotoAndStop(3); _root.toiletSoldier.lowerBody.zSpeed = -11; _root.toiletSoldier.upperBody.zSpeed = -10; } if (timer == 23) { _root.toiletDoor.onEnterFrame = function () { this.doorIn._x += (this.doorIn.startX - this.doorIn._x) * 0.4; }; } if (timer == 40) { _root.playSound('bear_fart', _x, _y); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'haharyrysr'; detectWalls = true; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 15; triggerOnce = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 0; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 5; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 10; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 15; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 20; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 25; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 30; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 35; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 40; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 45; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 50; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 55; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 60; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 65; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 70; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 75; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 80; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 85; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 90; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 95; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 100; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 105; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 110; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 30; downTime = 150; timeOffset = 115; animationGroup = 'spIKERunSpike3'; soundOn = true; } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 100; focusOffsetY = 0; focusPowerX = 0.5; focusPowerY = 0.9; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'spIKERunSpike3'; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 14; triggerOnce = true; } } instance of movieClip 1093 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; signalName = 'buiuas7'; animationGroup = 'ki2o8s7'; inverted = false; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'buiuas7'; animationGroup = 'ki2o8s7'; inverted = false; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; signalName = 'buiuas7'; animationGroup = 'ki2o8s7'; inverted = false; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'buiuas7'; animationGroup = 'ki2o8s7'; inverted = false; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; signalName = 'buiuas7'; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'buiuas7'; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; signalName = 'buiuas7'; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; signalName = 'buiuas7'; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'ki2o8s7'; inverted = true; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'buiuas7'; inverted = false; red = 1; green = 0; blue = 0; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'ki2o8s7'; } } instance of movieClip 704 wall_collision_triggerable { onClipEvent (load) { signalName = 'buiuas7'; inverted = false; } } instance of movieClip 704 wall_collision_triggerable { onClipEvent (load) { signalName = 'buiuas7'; inverted = true; } } instance of movieClip 704 wall_collision_triggerable { onClipEvent (load) { signalName = 'buiuas7'; inverted = false; } } instance of movieClip 704 wall_collision_triggerable { onClipEvent (load) { signalName = 'buiuas7'; inverted = true; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 40; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 50; focusOffsetY = -100; focusPowerX = 0.8; focusPowerY = 0.8; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 12; triggerOnce = true; } } instance of movieClip 1093 { } instance of movieClip 1090 { } instance of movieClip 644 soldier { onClipEvent (load) { sType = 3; signalName = 'surpriseBearSSS1'; restrictZoneName = 'startBEAREnenmy1'; playIdleAnim = true; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'surpriseBearSSS1'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'startBEAREnenmy1'; detectWalls = false; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 187 egg { onClipEvent (load) { sType = 3; restrictZoneName = 'startBEAREnenmy1'; } } instance of movieClip 187 egg { onClipEvent (load) { sType = 3; restrictZoneName = 'startBEAREnenmy1'; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 11.1; triggerOnce = true; } } instance of movieClip 1090 { } instance of movieClip 1093 { } movieClip 1248 { frame 1 { _root.depthSort(this); } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 11; triggerOnce = true; waitForSync = true; } } instance of movieClip 159 checkpoint { onClipEvent (load) { hitbox._height = 300; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 15; downTime = 90; timeOffset = 0; animationGroup = 'SPIKESinFrONT1'; soundOn = true; } } instance of movieClip 1127 { } instance of movieClip 1127 { } instance of movieClip 1162 { onClipEvent (load) { upTime = 15; downTime = 90; timeOffset = 0; animationGroup = 'SPIKESinFrONT1'; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'SPIKESinFrONT1'; } } instance startPoint of movieClip 1048 { } frame 23 { if (!musicTrack1) { loadMusicTrack1(); } } frame 23 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } frameSetUp = false; _root.saveState(); _root.gotoAndStop(_root._currentframe + 1); } frame 24 { if (!_root.megaTeddington) { com.newgrounds.API.logCustomEvent('Game_W1_L4'); } else { com.newgrounds.API.logCustomEvent('Ted_Game_W1_L4'); } } frame 24 { setUpFrame(); } instance of movieClip 1143 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1195 { onClipEvent (load) { gnomeNumber = 3; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 12; triggerOnce = true; } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1162 { onClipEvent (load) { upTime = 70; downTime = 100; timeOffset = 0; animationGroup = 'spIKERunSpike2'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 70; downTime = 100; timeOffset = 15; animationGroup = 'spIKERunSpike2'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 70; downTime = 100; timeOffset = 0; animationGroup = 'spIKERunSpike2'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 70; downTime = 100; timeOffset = 15; animationGroup = 'spIKERunSpike2'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 70; downTime = 100; timeOffset = 30; animationGroup = 'spIKERunSpike2'; } } instance of movieClip 1127 { } instance of movieClip 1162 { onClipEvent (load) { upTime = 70; downTime = 100; timeOffset = 30; animationGroup = 'spIKERunSpike2'; soundOn = true; } } instance of movieClip 1127 { } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1127 { } instance of movieClip 1162 { onClipEvent (load) { upTime = 70; downTime = 100; timeOffset = 0; animationGroup = 'spIKERunSpike2'; soundOn = true; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 10; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 70; downTime = 100; timeOffset = 30; animationGroup = 'spIKERunSpike2'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 70; downTime = 100; timeOffset = 15; animationGroup = 'spIKERunSpike2'; soundOn = true; } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'spIKERunSpike2'; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 16; triggerOnce = true; } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 120; timeOffset = 0; animationGroup = 'spikeBattlEGROUND11'; soundOn = true; } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 120; timeOffset = 165; animationGroup = 'spikeBattlEGROUND11'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 120; timeOffset = 15; animationGroup = 'spikeBattlEGROUND11'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 120; timeOffset = 30; animationGroup = 'spikeBattlEGROUND11'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 120; timeOffset = 60; animationGroup = 'spikeBattlEGROUND11'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 120; timeOffset = 75; animationGroup = 'spikeBattlEGROUND11'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 120; timeOffset = 90; animationGroup = 'spikeBattlEGROUND11'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 120; timeOffset = 105; animationGroup = 'spikeBattlEGROUND11'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 120; timeOffset = 120; animationGroup = 'spikeBattlEGROUND11'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 120; timeOffset = 135; animationGroup = 'spikeBattlEGROUND11'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 120; timeOffset = 150; animationGroup = 'spikeBattlEGROUND11'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 120; timeOffset = 45; animationGroup = 'spikeBattlEGROUND11'; soundOn = true; } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'circleSpieksLever1'; red = 1; green = 0.3; blue = 0.3; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'circleSpieksLever1'; inverted = false; red = 1; green = 0.3; blue = 0.3; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'circleSpieksLever2'; red = 0.3; green = 0.3; blue = 1; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'circleSpieksLever2'; inverted = false; red = 0.3; green = 0.3; blue = 1; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 40; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0.6; focusPowerY = 0.8; } } instance of movieClip 644 soldier { onClipEvent (load) { sType = 1; signalName = 'circleSpieksEnemy2'; restrictZoneName = 'cricleSpikeAREAeaaeBear1'; playIdleAnim = true; } } instance of movieClip 644 soldier { onClipEvent (load) { sType = 2; signalName = 'circleSpieksEnemy1'; restrictZoneName = 'cricleSpikeAREAeaaeBear2'; playIdleAnim = true; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'circleSpieksEnemy1'; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'circleSpieksEnemy2'; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'spikeBattlEGROUND11'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'cricleSpikeAREAeaaeBear1'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'cricleSpikeAREAeaaeBear2'; } } instance of movieClip 159 checkpoint { onClipEvent (load) { hitbox._height = 300; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 16; triggerOnce = true; } } instance of movieClip 1093 { } instance of movieClip 1093 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1093 { } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1143 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance of movieClip 1143 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 10; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 300; focusPowerX = 0.9; focusPowerY = 0.05; } } instance of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; soundOn = true; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 60; downTime = 90; timeOffset = 0; animationGroup = 'GoNGONIndDOwn1'; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 14.1; triggerOnce = true; } } instance of movieClip 1143 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1143 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 159 checkpoint { onClipEvent (load) { hitbox._width = 300; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 9; triggerOnce = true; } } instance of movieClip 1178 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'EndOFLevel1Worm'; } } instance endOfLevelGiraffe1 of movieClip 685 undergroundWormBump { onClipEvent (load) { restrictZoneName = 'EndOFLevel1Worm'; timer = 0; activated = false; } } instance endOfLevelGiraffe3 of movieClip 685 undergroundWormBump { onClipEvent (load) { restrictZoneName = 'EndOFLevel1Worm'; timer = 0; activated = false; } } instance endOfLevelGiraffe2 of movieClip 685 undergroundWormBump { onClipEvent (load) { restrictZoneName = 'EndOFLevel1Worm'; timer = 0; activated = false; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0.5; focusPowerY = 0.5; signalName = 'endOfLevelPlayCam'; } } instance endOfLevelSpike1 of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance endOfLevelSpike2 of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance endOfLevelTrigger of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (_root.nrOfPlayers == 2) { touchP1 = this.hitTest(_root.heroHitboxP1); touchP2 = this.hitTest(_root.heroHitboxP2); if (touchP1 && touchP2 || touchP1 && !_root.hero2Alive || touchP2 && !_root.hero1Alive) { startSequence = true; } } else { if (this.hitTest(_root.heroHitboxP1)) { startSequence = true; } } if (startSequence) { _root.playSound('spike_appear_', _root.endOfLevelSpike1._x, _root.endOfLevelSpike1._y, 1 + random(4)); s1 = 1; while (s1 <= 2) { s2 = 1; while (s2 <= 4) { _root['endOfLevelSpike' + s1]['s' + s2].play(); ++s2; } ++s1; } s1 = 1; while (s1 <= 10) { s2 = 1; while (s2 <= 4) { _root['endOfLevelSpikeEnd' + s1]['s' + s2].play(); ++s2; } ++s1; } _root[collisionName].activated = true; _root.cutscene = true; p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _root['waypoint1P' + p]._x; _root['heroP' + p].waypointY = _root['waypoint1P' + p]._y; ++p; } _root.endOfLevelCutsceneCam = true; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } instance of movieClip 702 wall_collision { onClipEvent (load) { activated = false; } onClipEvent (enterFrame) { _root.endOfLevelTrigger.collisionName = _name; this.onEnterFrame = undefined; } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1121 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1119 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 50; focusOffsetY = -50; focusPowerX = 1; focusPowerY = 1; signalName = 'endOfLevelCutsceneCam'; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 0; pauseTimer = false; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (_root.nrOfPlayers == 2) { touchP1 = this.hitTest(_root.heroHitboxP1); touchP2 = this.hitTest(_root.heroHitboxP2); if (touchP1 && touchP2 || touchP1 && !_root.hero2Alive || touchP2 && !_root.hero1Alive) { startSequence = true; } } else { if (this.hitTest(_root.heroHitboxP1)) { startSequence = true; } } if (startSequence) { if (!pauseTimer) { ++timer; } if (timer == 30) { p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p]._xscale = 100; _root['heroSwordP' + p]._xscale = 100; _root['heroSwordP' + p].targetRotation = 25; ++p; } } if (timer == 60) { _root.endOfLevelGiraffe1.timer = 0; _root.endOfLevelGiraffe1.makeHeadAppear = true; _root.endOfLevelGiraffe1.activated = true; } if (timer == 85) { _root.addSpeechBubble(_root.endOfLevelGiraffe1._x, _root.endOfLevelGiraffe1._y - 100, 'Stop...', false, -100, undefined, 1); } if (timer == 90) { _root.endOfLevelGiraffe2.makeHeadAppear = true; _root.endOfLevelGiraffe2.activated = true; } if (timer == 115) { _root.addSpeechBubble(_root.endOfLevelGiraffe2._x, _root.endOfLevelGiraffe2._y - 100, '... right...', false, -100, undefined, 1); } if (timer == 120) { _root.endOfLevelGiraffe3.makeHeadAppear = true; _root.endOfLevelGiraffe3.activated = true; } if (timer == 145) { _root.addSpeechBubble(_root.endOfLevelGiraffe3._x, _root.endOfLevelGiraffe3._y - 100, '... there!', false, -100, undefined, 1); } if (timer == 180) { _root.removeSpeechBubble(); _root.cutscene = false; _root.endOfLevelPlayCam = true; _root.endOfLevelCutsceneCam = false; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } } movieClip 1251 { } movieClip 1252 { instance b77 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b78 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b79 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b80 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b82 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b81 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b71 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b72 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b69 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b70 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b75 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b73 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b76 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b74 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b63 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b64 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b65 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b67 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b66 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b68 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b57 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b58 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b55 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b56 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b61 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b59 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b62 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b60 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b49 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b50 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b51 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b53 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b52 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b54 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b43 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b44 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b41 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b42 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b46 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b45 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b48 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b47 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b35 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b36 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b37 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b39 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b38 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b40 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b29 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b30 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b27 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b28 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b34 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b31 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b33 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b32 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b21 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b22 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b23 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b25 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b24 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b26 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b17 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b18 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b13 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b14 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b19 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b15 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b20 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b16 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b9 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b10 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b11 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b12 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b3 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b4 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b1 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b2 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b7 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } instance b5 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b8 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(2); } } instance b6 of movieClip 135 breakBlockBit { onClipEvent (load) { this.gotoAndStop(1); } } } movieClip 1253 { frame 1 { collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; collisionName2 = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName2, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName2]._width = 50; _root[collisionName2]._height = 50; _root[collisionName2]._x = _x - 75; _root[collisionName2]._y = _y - 25; _root[collisionName2].extraThicknessY = 0; _root[collisionName2].extraThicknessX = 0; collisionName3 = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName3, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName3]._width = 50; _root[collisionName3]._height = 50; _root[collisionName3]._x = _x + 75; _root[collisionName3]._y = _y - 25; _root[collisionName3].extraThicknessY = 0; _root[collisionName3].extraThicknessX = 0; if (health == undefined) { health = 82; } recoverTimer = 0; _root.depthSortCustomY(this, this._y + 100); onEnterFrame = function () { if (!_root.gamePause) { p = 1; while (p <= _root.nrOfPlayers) { if (this.hitbox.hitTest(_root['heroAttackHitboxP' + p]) && this.recoverTimer <= 0) { _root.playSound('box_hit_', _x, _y, 1 + random(4)); m = 0; while (m < _root['heroAttackHitboxP' + p].damageMultiplier) { if (this.health > 13) { _root.addStar(this._x, this._y - 50, 150); i = 0; while (i < 3) { _root.addBreakBlockBit(this._x + this.breakBlockIn['b' + (82 - this.health)]._x, this._y + this.breakBlockIn['b' + (82 - this.health)]._y, this.breakBlockIn['b' + (82 - this.health)]._currentframe, 150); this.breakBlockIn['b' + (82 - this.health)].swapDepths(this.breakBlockIn.getNextHighestDepth()); this.breakBlockIn['b' + (82 - this.health)].removeMovieClip(); this.recoverTimer = 5; --this.health; ++i; } } else { if (health > 0) { _root.addStar(this._x, this._y - 50, 300); i = 0; while (i < 14) { _root.addBreakBlockBit(this._x + this.breakBlockIn['b' + (82 - this.health)]._x, this._y + this.breakBlockIn['b' + (82 - this.health)]._y, this.breakBlockIn['b' + (82 - this.health)]._currentframe); this.breakBlockIn['b' + (82 - this.health)].swapDepths(this.breakBlockIn.getNextHighestDepth()); this.breakBlockIn['b' + (82 - this.health)].removeMovieClip(); this.recoverTimer = 5; --this.health; ++i; } _root.depthSort(this); _root[collisionName].activated = false; } } _root.addMultiplier(p); _root.giveScore(p, 10); if (health <= 0) { _root.giveScore(p, 100); m = _root['heroAttackHitboxP' + p].damageMultiplier; this.onEnterFrame = undefined; } ++m; } } ++p; } if (this.recoverTimer > 0) { --this.recoverTimer; } } }; } } instance of movieClip 1253 { } instance endOfLevelSpikeEnd1 of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance endOfLevelSpikeEnd2 of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance endOfLevelSpikeEnd3 of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance endOfLevelSpikeEnd4 of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance endOfLevelSpikeEnd5 of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance endOfLevelSpikeEnd6 of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance endOfLevelSpikeEnd7 of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance endOfLevelSpikeEnd8 of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance endOfLevelSpikeEnd9 of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance endOfLevelSpikeEnd10 of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance of movieClip 1162 { onClipEvent (load) { dummy = true; } } instance finalSequenceTrigger of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 0; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (_root.nrOfUndergroundWormsKilled >= 3) { ++timer; if (timer == 30) { _root.cutscene = true; p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _root['heroP' + p]._x; _root['heroP' + p].waypointY = _root['heroP' + p]._y; ++p; } _root.switchMusicSetup(12); _root.endOfLevelPlayCam = false; _root.endOfLevelRemoveSpikesCutsceneCam = true; } if (timer == 60) { s1 = 1; while (s1 <= 10) { s2 = 1; while (s2 <= 4) { _root['endOfLevelSpikeEnd' + s1]['s' + s2].gotoAndStop(2); ++s2; } ++s1; } } if (timer == 61) { _root.playSound('spike_disappear_', _root.endOfLevelSpikeEnd2._x, _root.endOfLevelSpikeEnd2._y, 1 + random(4)); s1 = 1; while (s1 <= 10) { s2 = 1; while (s2 <= 4) { _root['endOfLevelSpikeEnd' + s1]['s' + s2].gotoAndStop(1); ++s2; } ++s1; } _root[collisionName].activated = false; } if (timer == 80) { _root.endOfLevelRemoveSpikesCutsceneCam = false; _root.endOfLevelPlayCam = true; } if (timer == 100) { _root.cutscene = false; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 50; focusOffsetY = -50; focusPowerX = 1; focusPowerY = 1; signalName = 'endOfLevelRemoveSpikesCutsceneCam'; } } instance of movieClip 702 wall_collision { onClipEvent (load) { activated = true; } onClipEvent (enterFrame) { _root.finalSequenceTrigger.collisionName = _name; this.onEnterFrame = undefined; } } instance endPoint of movieClip 1070 { onClipEvent (load) { gotoFrame = 30; fadeToWhite = true; _visible = false; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 17; triggerOnce = true; } } instance startPoint of movieClip 1048 { } instance of movieClip 1090 { } instance of movieClip 1090 { } instance of movieClip 1090 { } instance of movieClip 1093 { onClipEvent (load) { _root.depthSort(this); } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 3; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 60; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 100; focusOffsetY = 0; focusPowerX = 0.7; focusPowerY = 0.7; } } instance of movieClip 696 virus { onClipEvent (load) { signalName = 'w262'; restrictZoneName = 'dtjdjd61644'; } } instance of movieClip 696 virus { onClipEvent (load) { signalName = 'r24tas'; restrictZoneName = 'dtjdjd61644'; } } instance of movieClip 696 virus { onClipEvent (load) { signalName = 'nl2489'; restrictZoneName = 'dtjdjd61644'; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'r24tas'; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'nl2489'; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'w262'; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 1; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1212 { onClipEvent (load) { colour = 2; animationGroup = 'oppopopoopp99'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'dtjdjd61644'; detectWalls = true; } } instance of movieClip 1140 { onClipEvent (load) { musicSetNr = 12; triggerOnce = true; } } frame 30 { if (!musicTrack2) { loadMusicTrack2(); } } frame 30 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } frameSetUp = false; _root.saveState(); _root.gotoAndStop(_root._currentframe + 1); } frame 31 { if (!_root.megaTeddington) { com.newgrounds.API.logCustomEvent('Game_W2_L1'); } else { com.newgrounds.API.logCustomEvent('Ted_Game_W2_L1'); } } frame 31 { setUpFrame(); _root.hud.attachMovie('chapterTitleScreen', 'chapterTitleScreen', _root.hud.getNextHighestDepth()); _root.hud.chapterTitleScreen.titleText.text = 'The Fruit \'n Veg R&D Facilities'; _root.hud.chapterTitleScreen.chapterText.text = 'Chapter 2:'; _root.hud.chapterTitleScreen.achievementNr = 7; } movieClip 1259 { frame 1 { stop(); } } movieClip 1261 { } movieClip 1263 { frame 1 { _root.depthSortCustomY(this, this._y + 1); } } movieClip 1265 { frame 1 { _root.depthSortCustomY(this, this._y - 98); } } movieClip 1267 { frame 1 { _root.depthSort(this); } } movieClip 1269 { } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'combatZONEONAE8163'; detectWalls = true; } } instance of movieClip 1180 { onClipEvent (load) { wave = new Array([[4, 0, 0], [4, 1, 2], [4, 1, 0]], [[5, 0, 0], [4, 1, 2]], [[4, 0, 2], [5, 0, 0], [4, 1, 0], [5, 1, 2]]); focusOffsetY = -100; focusPowerX = 0.95; restrictZoneName = 'combatZONEONAE8163'; startMusicLayerVolsArray = new Array(100, 69, 0, 70, 0, 45); endMusicLayerVolsArray = new Array(52, 0, 62, 9, 0, 0); } } movieClip 1271 { frame 1 { _root.depthSortCustomY(this, this._y - 98); } } movieClip 1273 { frame 1 { _root.depthSortCustomY(this, this._y - 98); } } movieClip 1276 { } movieClip 1277 { frame 1 { _root.depthSortCustomY(this, this._y - 50); } instance blueberry of movieClip 1276 { onClipEvent (load) { startY = _y; ySpeed = -0.5; if (random(2) == 1) { ySpeed *= -1; } _y = _y - random(20) * 0.1; rotSpeed = -1 + random(20) * 0.1; } onClipEvent (enterFrame) { if (!_root.gamePause) { _y = _y + ySpeed; _rotation = _rotation + rotSpeed; if (_y < startY) { ySpeed += 0.01; } else { ySpeed -= 0.01; } } } } } movieClip 1279 { instance swoosh of movieClip 307 { onClipEvent (load) { _alpha = 0; } } } movieClip 1280 { } movieClip 1281 { } movieClip 1284 { frame 1 { stop(); } } movieClip 1285 { } movieClip 1287 { } movieClip 1288 { frame 1 { speed = 3; lowerBody.zSpeed = 0; upperBody.zSpeed = 0; upperBody.startY = upperBody._y; upperBody.rotationSpeed = 0; targetX = _x; targetY = _y; targetAngle = _root.getAngle(_x, _y, targetX, targetY); targetDist = 100; ySpeed2 = 0; ySpeed = 0; xSpeed2 = 0; xSpeed = 0; ranXOffset = -30 + random(90); ranYOffset = -80 + random(160); sword.targetRotation = 25; sword._rotation = sword.targetRotation; sword.innerSword._rotation = 0; recoverTimer = 0; startXScale = _xscale; activated = false; checkDistTimer = 0; if (faceLeft) { _xscale = -startXScale; } _root.depthSort(this); onEnterFrame = function () { if (!_root.gamePause) { if (activated) { if (!playedSound) { if (lowerBody.zSpeed == -11) { _root.playSound('gibberish_6_', _x, _y, 3 + random(2)); playedSound = true; } } targetAngle = _root.getAngle(_x, _y, targetX, targetY); if (_root.getDist(_x, _y, targetX, targetY) > 10) { xSpeed2 = Math.sin((targetAngle - 90) * 0.0174532925199433) * speed; ySpeed2 = -Math.cos((targetAngle - 90) * 0.0174532925199433) * speed; } else { ySpeed2 = 0; xSpeed2 = 0; } xSpeed += (xSpeed2 - xSpeed) * 0.4; ySpeed += (ySpeed2 - ySpeed) * 0.4; _x = _x + xSpeed; _y = _y + ySpeed; sword.innerSword.swoosh._alpha *= 0.6; sword._x = sword.xOffset; sword._y = sword.yOffset; lowerBody.zSpeed += 2; lowerBody._y += lowerBody.zSpeed; if (lowerBody._y > 0) { if (!playedFootstepSound) { _root.playSound('footstep_', _x, _y, 6); playedFootstepSound = true; } lowerBody._y = 0; lowerBody.zSpeed = 0; if (xSpeed2 != 0 || ySpeed2 != 0) { lowerBody.zSpeed = -8; playedFootstepSound = false; } } upperBody.rotationSpeed += -upperBody._rotation / 2; upperBody.rotationSpeed /= 1.3; upperBody._rotation += upperBody.rotationSpeed; upperBody.zSpeed += (lowerBody._y + upperBody.startY - upperBody._y) / 2; upperBody.zSpeed /= 1.9; upperBody._y += upperBody.zSpeed; if (upperBody._y > upperBody.startY + lowerBody._y + 3) { upperBody._y = upperBody.startY + lowerBody._y + 3; } midBody._height = -(upperBody._y - midBody._y); midBody._y = lowerBody._y - 40; _root.depthSort(this); } } }; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 1; focusPowerY = 1; signalName = 'scientistIntroCam'; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 0; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (!startSequence) { if (this.hitTest(_root.heroHitboxP1) || this.hitTest(_root.heroHitboxP2)) { startSequence = true; } } else { if (timer == 0) { musicLayerVolsArray = new Array(0, 0, 10, 0, 0, 20); _root.setMusicLayerVols(musicLayerVolsArray); _root.cutscene = true; p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _root['heroP' + p]._x; _root['heroP' + p].waypointY = _root['heroP' + p]._y; ++p; } _root.scientistIntroCam = true; _root.mrScience.activated = true; } ++timer; if (timer == 15) { _root.mrScience._xscale = -100; } if (timer == 30) { _root.mrScience.lowerBody.zSpeed = -11; _root.mrScience.upperBody.zSpeed = -10; } if (timer == 48) { _root.mrScience._xscale = 100; } if (timer == 60) { _root.mrScience.speed = 8.5; _root.mrScience.targetX = _root.mrScience._x + 500; } if (timer == 110) { _root.mrScience.swapDepths(_root.getNextHighestDepth()); _root.mrScience.removeMovieClip(); _root.cutscene = false; _root.scientistIntroCam = false; musicLayerVolsArray = new Array(0, 0, 10, 10, 0, 20); _root.setMusicLayerVols(musicLayerVolsArray); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'awdh42'; red = 0.3; green = 1; blue = 0.3; } } movieClip 1292 { frame 1 { stop(); } } movieClip 1293 { frame 1 { this._name = 'btn' + _root.nrOfButtons; ++_root.nrOfButtons; boxesOnly = true; if (signalName == undefined) { signalName = 'button1'; } var transformer = new flash.geom.Transform(buttonIn); var colorTransformer = transformer.colorTransform; colorTransformer.redMultiplier = red; colorTransformer.greenMultiplier = green; colorTransformer.blueMultiplier = blue; transformer.colorTransform = colorTransformer; _root.depthSortCustomY(this, _root.sizeOfArea._y - 10); } } instance of movieClip 1293 { onClipEvent (load) { signalName = 'awdh4222'; red = 0.3; green = 0.3; blue = 1; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } movieClip 1295 { frame 1 { _root.depthSortCustomY(this, this._y - 19); } } movieClip 1297 { frame 1 { _root.depthSortCustomY(this, this._y - 20); } } movieClip 1299 { frame 1 { _root.depthSortCustomY(this, this._y - 100); } } movieClip 1301 { frame 1 { if (!dummy) { depthYOffset = -47; accelerationSpeed = 0.06; decelerationSpeed = 0.2; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].squishable = false; hitbox._width -= 10; hitbox._height -= 10; recoverTimer = 0; ySpeed2 = 0; xSpeed2 = 0; ySpeed = 0; xSpeed = 0; movementMultiplyer = 0; collideLeft = false; collideRight = collideLeft; collideDown = collideRight; collideUp = collideDown; if (upMovement != undefined || downMovement != undefined || leftMovement != undefined || rightMovement != undefined) { startX = _x; startY = _y; if (upMovement == undefined) { upMovement = 0; } if (downMovement == undefined) { downMovement = 0; } if (rightMovement == undefined) { rightMovement = 0; } if (leftMovement == undefined) { leftMovement = 0; } } _name = 'pushBlock' + _root.nrOfPushBlocks; ++_root.nrOfPushBlocks; } else { _root.depthSort(this); } } } instance of movieClip 1301 { onClipEvent (load) { upMovement = 25; downMovement = 300; rightMovement = 100; leftMovement = 0; restrictZoneName = 'worbrbrRBOghm1'; conveyorGroup = 'yygru3qyz666453'; } } instance of movieClip 1293 { onClipEvent (load) { signalName = 'afaefag4252wggg2'; _visible = false; red = 0.3; green = 0.3; blue = 1; } } instance of movieClip 1301 { onClipEvent (load) { rightMovement = 200; restrictZoneName = 'gagegg8181818jjjff'; } } instance of movieClip 1293 { onClipEvent (load) { signalName = 'awdh42'; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 30; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 50; focusOffsetY = -100; focusPowerX = 0.8; focusPowerY = 0.5; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'worbrbrRBOghm1'; detectWalls = true; detectPushBlockWalls = true; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'awdh4222'; red = 0.3; green = 0.3; blue = 1; } } instance mrScience2 of movieClip 1288 { onClipEvent (load) { faceLeft = true; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 14; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (!startSequence) { if (this.hitTest(_root.heroHitboxP1) || this.hitTest(_root.heroHitboxP2)) { startSequence = true; } } else { if (timer == 14) { _root.mrScience2.activated = true; } ++timer; if (timer == 15) { _root.mrScience2._xscale = -100; } if (timer == 30) { _root.mrScience2.lowerBody.zSpeed = -11; _root.mrScience2.upperBody.zSpeed = -10; } if (timer == 48) { _root.mrScience2._xscale = 100; } if (timer == 60) { _root.mrScience2.speed = 8.5; _root.mrScience2.targetX = _root.mrScience2._x + 500; } if (timer == 110) { _root.mrScience2.swapDepths(_root.getNextHighestDepth()); _root.mrScience2.removeMovieClip(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'gagegg8181818jjjff'; detectWalls = true; } } movieClip 1303 { frame 1 { nrOfCBL = 0; _name = 'CONVEYOR' + _root.nrOfConveyorBelts; ++_root.nrOfConveyorBelts; if (conveyorGroup != undefined) { if (_root[conveyorGroup] == undefined) { _root[conveyorGroup] = new Array(); } _root[conveyorGroup].push(_name); } if (_visible) { if (_rotation == 0) { w = 0; while (w < _width - 5) { cBLName = _name + 'CBL' + nrOfCBL; ++nrOfCBL; _root.attachMovie('conveyorBeltLine', cBLName, _root.getNextHighestDepth()); _root[cBLName]._x = _x + w - _width / 2; _root[cBLName]._y = _y; _root[cBLName]._height = _height; _root.depthSortCustomY(_root[cBLName], _root.sizeOfArea._y - w / 5 - _root[cBLName]._y / 1000); w += 100; } } else { w = 0; while (w < _height - 5) { cBLName = _name + 'CBL' + nrOfCBL; ++nrOfCBL; _root.attachMovie('conveyorBeltLine', cBLName, _root.getNextHighestDepth()); _root[cBLName]._x = _x; _root[cBLName]._y = _y + w - _height / 2; _root[cBLName]._height = _width; _root[cBLName]._rotation = -90; _root.depthSortCustomY(_root[cBLName], _root.sizeOfArea._y - w / 50 - _root[cBLName]._y / 1000); w += 100; } } } } } instance of movieClip 1303 { onClipEvent (load) { _visible = false; dontInteractWithPlayers = true; onOff = true; conSpeed = 5; signalName = 'afaefag4252wggg2'; conveyorGroup = 'yygru3qyz666453'; } } instance of movieClip 1301 { onClipEvent (load) { downMovement = 197; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1301 { onClipEvent (load) { restrictZoneName = 'SIMPLWEABLOVK13'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'SIMPLWEABLOVK13'; detectWalls = true; } } movieClip 1304 { frame 1 { _root.depthSort(this); onEnterFrame = function () { p = 1; while (p <= _root.nrOfPlayers) { if (hitbox.hitTest(_root['heroAttackHitboxP' + p])) { _root.addStar(_x, _y - 50, 120); if (_root['heroP' + p]._x < this._x) { _root.addVirusSplat(this._x, this._y, 10, 70, 0.5, _width, _height, 'watermelon_splat'); } else { _root.addVirusSplat(this._x, this._y, 10, 70, -0.5, _width, _height, 'watermelon_splat'); } _root.playSound('slime_kill_', _x, _y, 1 + random(3)); ++_root.nrOfWatermelonsSmashed; if (_root.nrOfWatermelonsSmashed >= 24) { _root.unlockAchievement(6); } this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } ++p; } }; } } movieClip 1306 { frame 1 { _root.depthSort(this); } } movieClip 1308 { frame 1 { _root.depthSortCustomY(this, this._y - 47); } } movieClip 1310 { frame 1 { _root.depthSort(this); } } movieClip 1312 { frame 1 { _root.depthSort(this); } } movieClip 1314 { frame 1 { _root.depthSort(this); } } movieClip 1316 { frame 1 { _root.depthSort(this); } } instance of movieClip 1127 { } instance of movieClip 1301 { onClipEvent (load) { upMovement = 100; downMovement = 100; restrictZoneName = 'ab425af'; } } instance of movieClip 1127 { } instance of movieClip 1127 { } movieClip 1318 { frame 1 { _root.depthSort(this); } } instance of movieClip 566 robot { onClipEvent (load) { leftMovement = -100; rightMovement = 100; } } instance endPoint of movieClip 1070 { } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'ab425af'; detectWalls = true; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(0, 0, 50, 0.25, 0, 0); triggerOnce = true; } } movieClip 1320 { frame 1 { _root.depthSort(this); } } movieClip 1322 { } movieClip 1325 { } movieClip 1326 { } movieClip 1327 { frame 1 { if (timeOffset == undefined) { timeOffset = 0; } if (upTime == undefined) { upTime = 60; } if (downTime == undefined) { downTime = 60; } if (!doNotDefineName) { collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = 197; _root[collisionName]._height = 97; _root[collisionName]._x = _x; _root[collisionName]._y = _y + -50; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].activated = true; _root[collisionName].squishable = true; _name = 'CRUSHER' + _root.nrOfCrushers; ++_root.nrOfCrushers; } _root.sfx.createEmptyMovieClip(this._name + 'SMC', _root.sfx.getNextHighestDepth()); _root[this._name + 'S'] = new Sound(_root.sfx[this._name + 'SMC']); _root[this._name + 'S'].attachSound('crusher_going_up_' + (1 + random(3))); if (!dontCreateShadow) { _root.attachMovie('shadowLong', _name + 'Shadow', _root.getNextHighestDepth()); _root[_name + 'Shadow']._x = _x; _root[_name + 'Shadow']._y = _y - 50; _root[_name + 'Shadow']._width = 200; _root[_name + 'Shadow']._height = 100; _root.depthSortCustomY(_root[_name + 'Shadow'], _root.sizeOfArea._y - _root[_name + 'Shadow']._y / 100); } top.ySpeed = 0; _root.depthSortCustomY(this, this._y - 2); } instance of movieClip 155 hitbox { } } instance of movieClip 1327 { onClipEvent (load) { upTime = 80; downTime = 30; timeOffset = 0; animationGroup = 'SpmleScruschers47'; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 80; downTime = 30; timeOffset = 45; animationGroup = 'SpmleScruschers47'; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'SpmleScruschers47'; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(65, 61, 0, 0, 0, 0); triggerOnce = true; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 80; downTime = 30; timeOffset = 90; animationGroup = 'SpmleScruschers4747'; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 80; downTime = 30; timeOffset = 15; animationGroup = 'SpmleScruschers4747'; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'SpmleScruschers4747'; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 80; downTime = 30; timeOffset = 45; animationGroup = 'SpmleScruschers4747'; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 80; downTime = 30; timeOffset = 0; animationGroup = 'SpmleScruschers4747'; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(75, 75, 0, 0, 0, 0); triggerOnce = true; } } instance of movieClip 1301 { onClipEvent (load) { rightMovement = 100; } } instance of movieClip 1301 { onClipEvent (load) { restrictZoneName = 'pishBLOAWK129837'; } } instance of movieClip 1301 { onClipEvent (load) { rightMovement = 100; } } movieClip 1329 { frame 1 { _root.depthSort(this); } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'pishBLOAWK129837'; detectWalls = true; } } instance of movieClip 159 checkpoint { onClipEvent (load) { hitbox._height = 200; hitbox._width = 200; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(0, 36, 0, 0, 0, 37); triggerOnce = true; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'pushBlockBUTTONINTRO'; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 1301 { onClipEvent (load) { rightMovement = 300; restrictZoneName = 'pushBLOCKINTRORZ'; } } instance of movieClip 1293 { onClipEvent (load) { signalName = 'pushBlockBUTTONINTRO'; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 1127 { } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'pushBLOCKINTRORZ'; detectWalls = true; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(0, 15, 10, 0, 0, 37); triggerOnce = true; } } movieClip 1331 { frame 1 { if (!dummy) { depthYOffset = 47; accelerationSpeed = 0.06; decelerationSpeed = 0.2; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].squishable = false; hitbox._width -= 10; hitbox._height -= 10; recoverTimer = 0; ySpeed2 = 0; xSpeed2 = 0; ySpeed = 0; xSpeed = 0; movementMultiplyer = 0; collideLeft = false; collideRight = collideLeft; collideDown = collideRight; collideUp = collideDown; if (upMovement != undefined || downMovement != undefined || leftMovement != undefined || rightMovement != undefined) { startX = _x; startY = _y; if (upMovement == undefined) { upMovement = 0; } if (downMovement == undefined) { downMovement = 0; } if (rightMovement == undefined) { rightMovement = 0; } if (leftMovement == undefined) { leftMovement = 0; } } _name = 'pushBlock' + _root.nrOfPushBlocks; ++_root.nrOfPushBlocks; } else { _root.depthSort(this); } } } instance of movieClip 1331 { onClipEvent (load) { dummy = true; } } instance of movieClip 1301 { onClipEvent (load) { dummy = true; } } movieClip 1333 { frame 1 { if (!dummy) { depthYOffset = -70; accelerationSpeed = 0.04; decelerationSpeed = 0.2; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].squishable = false; hitbox._width -= 10; hitbox._height -= 10; recoverTimer = 0; ySpeed2 = 0; xSpeed2 = 0; ySpeed = 0; xSpeed = 0; movementMultiplyer = 0; collideLeft = false; collideRight = collideLeft; collideDown = collideRight; collideUp = collideDown; if (upMovement != undefined || downMovement != undefined || leftMovement != undefined || rightMovement != undefined) { startX = _x; startY = _y; if (upMovement == undefined) { upMovement = 0; } if (downMovement == undefined) { downMovement = 0; } if (rightMovement == undefined) { rightMovement = 0; } if (leftMovement == undefined) { leftMovement = 0; } } _name = 'pushBlock' + _root.nrOfPushBlocks; ++_root.nrOfPushBlocks; } else { _root.depthSort(this); } } } instance of movieClip 1333 { onClipEvent (load) { dummy = true; } } movieClip 1335 { frame 1 { if (!dummy) { depthYOffset = -47; accelerationSpeed = 0.03; decelerationSpeed = 0.2; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].squishable = false; hitbox._width -= 10; hitbox._height -= 10; recoverTimer = 0; ySpeed2 = 0; xSpeed2 = 0; ySpeed = 0; xSpeed = 0; movementMultiplyer = 0; collideLeft = false; collideRight = collideLeft; collideDown = collideRight; collideUp = collideDown; if (upMovement != undefined || downMovement != undefined || leftMovement != undefined || rightMovement != undefined) { startX = _x; startY = _y; if (upMovement == undefined) { upMovement = 0; } if (downMovement == undefined) { downMovement = 0; } if (rightMovement == undefined) { rightMovement = 0; } if (leftMovement == undefined) { leftMovement = 0; } } _name = 'pushBlock' + _root.nrOfPushBlocks; ++_root.nrOfPushBlocks; } else { _root.depthSort(this); } } } instance of movieClip 1335 { onClipEvent (load) { dummy = true; } } instance of movieClip 1331 { onClipEvent (load) { dummy = true; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(65, 33, 10, 0, 0, 0); triggerOnce = true; } } instance startPoint of movieClip 1048 { } frame 32 { if (!musicTrack2) { loadMusicTrack2(); } } frame 32 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } frameSetUp = false; _root.saveState(); _root.gotoAndStop(_root._currentframe + 1); } frame 33 { if (!_root.megaTeddington) { com.newgrounds.API.logCustomEvent('Game_W2_L2'); } else { com.newgrounds.API.logCustomEvent('Ted_Game_W2_L2'); } } frame 33 { setUpFrame(); } movieClip 1339 { frame 1 { stop(); } } movieClip 1340 { frame 1 { this._name = 'btn' + _root.nrOfButtons; ++_root.nrOfButtons; if (signalName == undefined) { signalName = 'button1'; } var transformer = new flash.geom.Transform(buttonIn); var colorTransformer = transformer.colorTransform; colorTransformer.redMultiplier = red; colorTransformer.greenMultiplier = green; colorTransformer.blueMultiplier = blue; transformer.colorTransform = colorTransformer; _root.depthSortCustomY(this, _root.sizeOfArea._y - 10); } } instance of movieClip 1340 { onClipEvent (load) { signalName = 'ARCADELEFT'; retroSound = true; red = 0.3; green = 1; blue = 0.5; } } instance of movieClip 1340 { onClipEvent (load) { signalName = 'ARCADERIGHT'; retroSound = true; red = 0.3; green = 1; blue = 0.5; } } movieClip 1342 { frame 1 { _root.depthSort(this); } } movieClip 1345 { } movieClip 1347 { } movieClip 1349 { } movieClip 1351 { } movieClip 1355 { frame 1 { ship.targetX = 140; ship.xSpeed = 0; astroid.rotSpeed = -8 + random(17); stars2._alpha = 50; topScore = 0; score = 0; countedScore = false; shipFlashTimer = 0; autoAimAstroidCounter = 0; onEnterFrame = function () { if (!_root.gamePause) { if (_parent.hitTest(_root.onScreen)) { if (!preparedMusic) { _root.space_avoider_musicS.onSoundComplete = function () { _root.space_avoider_musicS.start(); }; _root.space_avoider_musicS.start(); preparedMusic = true; } tempDistVar = _root.getDist(_parent._x, _parent._y, _root.gameCamera._x, _root.gameCamera._y); curSoundVol = (400 - tempDistVar) / 2; if (curSoundVol <= 0) { curSoundVol = 0; } if (curSoundVol > 100) { curSoundVol = 100; } _root.track2Layer2TVol = (100 - curSoundVol) * 0.4; _root.space_avoider_musicS.setVolume(curSoundVol * _root.musicVolume); ship.xSpeed += (ship.targetX - ship._x) * 0.1; ship.xSpeed *= 0.8; ship._x += ship.xSpeed; ship._rotation = ship.xSpeed * 1.5; ship.flame._rotation = -2 + random(5); ship.flame._alpha = 50 + random(30); stars._y += 1; stars2._y += 0.5; if (stars._y >= 120) { stars._y = 0; } if (stars2._y >= 120) { stars2._y = 0; } astroid._rotation += astroid.rotSpeed; astroid._y += 3 * (1 + score / 50); if (astroid._y > 65 && astroid._y < 105) { if (astroid._x < 75 && ship._x < 75 || astroid._x > 75 && ship._x > 75) { if (score > topScore) { topScore = score; } score = 0; if (shipFlashTimer <= 0) { _root.playSound('space_avoider_hit', _parent._x, _parent._y); shipFlashTimer = 30; } } else { if (!countedScore) { ++score; if (score >= 20) { _root.unlockAchievement(5); } countedScore = true; } } } displayScore.text = score; displayTopScore.text = 'Top score: ' + topScore; if (shipFlashTimer > 0) { if (shipFlashTimer <= 30 && shipFlashTimer > 25 || shipFlashTimer < 20 && shipFlashTimer > 15 || shipFlashTimer < 10 && shipFlashTimer > 5) { ship._visible = false; } else { ship._visible = true; } --shipFlashTimer; } if (astroid._y > 150) { astroid._y = -30; astroid.rotSpeed = -8 + random(17); if (autoAimAstroidCounter < 3) { if (random(2) == 1) { astroid._x = 135; } else { astroid._x = 35; } ++autoAimAstroidCounter; } else { if (ship._x > 75) { astroid._x = 135; } else { astroid._x = 35; } autoAimAstroidCounter = 0; } countedScore = false; } if (_root.ARCADELEFT && _root.ARCADERIGHT) { } else { if (_root.ARCADELEFT) { ship.targetX = 30; } else { if (_root.ARCADERIGHT) { ship.targetX = 140; } } } } else { _root.space_avoider_musicS.stop(); preparedMusic = false; } } }; } } movieClip 1357 { frame 1 { _root.depthSort(this); } } movieClip 1358 { } movieClip 1360 { frame 1 { _root.depthSort(this); } } instance of movieClip 1230 { onClipEvent (load) { restrictZoneName = 'aaett4543531ff'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'aaett4543531ff'; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0.7; focusPowerY = 0.7; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(0, 0, 40, 0, 0, 0); triggerOnce = true; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(0, 0, 31, 0, 69, 0); triggerOnce = true; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1335 { onClipEvent (load) { upMovement = 100; } } instance of movieClip 1333 { onClipEvent (load) { leftMovement = 100; } } instance of movieClip 1151 { onClipEvent (load) { signalName = 'button2'; red = 1; green = 0; blue = 0; } } instance of movieClip 1293 { onClipEvent (load) { signalName = 'button2'; red = 1; green = 0; blue = 0; } } instance of movieClip 1301 { onClipEvent (load) { rightMovement = 100; leftMovement = 100; restrictZoneName = 'adg15t5q4'; } } instance of movieClip 1127 { } instance of movieClip 1335 { onClipEvent (load) { downMovement = 100; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'adg15t5q4'; detectWalls = true; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(31, 0, 0, 0, 33, 51); triggerOnce = true; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'pfk3543'; detectWalls = true; } } instance of movieClip 1180 { onClipEvent (load) { wave = new Array([[4, 0, 1], [4, 1, 1]], [[-1, 0, 1], [-1, 1, 1], [5, 1, 1], [5, 0, 1]], [[5, 0, 1], [4, 1, 1], [-1, 1, 1], [-1, 0, 1]]); focusPowerX = 0.95; focusOffsetX = 50; restrictZoneName = 'pfk3543'; triggerOffSetX = 100; detectHorizontal = true; startMusicLayerVolsArray = new Array(100, 0, 0, 100, 100, 0); endMusicLayerVolsArray = new Array(10, 0, 0, 9, 100, 0); } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 50; focusPowerX = 0.95; focusOffsetY = 0; focusPowerY = 0; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1327 { onClipEvent (load) { upTime = 90; downTime = 30; timeOffset = 0; animationGroup = 'twoCRUSHErsOneCupAG2'; signalName = 'twoCRUSHErsOneCup2'; inverted = true; checkForBlocksWithinRestrictZone = 'twoCRUSHErsOneCupRZ2'; } } instance of movieClip 1331 { onClipEvent (load) { upMovement = 400; restrictZoneName = 'twoCRUSHErsOneCupRZ2'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'twoCRUSHErsOneCupRZ2'; detectWalls = true; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'twoCRUSHErsOneCupAG2'; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 90; downTime = 30; timeOffset = 0; animationGroup = 'twoCRUSHErsOneCupAG2'; signalName = 'twoCRUSHErsOneCup2'; inverted = false; checkForBlocksWithinRestrictZone = 'twoCRUSHErsOneCupRZ2'; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'twoCRUSHErsOneCup2'; inverted = false; red = 1; green = 1; blue = 1; } } movieClip 1362 { frame 1 { _root.depthSortCustomY(this, this._y - 25); ySpeed = 0; startY = _y; startX = _x; shadow.startY = shadow._y; timer = 120 + random(30); onEnterFrame = function () { if (this.hitTest(_root.onScreen) && !_root.gamePause) { --timer; ySpeed += 2; _y = _y + ySpeed; _x = _x + xSpeed; if (timer < 60) { if (_y > startY) { _root.playSound('blueberry_pot_land_1', _x, _y); ySpeed = -6 - random(2); xSpeed = (-3 + random(7)) * 0.5; _y = startY; } } else { if (_y > startY) { ySpeed = 0; xSpeed = 0; _y = startY; } } if (timer <= 0) { timer = 120 + random(30); } if (_x > startX + 30) { _x = startX + 30; } else { if (_x < startX - 30) { _x = startX - 30; } } shadow._y = shadow.startY + startY - _y; p = 1; while (p <= _root.nrOfPlayers) { if (_root.getDist(this._x, this._y, _root['heroP' + p]._x, _root['heroP' + p]._y) < 150) { spawnBerry = true; } ++p; } if (_root.megaTeddington) { if (this.hitTest(_root.heroAttackHitboxP1)) { spawnBerry = true; } } if (spawnBerry) { _root.playSound('blueberry_pot_break_', _x, _y, 1 + random(2)); _root.playSound('blueberry_jump_', _x, _y, 1 + random(3)); _root.attachMovie('mrBlueberry', mrBlueberry + _name, _root.getNextHighestDepth()); _root[mrBlueberry + _name]._x = _x; _root[mrBlueberry + _name]._y = _y; _root[mrBlueberry + _name].zSpeed = -15; if (restrictZoneName != undefined) { _root[mrBlueberry + _name].restrictZoneName = restrictZoneName; } _root.depthSort(_root[mrBlueberry + _name]); _root.addVirusSplat(_x, _y, 3, 100, -0.3, 50, 50, 'dirt'); _root.addVirusSplat(_x, _y, 3, 100, 0.3, 50, 50, 'dirt'); _root.addSmoke(this._x, this._y); _root.addStar(this._x, this._y, 150); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } } instance of movieClip 1362 { onClipEvent (load) { restrictZoneName = 'aeas4635sghjjjj'; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 50; focusOffsetY = -120; focusPowerX = 0.6; focusPowerY = 0.6; } } instance of movieClip 1362 { onClipEvent (load) { restrictZoneName = 'aeas4635sghjjjj'; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'aeas4635sghjjjj'; detectWalls = true; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(17, 0, 40, 48, 49, 37); triggerOnce = true; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 75; downTime = 30; timeOffset = 0; animationGroup = 'crussshhhhHSHSH1AG'; checkForBlocksWithinRestrictZone = 'crussshhhhHSHSH1'; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 75; downTime = 30; timeOffset = 45; animationGroup = 'crussshhhhHSHSH1AG'; checkForBlocksWithinRestrictZone = 'crussshhhhHSHSH1'; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'crussshhhhHSHSH1AG'; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 20; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = -300; focusOffsetY = -100; focusPowerX = 0.2; focusPowerY = 0.9; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 159 checkpoint { onClipEvent (load) { hitbox._height = 300; } } instance of movieClip 1127 { } instance of movieClip 1331 { onClipEvent (load) { leftMovement = 800; restrictZoneName = 'crussshhhhHSHSH1'; } } instance of movieClip 696 virus { onClipEvent (load) { restrictZoneName = 'ahh426sgs'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'crussshhhhHSHSH1'; detectWalls = true; } } instance mrScience3 of movieClip 1288 { onClipEvent (load) { } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 14; _root.mrScience3.startX = _root.mrScience3._x; _root.mrScience3.startY = _root.mrScience3._y; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (!startSequence) { if (this.hitTest(_root.heroHitboxP1) || this.hitTest(_root.heroHitboxP2)) { startSequence = true; } } else { if (_root.mrScience3._x < _root.mrScience3.startX - 200) { _root.mrScience3.targetY = _root.mrScience3.startY - 300; } if (timer == 14) { _root.mrScience3.activated = true; } ++timer; if (timer == 30) { _root.playSound('gibberish_6_', _x, _y, 3 + random(2)); _root.mrScience3.lowerBody.zSpeed = -11; _root.mrScience3.upperBody.zSpeed = -10; } if (timer == 48) { _root.mrScience3._xscale = -100; } if (timer == 60) { _root.mrScience3.speed = 8.5; _root.mrScience3.targetX = _root.mrScience3._x - 500; _root.mrScience3.targetY = _root.mrScience3.startY - 40; } if (timer == 180) { _root.mrScience3.swapDepths(_root.getNextHighestDepth()); _root.mrScience3.removeMovieClip(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'ahh426sgs'; detectWalls = true; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(100, 68, 0, 0, 100, 0); triggerOnce = true; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(100, 8, 0, 0, 45, 0); triggerOnce = true; } } instance startPoint of movieClip 1048 { } instance of movieClip 1127 { } instance of movieClip 1127 { } instance of movieClip 1127 { } movieClip 1364 { frame 1 { depthYOffset = -94; accelerationSpeed = 0.03; decelerationSpeed = 0.2; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].squishable = false; hitbox._width -= 10; hitbox._height -= 10; recoverTimer = 0; ySpeed2 = 0; xSpeed2 = 0; ySpeed = 0; xSpeed = 0; movementMultiplyer = 0; collideLeft = false; collideRight = collideLeft; collideDown = collideRight; collideUp = collideDown; if (upMovement != undefined || downMovement != undefined || leftMovement != undefined || rightMovement != undefined) { startX = _x; startY = _y; if (upMovement == undefined) { upMovement = 0; } if (downMovement == undefined) { downMovement = 0; } if (rightMovement == undefined) { rightMovement = 0; } if (leftMovement == undefined) { leftMovement = 0; } } _name = 'pushBlock' + _root.nrOfPushBlocks; ++_root.nrOfPushBlocks; } } instance of movieClip 1364 { onClipEvent (load) { rightMovement = 100; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 30; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -80; focusPowerX = 0.5; focusPowerY = 0.9; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'oliaehFH7123'; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'pmothdipI23'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'byiwfWE283'; detectWalls = true; } } instance of movieClip 1362 { onClipEvent (load) { restrictZoneName = 'byiwfWE283'; } } instance of movieClip 1362 { onClipEvent (load) { restrictZoneName = 'byiwfWE283'; } } instance mrScience2 of movieClip 1288 { onClipEvent (load) { faceLeft = true; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 14; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (!startSequence) { if (this.hitTest(_root.heroHitboxP1) || this.hitTest(_root.heroHitboxP2)) { startSequence = true; } } else { if (timer == 14) { _root.mrScience2.activated = true; } ++timer; if (timer == 15) { _root.mrScience2._xscale = -100; } if (timer == 30) { _root.mrScience2.lowerBody.zSpeed = -11; _root.mrScience2.upperBody.zSpeed = -10; } if (timer == 48) { _root.mrScience2._xscale = 100; } if (timer == 60) { _root.mrScience2.speed = 8.5; _root.mrScience2.targetX = _root.mrScience2._x + 500; } if (timer == 110) { _root.mrScience2.swapDepths(_root.getNextHighestDepth()); _root.mrScience2.removeMovieClip(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(39, 0, 31, 0, 100, 0); triggerOnce = true; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1362 { onClipEvent (load) { restrictZoneName = 'ysrysy46353'; } } movieClip 1366 { frame 1 { depthYOffset = -47; accelerationSpeed = 0.03; decelerationSpeed = 0.2; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].squishable = false; hitbox._width -= 10; hitbox._height -= 10; recoverTimer = 0; ySpeed2 = 0; xSpeed2 = 0; ySpeed = 0; xSpeed = 0; movementMultiplyer = 0; collideLeft = false; collideRight = collideLeft; collideDown = collideRight; collideUp = collideDown; if (upMovement != undefined || downMovement != undefined || leftMovement != undefined || rightMovement != undefined) { startX = _x; startY = _y; if (upMovement == undefined) { upMovement = 0; } if (downMovement == undefined) { downMovement = 0; } if (rightMovement == undefined) { rightMovement = 0; } if (leftMovement == undefined) { leftMovement = 0; } } _name = 'pushBlock' + _root.nrOfPushBlocks; ++_root.nrOfPushBlocks; } } instance of movieClip 1366 { onClipEvent (load) { leftMovement = 400; } } instance of movieClip 522 mrBlueberry { onClipEvent (load) { restrictZoneName = 'ysrysy46353'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'ysrysy46353'; detectWalls = true; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(87, 30, 0, 0, 100, 0); triggerOnce = true; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'twoCRUSHErsOneCup'; inverted = true; red = 1; green = 0; blue = 0; } } movieClip 1368 { frame 1 { _root.depthSort(this); } } instance of movieClip 1293 { onClipEvent (load) { signalName = 'twoCRUSHErsOneCupDoor'; red = 0.3; green = 1; blue = 0.4; } } instance of movieClip 159 checkpoint { onClipEvent (load) { hitbox._height = 300; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 90; downTime = 30; timeOffset = 0; animationGroup = 'twoCRUSHErsOneCupAG'; signalName = 'twoCRUSHErsOneCup'; inverted = false; checkForBlocksWithinRestrictZone = 'twoCRUSHErsOneCupRZ'; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 90; downTime = 30; timeOffset = 0; animationGroup = 'twoCRUSHErsOneCupAG'; signalName = 'twoCRUSHErsOneCup'; inverted = true; checkForBlocksWithinRestrictZone = 'twoCRUSHErsOneCupRZ'; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'twoCRUSHErsOneCup'; inverted = false; red = 1; green = 0; blue = 0; } } instance of movieClip 1331 { onClipEvent (load) { leftMovement = 1200; restrictZoneName = 'twoCRUSHErsOneCupRZ'; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'twoCRUSHErsOneCupDoor'; red = 0.3; green = 1; blue = 0.4; } } instance of movieClip 1362 { onClipEvent (load) { restrictZoneName = 'yaeyasfd36364365'; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -80; focusPowerX = 0.2; focusPowerY = 0.9; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'twoCRUSHErsOneCupAG'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'twoCRUSHErsOneCupRZ'; detectWalls = true; } } instance of movieClip 1362 { onClipEvent (load) { restrictZoneName = 'yaeyasfd36364365'; } } instance mrScience4 of movieClip 1288 { onClipEvent (load) { } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 14; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (!startSequence) { if (this.hitTest(_root.heroHitboxP1) || this.hitTest(_root.heroHitboxP2)) { startSequence = true; } } else { if (timer == 14) { _root.mrScience4.activated = true; } ++timer; if (timer == 30) { _root.mrScience4.lowerBody.zSpeed = -11; _root.mrScience4.upperBody.zSpeed = -10; } if (timer == 60) { _root.mrScience4.speed = 8.5; _root.mrScience4.targetY = _root.mrScience4._y - 500; } if (timer == 110) { _root.mrScience4.swapDepths(_root.getNextHighestDepth()); _root.mrScience4.removeMovieClip(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'yaeyasfd36364365'; detectWalls = true; } } instance of movieClip 1195 { onClipEvent (load) { gnomeNumber = 4; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(50, 0, 40, 0, 48, 9); triggerOnce = true; } } instance endPoint of movieClip 1070 { } frame 34 { if (!musicTrack2) { loadMusicTrack2(); } } frame 34 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } frameSetUp = false; _root.saveState(); _root.gotoAndStop(_root._currentframe + 1); } frame 35 { if (!_root.megaTeddington) { com.newgrounds.API.logCustomEvent('Game_W2_L3'); } else { com.newgrounds.API.logCustomEvent('Ted_Game_W2_L3'); } } frame 35 { setUpFrame(); } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -2.5; } } instance of movieClip 1127 { } instance of movieClip 1162 { onClipEvent (load) { upTime = 8; downTime = 8; timeOffset = 0; soundOn = true; animationGroup = 'ta4tw4HUJ866161'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 8; downTime = 8; timeOffset = 8; soundOn = true; animationGroup = 'ta4tw4HUJ866161'; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2.5; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 3; } } instance of movieClip 1127 { } instance of movieClip 1162 { onClipEvent (load) { upTime = 8; downTime = 8; timeOffset = 0; soundOn = true; animationGroup = 'ta4tw4HUJ866161'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 8; downTime = 8; timeOffset = 8; soundOn = true; animationGroup = 'ta4tw4HUJ866161'; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -5; } } instance of movieClip 1127 { } instance of movieClip 1162 { onClipEvent (load) { upTime = 8; downTime = 8; timeOffset = 0; soundOn = true; animationGroup = 'ta4tw4HUJ866161'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 8; downTime = 8; timeOffset = 8; animationGroup = 'ta4tw4HUJ866161'; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 5; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1195 { onClipEvent (load) { gnomeNumber = 5; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(39, 0, 0, 4, 44, 48); triggerOnce = true; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'ta4tw4HUJ866161'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 8; downTime = 8; timeOffset = 0; animationGroup = 'ta4tw4HUJ866161'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 8; downTime = 8; timeOffset = 8; soundOn = true; animationGroup = 'ta4tw4HUJ866161'; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2; signalName = 'KOAEN9123SIGNAL'; conveyorGroup = 'KOAEN9123KOM'; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 90; downTime = 30; timeOffset = 0; checkForBlocksWithinRestrictZone = 'KOAEN9123'; signalName = 'KOAEN9123SIGNAL'; } } instance of movieClip 1331 { onClipEvent (load) { restrictZoneName = 'KOAEN9123'; conveyorGroup = 'KOAEN9123KOM'; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'KOAEN9123SIGNALDOOR'; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'KOAEN9123SIGNAL'; inverted = false; red = 1; green = 0; blue = 0; } } instance of movieClip 1293 { onClipEvent (load) { signalName = 'KOAEN9123SIGNALDOOR'; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 702 wall_collision { onClipEvent (load) { squishable = true; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'KOAEN9123'; detectWalls = true; detectPushBlockWalls = true; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 100; focusOffsetY = -100; focusPowerX = 0.8; focusPowerY = 0.8; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance mrScience5 of movieClip 1288 { onClipEvent (load) { } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 14; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (!startSequence) { if (this.hitTest(_root.heroHitboxP1) || this.hitTest(_root.heroHitboxP2)) { startSequence = true; } } else { if (timer == 14) { _root.mrScience5.activated = true; } ++timer; if (timer == 30) { _root.mrScience5.lowerBody.zSpeed = -11; _root.mrScience5.upperBody.zSpeed = -10; } if (timer == 60) { _root.mrScience5.speed = 8.5; _root.mrScience5.targetY = _root.mrScience5._y - 500; } if (timer == 110) { _root.mrScience5.swapDepths(_root.getNextHighestDepth()); _root.mrScience5.removeMovieClip(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } } instance of movieClip 702 wall_collision { onClipEvent (load) { squishable = true; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(39, 14, 0, 4, 18, 48); triggerOnce = true; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1127 { } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 3; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 120; downTime = 30; timeOffset = 0; inverted = true; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(33, 33, 18, 8, 0, 0); triggerOnce = true; } } movieClip 1372 { frame 1 { stop(); } } movieClip 1373 { frame 1 { _root.depthSort(this); } instance of movieClip 1327 { onClipEvent (load) { upTime = 90; downTime = 45; timeOffset = 0; animationGroup = 'melonCrusher'; doNotDefineName = true; dontCreateShadow = true; } onClipEvent (enterFrame) { _root.crusher(this); if (bottom._y == 0) { _parent.melon.gotoAndStop(1 + random(3)); } } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'melonCrusher'; } } instance melon of movieClip 1372 { onClipEvent (load) { _root.depthSort(this); } } } instance of movieClip 1180 { onClipEvent (load) { wave = new Array([[4, 1, 2], [4, 1, 0], [5, 0, 2], [4, 0, 0]], [[5, 1, 0], [-1, 0, 2], [-1, 1, 0], [5, 0, 2]], [[4, 0, 2], [5, 1, 0], [-1, 0, 0], [-1, 1, 2]]); focusOffsetY = -100; restrictZoneName = 'combatZONEONAE1890723'; startMusicLayerVolsArray = new Array(66, 13, 8, 42, 26, 41); endMusicLayerVolsArray = new Array(66, 13, 0, 0, 8, 48); } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'combatZONEONAE1890723'; detectWalls = true; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2; signalName = 'KONVAJOR165CONNLEVR'; conveyorGroup = 'KONVAJOR165CONN'; } } instance of movieClip 1301 { onClipEvent (load) { restrictZoneName = 'KONVAJOR165'; conveyorGroup = 'KONVAJOR165CONN'; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'KONVAJOR165CONNDOOR'; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 1293 { onClipEvent (load) { signalName = 'KONVAJOR165CONNDOOR'; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 60; downTime = 30; timeOffset = 0; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'KONVAJOR165CONNLEVR'; inverted = false; red = 1; green = 1; blue = 1; } } instance of movieClip 702 wall_collision { onClipEvent (load) { squishable = true; } } instance of movieClip 702 wall_collision { onClipEvent (load) { squishable = true; } } instance of movieClip 702 wall_collision { onClipEvent (load) { squishable = true; } } instance of movieClip 702 wall_collision { onClipEvent (load) { squishable = true; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 55; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 50; focusOffsetY = -100; focusPowerX = 0.9; focusPowerY = 0.9; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'KONVAJOR165'; detectWalls = true; detectPushBlockWalls = true; } } instance of movieClip 702 wall_collision { onClipEvent (load) { squishable = true; } } instance mrScience4 of movieClip 1288 { onClipEvent (load) { } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 14; } onClipEvent (enterFrame) { if (!startSequence) { if (this.hitTest(_root.heroHitboxP1) || this.hitTest(_root.heroHitboxP2)) { startSequence = true; } } else { if (timer == 14) { _root.mrScience4.activated = true; } ++timer; if (timer == 30) { _root.mrScience4.lowerBody.zSpeed = -11; _root.mrScience4.upperBody.zSpeed = -10; } if (timer == 60) { _root.mrScience4.speed = 8.5; _root.mrScience4.targetY = _root.mrScience4._y - 500; } if (timer == 110) { _root.mrScience4.swapDepths(_root.getNextHighestDepth()); _root.mrScience4.removeMovieClip(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } instance of movieClip 702 wall_collision { onClipEvent (load) { squishable = true; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(0, 13, 8, 0, 0, 15); triggerOnce = true; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1327 { onClipEvent (load) { upTime = 90; downTime = 30; timeOffset = 0; animationGroup = 'CRU914AG'; signalName = 'CRU914Lver'; inverted = true; checkForBlocksWithinRestrictZone = 'CRU914'; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 90; downTime = 30; timeOffset = 0; animationGroup = 'CRU914AG'; signalName = 'CRU914Lver'; inverted = true; checkForBlocksWithinRestrictZone = 'CRU914'; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 90; downTime = 30; timeOffset = 0; animationGroup = 'CRU914AG'; signalName = 'CRU914Lver'; inverted = false; checkForBlocksWithinRestrictZone = 'CRU914'; } } instance of movieClip 1331 { onClipEvent (load) { leftMovement = 600; restrictZoneName = 'CRU914'; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'CRU914Lver'; inverted = false; red = 1; green = 1; blue = 1; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'CRU914'; detectWalls = true; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'CRU914AG'; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 20; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = -300; focusOffsetY = -100; focusPowerX = 0.2; focusPowerY = 0.9; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(33, 0, 18, 8, 0, 0); triggerOnce = true; } } instance startPoint of movieClip 1048 { } instance endPoint of movieClip 1070 { } frame 36 { if (!musicTrack2) { loadMusicTrack2(); } } frame 36 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } frameSetUp = false; _root.saveState(); _root.gotoAndStop(_root._currentframe + 1); } frame 37 { if (!_root.megaTeddington) { com.newgrounds.API.logCustomEvent('Game_W2_L4'); } else { com.newgrounds.API.logCustomEvent('Ted_Game_W2_L4'); } } frame 37 { setUpFrame(); } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(39, 0, 0, 4, 0, 0); triggerOnce = true; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(39, 17, 0, 8, 0, 0); triggerOnce = true; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2; } } instance of movieClip 159 checkpoint { onClipEvent (load) { hitbox._height = 300; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 5; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -5; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 5; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 10; downTime = 10; timeOffset = 0; animationGroup = 'afasdfsfgw5y3562'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 10; downTime = 10; timeOffset = 10; animationGroup = 'afasdfsfgw5y3562'; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(39, 17, 0, 8, 0, 21); triggerOnce = true; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'afasdfsfgw5y3562'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 10; downTime = 10; timeOffset = 0; soundOn = true; animationGroup = 'afasdfsfgw5y3562'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 10; downTime = 10; timeOffset = 10; soundOn = true; animationGroup = 'afasdfsfgw5y3562'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 10; downTime = 10; timeOffset = 0; animationGroup = 'afasdfsfgw5y3562'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 10; downTime = 10; timeOffset = 10; animationGroup = 'afasdfsfgw5y3562'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 10; downTime = 10; timeOffset = 0; animationGroup = 'afasdfsfgw5y3562'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 10; downTime = 10; timeOffset = 10; animationGroup = 'afasdfsfgw5y3562'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 10; downTime = 10; timeOffset = 0; soundOn = true; animationGroup = 'afasdfsfgw5y3562'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 10; downTime = 10; timeOffset = 10; soundOn = true; animationGroup = 'afasdfsfgw5y3562'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 10; downTime = 10; timeOffset = 0; animationGroup = 'afasdfsfgw5y3562'; } } instance of movieClip 1162 { onClipEvent (load) { upTime = 10; downTime = 10; timeOffset = 10; animationGroup = 'afasdfsfgw5y3562'; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -2; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -2; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 90; downTime = 30; timeOffset = 0; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(39, 17, 0, 8, 28, 21); triggerOnce = true; } } instance of movieClip 159 checkpoint { onClipEvent (load) { hitbox._height = 300; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 4; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 4; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -4; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -4; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 60; downTime = 30; timeOffset = 0; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(39, 28, 0, 8, 47, 21); triggerOnce = true; } } instance of movieClip 159 checkpoint { onClipEvent (load) { } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 6; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 60; downTime = 30; timeOffset = 60; animationGroup = 'inu273ba'; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 60; downTime = 30; timeOffset = 30; animationGroup = 'inu273ba'; } } instance of movieClip 1327 { onClipEvent (load) { upTime = 60; downTime = 30; timeOffset = 0; animationGroup = 'inu273ba'; } } instance of movieClip 1164 { onClipEvent (load) { animationGroup = 'inu273ba'; } } instance of movieClip 1195 { onClipEvent (load) { gnomeNumber = 6; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(34, 36, 0, 29, 46, 21); triggerOnce = true; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -2; conveyorGroup = 'pos893'; } } instance of movieClip 1333 { onClipEvent (load) { leftMovement = 575; restrictZoneName = 'mnn23io'; conveyorGroup = 'pos893'; } } instance of movieClip 1333 { onClipEvent (load) { leftMovement = 375; restrictZoneName = 'mnn23io'; conveyorGroup = 'pos893'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'mnn23io'; detectWalls = true; } } instance of movieClip 1180 { onClipEvent (load) { wave = new Array([[4, 0, 1], [5, 1, 1]], [[4, 0, 0], [4, 0, 2], [5, 1, 0], [5, 1, 2]], [[5, 0, 0], [4, 0, 2], [4, 1, 0], [5, 1, 2]], [[2, 0, 2], [3, 1, 0], [4, 0, 0], [5, 1, 2]]); focusPowerX = 0.9; restrictZoneName = 'combat8918'; startMusicLayerVolsArray = new Array(100, 28, 26, 54, 89, 51); endMusicLayerVolsArray = new Array(67, 3, 11, 16, 35, 51); conveyorGroup = 'pos893'; triggerOffSetX = -100; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'combat8918'; } } instance of movieClip 159 checkpoint { onClipEvent (load) { hitbox._height = 300; hitbox._width = 300; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2; signalName = 'afeioj71'; conveyorGroup = '23g4hkl893'; } } instance of movieClip 1366 { onClipEvent (load) { leftMovement = 100; conveyorGroup = '23g4hkl893'; } } instance of movieClip 1335 { onClipEvent (load) { leftMovement = 200; conveyorGroup = '23g4hkl893'; } } instance of movieClip 1301 { onClipEvent (load) { leftMovement = 300; conveyorGroup = '23g4hkl893'; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'afeioj71'; inverted = false; red = 1; green = 1; blue = 1; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(34, 8, 26, 5, 11, 21); triggerOnce = true; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -50; focusPowerX = 0; focusPowerY = 0.8; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0; focusPowerY = 0.8; } } instance of movieClip 1238 { onClipEvent (load) { rightMovement = 150; leftMovement = 150; } } instance mrScience of movieClip 1288 { } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 1; focusPowerY = 1; signalName = 'scientistIntroCam'; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 0; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (!startSequence) { if (this.hitTest(_root.heroHitboxP1) || this.hitTest(_root.heroHitboxP2)) { startSequence = true; } } else { if (timer == 0) { musicLayerVolsArray = new Array(67, 0, 5, 4, 16, 32); _root.setMusicLayerVols(musicLayerVolsArray); _root.cutscene = true; p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _x; _root['heroP' + p].waypointY = _root['heroP' + p]._y; ++p; } _root.scientistIntroCam = true; _root.mrScience.activated = true; } ++timer; if (timer == 1) { _root.mrScience.speed = 6; } if (timer == 15) { _root.mrScience._xscale = -100; } if (timer == 30) { _root.mrScience._xscale = 100; } if (timer == 45) { _root.mrScience._xscale = -100; } if (timer == 60) { _root.mrScience._xscale = -100; _root.mrScience.targetX = _root[_root.mrScience.pushBlock]._x; } if (timer == 65) { _root.mrScience.speed = 2.8; } if (timer > 65 && timer < 120) { _root[_root.mrScience.pushBlock]._x += _root.mrScience.xSpeed; } if (timer == 120) { _root.mrScience.speed = 6; _root.mrScience.targetY = _root.mrScience._y - 500; } if (timer == 180) { _root.mrScience.swapDepths(_root.getNextHighestDepth()); _root.mrScience.removeMovieClip(); _root.cutscene = false; _root.scientistIntroCam = false; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } } instance endPoint of movieClip 1070 { } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 40; } } instance startPoint of movieClip 1048 { } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -50; focusPowerX = 0; focusPowerY = 0.8; } } frame 38 { if (!musicTrack2) { loadMusicTrack2(); } } frame 38 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } frameSetUp = false; _root.saveState(); _root.gotoAndStop(_root._currentframe + 1); } frame 39 { if (!_root.megaTeddington) { com.newgrounds.API.logCustomEvent('Game_W2_L5'); } else { com.newgrounds.API.logCustomEvent('Ted_Game_W2_L5'); } } frame 39 { setUpFrame(); } instance of movieClip 1185 { onClipEvent (load) { signalName = 'secondBossDoor'; red = 1; green = 0; blue = 0; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'openSeameseCat'; inverted = true; red = 1; green = 0; blue = 0; } } movieClip 1375 { } movieClip 1377 { } movieClip 1379 { } movieClip 1381 { } movieClip 1383 { } movieClip 1385 { } movieClip 1387 { } movieClip 1388 { frame 1 { legsRight.xOffset = legsRight._x; legsLeft.xOffset = legsLeft._x; stretchBody.startWidth = stretchBody._width; face.yOffset = face._y - stretchBody._y; tail.rotSpeed2 = 2; tail.rotSpeed = 2; _root.depthSortCustomY(this, _y - 55); startX = _x; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = 180; _root[collisionName]._height = 100; _root[collisionName]._x = _x; _root[collisionName]._y = _y - 20; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].activated = false; _root[collisionName].squishable = true; collisionName2 = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName2, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName2]._width = 40; _root[collisionName2]._height = 133; _root[collisionName2]._x = _x - 70; _root[collisionName2]._y = _y; _root[collisionName2].extraThicknessY = 0; _root[collisionName2].extraThicknessX = 0; _root[collisionName2].activated = false; _root[collisionName2].squishable = true; collisionName3 = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName3, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName3]._width = 40; _root[collisionName3]._height = 133; _root[collisionName3]._x = _x + 70; _root[collisionName3]._y = _y; _root[collisionName3].extraThicknessY = 0; _root[collisionName3].extraThicknessX = 0; _root[collisionName3].activated = false; _root[collisionName3].squishable = true; onEnterFrame = function () { if (!_root.gamePause) { if (_root.onScreen.hitTest(this)) { tail.rotSpeed += (tail.rotSpeed2 - tail.rotSpeed) * 0.05; tail._rotation += tail.rotSpeed; if (tail._rotation > 30) { tail.rotSpeed2 = -2; } else { if (tail._rotation < -30) { tail.rotSpeed2 = 2; } } if (_root[signalName] || activated) { if (!activated) { _root.playSound('cat_open'); activated = true; } stretchBody._y += (-180 - stretchBody._y) * 0.015; stretchBody._width += (180 - stretchBody._width) * 0.015; stretchOpeningBottom._width = stretchBody._width; stretchOpening._width = stretchOpeningBottom._width; if (stretchBody._y > -150) { _x = startX - 1 + random(3); } if (stretchBody._y < -100) { _root.endPoint.activated = true; } _root[collisionName].activated = true; _root[collisionName2].activated = true; _root[collisionName3].activated = true; legsRight._x = stretchBody._width / 2; legsLeft._x = -stretchBody._width / 2; face._y = stretchBody._y + face.yOffset; stretchOpening._height = -stretchBody._y * 2; } } } }; } instance tail of movieClip 1375 { onClipEvent (load) { rotSpeed2 = 2; rotSpeed = 2; } onClipEvent (enterFrame) { if (!_root.gamePause) { rotSpeed += (rotSpeed2 - rotSpeed) * 0.05; _rotation = _rotation + rotSpeed; if (_rotation > 30) { rotSpeed2 = -2; } else { if (_rotation < -30) { rotSpeed2 = 2; } } } } } } instance of movieClip 1388 { onClipEvent (load) { signalName = 'openSeameseCat'; } } instance endPoint of movieClip 1070 { onClipEvent (load) { gotoFrame = 45; fadeToWhite = true; activated = false; _visible = false; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 100; focusOffsetY = -100; focusPower = 0.5; } } instance of movieClip 1238 { onClipEvent (load) { rightMovement = 250; leftMovement = 180; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(0, 0, 25, 0, 0, 0); triggerOnce = true; } } movieClip 1391 { } movieClip 1393 { } movieClip 1395 { frame 1 { _root.depthSort(this); starTimer = 30; destructionTimer = 150; onEnterFrame = function () { if (!_root.gamePause) { if (_root.boss.health <= 0) { if (destructionTimer == 100) { _root.addSpeechBubble(_root.controlTower._x + 200, _root.controlTower._y - 170, 'Noooooooooo...!', false, 100, undefined, 6); } --starTimer; --destructionTimer; if (starTimer <= 0 && destructionTimer > 0) { _root.playSound('explosion_', _x + (_root.gameCamera._x - _x) * 0.3, _root.gameCamera._y, 1 + random(4)); showScientist = false; _root.addSmoke(_x + random(_width), _y - random(_height)); _root.addStar(_x + random(_width), _y - random(_height)); starTimer = 5; _root.secondBossDoor = true; } } } }; } instance hand1 of movieClip 1391 { onClipEvent (load) { startRot = _rotation; startX = _x; _x = _x + 70; _visible = false; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (_parent.showHands) { _x = _x + (startX - _x) * 0.3; _visible = true; if (_root.boss.timeOffset < _root.boss.upTime + _root.boss.downTime - _root.boss.warningTime) { _rotation = _rotation + (startRot - 30 - _rotation) * 0.8; } else { _rotation = _rotation + (startRot - _rotation) * 0.3; } } } } } instance hand2 of movieClip 1391 { onClipEvent (load) { startX = _x; startY = _y; bossStartX = _root.boss._x; bossStartY = _root.boss._y; _x = _x - 70; _visible = false; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (_parent.showHands) { _visible = true; _x = _x + (startX - (bossStartX - _root.boss._x) * 0.025 - _x) * 0.3; _y = _y + (startY - (bossStartY - _root.boss._y) * 0.025 - _y) * 0.3; } } } } instance scientist of movieClip 1393 { onClipEvent (load) { startY = _y; ySpeed = -13; _y = _y + 90; beGone = true; beenUp = false; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (_parent.showScientist) { _y = _y + ySpeed; ySpeed += 0.8; if (ySpeed >= 0 && _y > startY) { _parent.showHands = true; ySpeed = 0; _y = startY; } beGone = false; beenUp = true; } else { if (!beGone) { _parent.showHands = false; ySpeed = 0.2; _y = _y - 30; beGone = true; } if (beenUp) { _rotation = _rotation + (-20 - _rotation) * 0.8; _parent.hand1._x += (_x - _parent.hand1._x) * 0.3; _parent.hand2._x += (_x - _parent.hand2._x) * 0.3; if (_parent.hand1._x > _x - 10) { _parent.hand1.swapDepths(_parent.getNextHighestDepth()); _parent.hand1.removeMovieClip(); _parent.hand2.swapDepths(_parent.getNextHighestDepth()); _parent.hand2.removeMovieClip(); } _y = _y + ySpeed; ySpeed += 0.008; if (_y > startY + 50) { musicLayerVolsArray = new Array(0, 0, 37.5, 0, 31.5, 0); _root.setMusicLayerVols(musicLayerVolsArray); _root.endOfLevelCutsceneCam = false; _root.endOfLevelPlayCam = true; _root.cutscene = false; _root.removeSpeechBubble(); this.swapDepths(_parent.getNextHighestDepth()); this.removeMovieClip(); } } } } } } } movieClip 1398 { frame 1 { stop(); } } movieClip 1400 { } movieClip 1401 { frame 1 { if (timeOffset == undefined) { timeOffset = 0; } if (upTime == undefined) { upTime = 60; } if (downTime == undefined) { downTime = 60; } collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = 199; _root[collisionName]._height = 99; _root[collisionName]._x = _x; _root[collisionName]._y = _y - 50; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].activated = true; _root[collisionName].squishable = true; _root.sfx.createEmptyMovieClip(this._name + 'SMC', _root.sfx.getNextHighestDepth()); _root[this._name + 'S'] = new Sound(_root.sfx[this._name + 'SMC']); _root[this._name + 'S'].attachSound('crusher_going_up_' + (1 + random(3))); _root.attachMovie('shadowLong', _name + 'Shadow', _root.getNextHighestDepth()); _root[_name + 'Shadow']._x = _x; _root[_name + 'Shadow']._y = _y - 50; _root[_name + 'Shadow']._width = 200; _root[_name + 'Shadow']._height = 100; _root.depthSortCustomY(_root[_name + 'Shadow'], _root.sizeOfArea._y - _root[_name + 'Shadow']._y / 100); top.ySpeed = 0; speed = 5; warningTime = 30; recoverTimer = 3; dead = false; smokeTimer = 0; rampageTimer = 150; deadAnimationTimer = 90; deadAnimationTimer2 = 5; deadYSpeed = 3; bossStart = false; checkDistTimer = 0; closestHero = 1; top.weakspot.startX = top.weakspot._x; top.weakspot._x -= 100; _root.depthSortCustomY(this, this._y - 2); onEnterFrame = function () { if (!_root.gamePause) { if (!_root.gamePause && bossStart) { if (!dead) { _root.crusher(this); } --checkDistTimer; if (_root.nrOfPlayers == 2 && checkDistTimer <= 0) { closestHero = 1; if (_root.getDist(_x, _y, _root.heroP2._x, _root.heroP2._y) < _root.getDist(_x, _y, _root.heroP1._x, _root.heroP1._y)) { closestHero = 2; } if (!_root.hero2Alive) { closestHero = 1; } else { if (!_root.hero1Alive) { closestHero = 2; } } checkDistTimer = 15; } if (timeOffset < downTime + upTime - warningTime && timeOffset > downTime + 30) { if (_root['heroP' + closestHero]._y < _y && _root['heroP' + closestHero]._y > _y - 100 && _root['heroP' + closestHero]._x < _x + 100 && _root['heroP' + closestHero]._x > _x - 100) { if (timeOffset < upTime + downTime - warningTime - 10) { timeOffset = upTime + downTime - warningTime - 10; } } if (_root.getDist(_root['heroP' + closestHero]._x, _root['heroP' + closestHero]._y, _x, _y - 50) > 30) { _root.moveInDir(this, _root.getAngle(_root['heroP' + closestHero]._x, _root['heroP' + closestHero]._y, _x, _y - 50) + 90, speed); } _root[collisionName].squishable = false; } else { _root[collisionName].squishable = true; } if (this._x + 100 > _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2) { _x = _root[restrictZoneName]._x + _root[restrictZoneName]._width / 2 - 100; } else { if (this._x - 100 < _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2) { _x = _root[restrictZoneName]._x - _root[restrictZoneName]._width / 2 + 100; } } if (this._y > _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2) { _y = _root[restrictZoneName]._y + _root[restrictZoneName]._height / 2; } else { if (this._y - 100 < _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2) { _y = _root[restrictZoneName]._y - _root[restrictZoneName]._height / 2 + 100; } } if (health <= 20 && health > 0) { --smokeTimer; --rampageTimer; --recoverTimer; top.weakspot._x += (top.weakspot.startX - top.weakspot._x) * 0.05; if (smokeTimer <= 0) { _root.addSmoke(_x + 100, _y + top._y - 200); smokeTimer = 10; } if (rampageTimer <= 0) { downTime = 240; } if (rampageTimer <= -90) { downTime = 30; timeOffset = 0; rampageTimer = 210; } if (bottom._y > -30) { if (recoverTimer <= 0) { p = 1; while (p <= _root.nrOfPlayers) { if (hitbox.hitTest(_root['heroAttackHitboxP' + p])) { _root.playSound('egg_hit_', _x, _y, 1 + random(4)); _root.playSound('nunchuck_hit_', _x, _y, 1 + random(4)); m = 0; while (m < _root['heroAttackHitboxP' + p].damageMultiplier) { _root.addVirusSplat(_x + 120, _y - 50, 1, 100, 0.5, 100, 100, 'weakspotSplat', -30, 1); _root.addStar(_x + 120, _y - 100, 150); health -= 1; recoverTimer = 4; _root.addMultiplier(p); _root.giveScore(p, 10); if (health <= 0) { _root.giveScore(p, 1000); m = _root['heroAttackHitboxP' + p].damageMultiplier; } ++m; } } ++p; } } } } if (health <= 0) { timeOffset = downTime - 10; if (!dead) { _root.playSound('blueberry_pot_break_', _x, _y, 1 + random(2)); _root.cameraShakeTimer = 60; _root.addVirusSplat(_x + 120, _y - 50, 10, 100, 0.5, 100, 100, 'weakspotSplat', -30, 1.3); _root.addStar(_x + 120, _y - 100, 150); _root.addSmoke(_x + 120, _y - 100); healthbar.swapDepths(this.getNextHighestDepth()); healthbar.removeMovieClip(); top.weakspot.gotoAndStop(2); dead = true; } } if (dead) { _root.cutscene = true; _root.endOfLevelCutsceneCam = true; _root.endOfLevelPlayCam = false; p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _root['heroP' + p]._x; _root['heroP' + p].waypointY = _root['heroP' + p]._y; ++p; } --deadAnimationTimer; if (deadAnimationTimer == 60) { musicLayerVolsArray = new Array(0, 13.5, 0, 51, 31.5, 0); _root.setMusicLayerVols(musicLayerVolsArray); _root[collisionName].swapDepths(_root.getNextHighestDepth()); _root[collisionName].removeMovieClip(); } if (deadAnimationTimer > 0) { --deadAnimationTimer2; if (deadAnimationTimer2 <= 0) { _root.playSound('explosion_', _x, _y + top._y, 1 + random(4)); _root.addStar(_x + -120 + random(240), _y + top._y - random(300), 180); _root.addSmoke(_x + -120 + random(240), _y + top._y - random(300)); deadAnimationTimer2 = 5; } _root.cameraShakeTimer = 60; } else { ++deadYSpeed; if (top._y < -2000) { _root.cutscene = false; _root.endOfLevelCutsceneCam = false; _root.endOfLevelPlayCam = true; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } top._y -= deadYSpeed; _root[_name + 'Shadow']._alpha -= 1; if (_root[_name + 'Shadow']._alpha <= 0) { _root[_name + 'Shadow'].swapDepths(_root.getNextHighestDepth()); _root[_name + 'Shadow'].removeMovieClip(); } if (bottom._y > 0) { bottom._y = 0; } if (bottom._y - 40 > top._y) { bottom._y = top._y + 40; } } _root[collisionName]._x = _x; _root[collisionName]._y = _y - 50; _root[_name + 'Shadow']._x = _x; _root[_name + 'Shadow']._y = _y - 50; _root.depthSortCustomY(this, this._y - 2); } } }; } } instance boss of movieClip 1401 { onClipEvent (load) { upTime = 300; downTime = 70; timeOffset = 0; restrictZoneName = 'bhk179BAOWS'; health = 100; } } movieClip 1404 { frame 1 { _root.depthSortCustomY(this, _y - 30); stop(); health = 100; recoverTimer = 3; onEnterFrame = function () { if (!_root.gamePause && _root.boss.bossStart) { if (recoverTimer <= 0) { p = 1; while (p <= _root.nrOfPlayers) { if (hitbox.hitTest(_root['heroAttackHitboxP' + p])) { _root.playSound('egg_hit_', _x + (_root.gameCamera._x - _x) * 0.3, _root.gameCamera._y, 1 + random(4)); _root.playSound('nunchuck_hit_', _x + (_root.gameCamera._x - _x) * 0.3, _root.gameCamera._y, 1 + random(4)); m = 0; while (m < _root['heroAttackHitboxP' + p].damageMultiplier) { if (_root['heroP' + p]._x < _x) { xDir = -1; } else { xDir = 1; } _root.addMultiplier(p); _root.giveScore(p, 10); _root.addVirusSplat(_x, _y, 1, 100, 0.5 * xDir, 100, 100, 'weakspotSplat', -30, 1); _root.addStar(_x, _y - 80, 150); health -= 3; recoverTimer = 3; if (health <= 0) { _root.giveScore(p, 100); m = _root['heroAttackHitboxP' + p].damageMultiplier; } ++m; } } ++p; } } else { --recoverTimer; } if (health <= 0) { _root.playSound('blueberry_pot_break_', _x + (_root.gameCamera._x - _x) * 0.5, _root.gameCamera._y, 1 + random(2)); _root.playSound('explosion_', _x + (_root.gameCamera._x - _x) * 0.4, _root.gameCamera._y, 1 + random(4)); _root.cameraShakeTimer = 30; _root.addVirusSplat(_x, _y, 8, 100, 0.8 * xDir, 100, 100, 'weakspotSplat', -30, 1.3); ++_root.boss.speed; _root.boss.downTime -= 10; _root.boss.warningTime -= 7.5; _root.boss.health -= 20; _root.addSmoke(_x, _y - 50); _root.addStar(_x, _y - 80, 200); healthbar._visible = false; this.gotoAndStop(2); timer = 2; this.onEnterFrame = function () { if (!_root.gamePause) { --timer; _root.addStar(_x, _y - 30 - random(70), 170); if (timer <= 0) { this.onEnterFrame = undefined; } } }; } } }; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -300; focusPowerX = 0.9; focusPowerY = 0.45; signalName = 'endOfLevelPlayCam'; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 50; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'bhk179BAOWS'; } } instance endOfLevelTrigger of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; _root.secondBossDoorFirstDoor = true; } onClipEvent (enterFrame) { if (_root.nrOfPlayers == 2) { touchP1 = this.hitTest(_root.heroHitboxP1); touchP2 = this.hitTest(_root.heroHitboxP2); if (touchP1 && touchP2 || touchP1 && !_root.hero2Alive || touchP2 && !_root.hero1Alive) { startSequence = true; } } else { if (this.hitTest(_root.heroHitboxP1)) { startSequence = true; } } if (startSequence) { musicLayerVolsArray = new Array(28.5, 0, 0, 0, 4.5, 32); _root.setMusicLayerVols(musicLayerVolsArray); _root.cutscene = true; _root.secondBossDoorFirstDoor = false; _root.endOfLevelPlayCam = false; _root.endOfLevelCutsceneCam = true; p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _root['waypoint1P' + p]._x; _root['heroP' + p].waypointY = _root['waypoint1P' + p]._y; ++p; } this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -200; focusPowerX = 1; focusPowerY = 1; signalName = 'endOfLevelCutsceneCam'; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 0; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (_root.nrOfPlayers == 2) { touchP1 = this.hitTest(_root.heroHitboxP1); touchP2 = this.hitTest(_root.heroHitboxP2); if (touchP1 && touchP2 || touchP1 && !_root.hero2Alive || touchP2 && !_root.hero1Alive) { startSequence = true; } } else { if (this.hitTest(_root.heroHitboxP1)) { startSequence = true; } } if (startSequence) { ++timer; if (timer == 30) { p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p]._xscale = -100; _root['heroSwordP' + p]._xscale = -100; _root['heroSwordP' + p].targetRotation = -25; ++p; } } if (timer == 60) { _root.controlTower.showScientist = true; } if (timer == 80) { if (!_root.megaTeddington) { _root.addSpeechBubble(_root.controlTower._x + 200, _root.controlTower._y - 170, 'You will never reach Mr.Teddington!', false, 100, undefined, 6); } else { _root.addSpeechBubble(_root.controlTower._x + 200, _root.controlTower._y - 170, 'You will never reach Nunchuck Charlie!', false, 100, undefined, 6); } } if (timer == 150) { _root.boss.bossStart = true; } if (timer == 180) { _root.removeSpeechBubble(); _root.cutscene = false; _root.endOfLevelPlayCam = true; } if (timer == 181) { musicLayerVolsArray = new Array(79.5, 55.5, 0, 60, 52.5, 100); _root.setMusicLayerVols(musicLayerVolsArray); _root.endOfLevelCutsceneCam = false; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'secondBossDoorFirstDoor'; red = 1; green = 0; blue = 0; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(67, 0, 5, 4, 16, 32); triggerOnce = true; } } instance startPoint of movieClip 1048 { } frame 45 { if (!musicTrack3) { loadMusicTrack3(); } } frame 45 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } frameSetUp = false; _root.saveState(); _root.gotoAndStop(_root._currentframe + 1); } frame 46 { if (!_root.megaTeddington) { com.newgrounds.API.logCustomEvent('Game_W3_L1'); } else { com.newgrounds.API.logCustomEvent('Ted_Game_W3_L1'); } } frame 46 { setUpFrame(); _root.hud.attachMovie('chapterTitleScreen', 'chapterTitleScreen', _root.hud.getNextHighestDepth()); _root.hud.chapterTitleScreen.titleText.text = 'The Fishy Theatre'; _root.hud.chapterTitleScreen.chapterText.text = 'Chapter 3:'; _root.hud.chapterTitleScreen.achievementNr = 8; } movieClip 1407 { frame 1 { stop(); } } movieClip 1410 { frame 1 { stop(); } } movieClip 1412 { frame 1 { _root.depthSortCustomY(this, _y + 2); } } movieClip 1414 { frame 1 { _root.depthSort(this); } } movieClip 1416 { frame 1 { } } movieClip 1418 { frame 1 { _root.depthSortCustomY(this, _y + 51); } } movieClip 1420 { frame 1 { _root.depthSort(this); } } movieClip 1422 { frame 1 { if (!dontDepthSort) { _root.depthSortCustomY(this, _y - 1); } } } movieClip 1424 { frame 1 { _root.depthSortCustomY(this, _y - 1); } } movieClip 1426 { frame 1 { _root.depthSort(this); } } movieClip 1428 { frame 1 { _root.depthSortCustomY(this, _y + 1); } } movieClip 1430 { frame 1 { _root.depthSort(this); } } movieClip 1432 { frame 1 { _root.depthSortCustomY(this, _y + 2); } } movieClip 1434 { frame 1 { _root.depthSort(this); _y = _y - 15; } } movieClip 1436 { frame 1 { startX = _x; startY = _y; rotAngle = 0; _root.depthSort(this); onEnterFrame = function () { if (_root.onScreen.hitTest(this)) { rotAngle += rotSpeed; _x = startX + Math.sin(rotAngle * 0.0174532925199433) * 20; _y = startY - Math.cos(rotAngle * 0.0174532925199433) * 20; } }; } } instance of movieClip 1436 { onClipEvent (load) { rotSpeed = 4; } } movieClip 1438 { frame 1 { startX = _x; startY = _y; rotAngle = 0; _root.depthSort(this); onEnterFrame = function () { if (_root.onScreen.hitTest(this)) { rotAngle += rotSpeed; _x = startX + Math.sin(rotAngle * 0.0174532925199433) * 20; _y = startY - Math.cos(rotAngle * 0.0174532925199433) * 20; } }; } } instance of movieClip 1438 { onClipEvent (load) { rotSpeed = -3; } } instance of movieClip 1436 { onClipEvent (load) { rotSpeed = 2; } } instance of movieClip 1180 { onClipEvent (load) { wave = new Array([[6, 1, 2], [7, 1, 0], [6, 0, 2], [7, 0, 0]], [[6, 1, 0], [6, 1, 2], [7, 0, 0], [7, 0, 2]], [[6, 0, 2], [7, 1, 0], [7, 0, 0], [7, 1, 2]]); restrictZoneName = 'dawddvxrb44'; startMusicLayerVolsArray = new Array(100, 56, 0, 31, 80); endMusicLayerVolsArray = new Array(0, 15, 0, 31, 33); } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'dawddvxrb44'; } } movieClip 1440 { frame 1 { _root.depthSort(this); } } movieClip 1442 { frame 1 { } } movieClip 1444 { frame 1 { _root.depthSort(this); } } movieClip 1446 { frame 1 { _root.depthSortCustomY(this, _y + 1); } } movieClip 1447 { frame 1 { _root.depthSort(this); } } movieClip 1449 { frame 1 { _root.depthSort(this); } } movieClip 1451 { frame 1 { _root.depthSort(this); } } movieClip 1452 { frame 1 { _root.depthSortCustomY(this, _y + 1); } } movieClip 1454 { frame 1 { _root.depthSortCustomY(this, _y - 2); } } movieClip 1456 { } movieClip 1458 { } movieClip 1459 { frame 1 { if (invertMultiplier == undefined) { invertMultiplier = 1; } collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName].squishable = true; _root[collisionName]._width = _width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x - (_width / 2) * invertMultiplier; _root[collisionName]._y = _y - hitbox._height / 2; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; recoverTimer = 0; hitEffectSpeed = 0; concertina.startWidth = concertina._width; _root.depthSort(this); _name = 'rapidHitBlocker' + _root.nrOfRapidHitBlockers; ++_root.nrOfRapidHitBlockers; } } instance of movieClip 1459 { onClipEvent (load) { invertMultiplier = 1; hitEffectMultiplier = 0.6; } } movieClip 1463 { frame 1 { stop(); } } movieClip 1464 { frame 1 { this._name = 'teleporter' + _root.nrOfTeleporters; ++_root.nrOfTeleporters; _root.attachMovie('teleporterGlow', _name + 'Glow1', _root.getNextHighestDepth()); _root[_name + 'Glow1']._x = _x; _root[_name + 'Glow1']._y = _y + 44; _root.depthSort(_root[_name + 'Glow1']); _root.attachMovie('teleporterGlow', _name + 'Glow2', _root.getNextHighestDepth()); _root[_name + 'Glow2']._x = _x; _root[_name + 'Glow2']._y = _y - 33; _root.depthSort(_root[_name + 'Glow2']); if (signalName == undefined) { activated = true; } else { activated = _root[signalName]; } var transformer = new flash.geom.Transform(teleporterIn); var transformer2 = new flash.geom.Transform(_root[_name + 'Glow1']); var transformer3 = new flash.geom.Transform(_root[_name + 'Glow2']); var colorTransformer = transformer.colorTransform; colorTransformer.redMultiplier = red; colorTransformer.greenMultiplier = green; colorTransformer.blueMultiplier = blue; transformer.colorTransform = colorTransformer; transformer2.colorTransform = colorTransformer; transformer3.colorTransform = colorTransformer; onScreen = false; _root.depthSortCustomY(this, _root.sizeOfArea._y + 8 - _y / 100); } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = -200; teleportYOffset = 0; red = 0.6; green = 0.3; blue = 1; } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = -200; teleportYOffset = -100; red = 1; green = 0.3; blue = 0.4; } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = -200; teleportYOffset = -100; red = 0.2; green = 0.8; blue = 0.3; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 600; focusOffsetY = 100; focusPowerX = 0.04; focusPowerY = 0.9; } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = -200; teleportYOffset = 100; red = 0.2; green = 0.8; blue = 0.3; } } movieClip 1467 { } movieClip 1468 { frame 1 { var transformer = new flash.geom.Transform(teleporterIn); var colorTransformer = transformer.colorTransform; colorTransformer.redMultiplier = red; colorTransformer.greenMultiplier = green; colorTransformer.blueMultiplier = blue; transformer.colorTransform = colorTransformer; _root.depthSortCustomY(this, 10 + _root.sizeOfArea._y - _y / 100); } } instance of movieClip 1468 { onClipEvent (load) { red = 0.3; green = 0.3; blue = 0.9; } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = -200; teleportYOffset = 0; red = 0.3; green = 0.3; blue = 0.9; } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = -200; teleportYOffset = 200; red = 0.6; green = 0.3; blue = 1; } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = -200; teleportYOffset = 0; red = 1; green = 0.3; blue = 0.4; } } movieClip 1470 { frame 1 { } } instance of movieClip 1468 { onClipEvent (load) { red = 0.6; green = 0.3; blue = 1; } } instance of movieClip 1468 { onClipEvent (load) { red = 1; green = 0.3; blue = 0.4; } } instance of movieClip 1468 { onClipEvent (load) { red = 0.2; green = 0.8; blue = 0.3; } } instance of movieClip 1468 { onClipEvent (load) { red = 0.9; green = 0.9; blue = 0.1; } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = 0; teleportYOffset = 300; red = 0.2; green = 0.8; blue = 0.3; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 70; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 70; } } instance of movieClip 1195 { onClipEvent (load) { gnomeNumber = 7; } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = 0; teleportYOffset = -200; red = 0.9; green = 0.9; blue = 0.1; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(9, 56, 0, 56, 15); triggerOnce = true; } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = -500; teleportYOffset = -200; red = 0.2; green = 0.3; blue = 0.9; } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = -500; teleportYOffset = -200; red = 1.1; green = 0.3; blue = 0.2; } } instance of movieClip 1468 { onClipEvent (load) { red = 0.2; green = 0.3; blue = 0.9; } } instance of movieClip 1468 { onClipEvent (load) { red = 1.1; green = 0.3; blue = 0.2; } } movieClip 1472 { frame 1 { } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'jafkjabn1'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'jklnkajbef72'; } } instance of movieClip 644 soldier { onClipEvent (load) { sType = 6; signalName = 'jafkjabn1'; restrictZoneName = 'jklnkajbef72'; playIdleAnim = true; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'jafkjabn2'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'jklnkajbef722'; } } instance of movieClip 644 soldier { onClipEvent (load) { sType = 6; signalName = 'jafkjabn2'; restrictZoneName = 'jklnkajbef722'; playIdleAnim = true; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'jafkjabn3'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'jklnkajbef7223'; } } instance of movieClip 644 soldier { onClipEvent (load) { sType = 7; signalName = 'jafkjabn3'; restrictZoneName = 'jklnkajbef7223'; playIdleAnim = true; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0.8; focusPowerY = 0.4; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(78, 0, 0, 56, 82); triggerOnce = true; } } movieClip 1474 { frame 1 { _root.depthSortCustomY(this, _y + 51); } } movieClip 1476 { frame 1 { } } instance of movieClip 1127 { onClipEvent (load) { squishable = true; } } movieClip 1478 { } movieClip 1479 { frame 1 { if (invertMultiplier == undefined) { invertMultiplier = 1; } collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName].squishable = true; _root[collisionName]._width = _width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x - (_width / 2) * invertMultiplier; _root[collisionName]._y = _y - hitbox._height / 2; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; recoverTimer = 0; hitEffectSpeed = 0; concertina.startWidth = concertina._width; _root.depthSort(this); _name = 'rapidHitBlocker' + _root.nrOfRapidHitBlockers; ++_root.nrOfRapidHitBlockers; } } instance of movieClip 1479 { onClipEvent (load) { invertMultiplier = -1; hitEffectMultiplier = 0.6; } } instance of movieClip 1479 { onClipEvent (load) { invertMultiplier = 1; hitEffectMultiplier = 0.6; } } instance of movieClip 702 wall_collision { onClipEvent (load) { squishable = true; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 20; } } instance of movieClip 1127 { onClipEvent (load) { squishable = true; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0.9; focusPowerY = 0.1; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(96, 52, 0, 20, 81); triggerOnce = true; } } movieClip 1481 { frame 1 { if (!dontDepthSort) { _root.depthSort(this); } } } instance of movieClip 702 wall_collision { onClipEvent (load) { squishable = true; } } instance of movieClip 702 wall_collision { onClipEvent (load) { squishable = true; } } movieClip 1483 { } movieClip 1485 { } movieClip 1486 { frame 1 { if (invertMultiplier == undefined) { invertMultiplier = 1; } collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName].squishable = true; _root[collisionName]._width = _width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x - (_width / 2) * invertMultiplier; _root[collisionName]._y = _y - hitbox._height / 2; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; recoverTimer = 0; hitEffectSpeed = 0; concertina.startWidth = concertina._width; blocked = false; _root.depthSort(this); _name = 'rapidHitBlocker' + _root.nrOfRapidHitBlockers; ++_root.nrOfRapidHitBlockers; } } instance of movieClip 1486 { onClipEvent (load) { invertMultiplier = -1; hitEffectMultiplier = 0.6; } } instance of movieClip 1486 { onClipEvent (load) { invertMultiplier = 1; hitEffectMultiplier = 0.6; } } movieClip 1488 { } movieClip 1490 { } movieClip 1491 { frame 1 { if (invertMultiplier == undefined) { invertMultiplier = 1; } if (hitEffectMultiplier == undefined) { hitEffectMultiplier = 1; } collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName].squishable = true; _root[collisionName]._width = _width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x - (_width / 2) * invertMultiplier; _root[collisionName]._y = _y - hitbox._height / 2; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root[collisionName].squishable = true; recoverTimer = 0; hitEffectSpeed = 0; concertina.startWidth = concertina._width; _root.depthSort(this); _name = 'rapidHitBlocker' + _root.nrOfRapidHitBlockers; ++_root.nrOfRapidHitBlockers; } } instance of movieClip 1491 { onClipEvent (load) { invertMultiplier = 1; hitEffectMultiplier = 1; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(96, 64, 0, 0, 81); triggerOnce = true; } } movieClip 1493 { frame 1 { _root.depthSortCustomY(this, _y - 3); } } movieClip 1495 { } movieClip 1497 { frame 1 { _root.depthSort(this); } } movieClip 1499 { frame 1 { _root.depthSort(this); } } movieClip 1501 { frame 1 { _root.depthSort(this); } } movieClip 1503 { frame 1 { _root.depthSort(this); } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0; focusPowerY = 0.5; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(96, 0, 0, 0, 81); triggerOnce = true; } } instance startPoint of movieClip 1048 { } instance of movieClip 1147 { onClipEvent (load) { signalName = 'awddtbh22341'; inverted = false; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 1486 { onClipEvent (load) { invertMultiplier = -1; hitEffectMultiplier = 0.6; } } instance of movieClip 1479 { onClipEvent (load) { invertMultiplier = 1; hitEffectMultiplier = 0.6; } } movieClip 1505 { } movieClip 1506 { frame 1 { if (invertMultiplier == undefined) { invertMultiplier = 1; } collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName].squishable = true; _root[collisionName]._width = _width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x - (_width / 2) * invertMultiplier; _root[collisionName]._y = _y - hitbox._height / 2; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; recoverTimer = 0; hitEffectSpeed = 0; concertina.startWidth = concertina._width; _root.depthSort(this); _name = 'rapidHitBlocker' + _root.nrOfRapidHitBlockers; ++_root.nrOfRapidHitBlockers; } } instance of movieClip 1506 { onClipEvent (load) { invertMultiplier = -1; hitEffectMultiplier = 1; } } instance of movieClip 1486 { onClipEvent (load) { invertMultiplier = -1; hitEffectMultiplier = 0.6; } } instance of movieClip 1486 { onClipEvent (load) { invertMultiplier = 1; hitEffectMultiplier = 0.6; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'awddtbh22341'; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 1464 { onClipEvent (load) { signalName = 'awddtbh22341'; red = 0.3; green = 1; blue = 0.3; teleportXOffset = 0; teleportYOffset = 500; } } instance of movieClip 1468 { onClipEvent (load) { signalName = 'awddtbh22341'; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 50; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0.5; focusPowerY = 0.5; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(24, 15, 0, 46.5, 9); triggerOnce = true; } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = 400; teleportYOffset = 0; red = 0.1; green = 1; blue = 0.5; } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = -400; teleportYOffset = 0; red = 0.1; green = 1; blue = 0.5; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0.9; focusPowerY = 0.5; } } instance endPoint of movieClip 1070 { } instance of movieClip 1147 { onClipEvent (load) { signalName = 'dfxfxvrs345345'; inverted = true; red = 0.2; green = 0.9; blue = 0.3; } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = 200; teleportYOffset = 100; red = 0.2; green = 0.9; blue = 0.3; } } instance of movieClip 1464 { onClipEvent (load) { signalName = 'dfxfxvrs345345'; inverted = true; teleportXOffset = -200; teleportYOffset = -100; red = 0.2; green = 0.9; blue = 0.3; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0.5; focusPowerY = 0.5; } } instance of movieClip 1464 { onClipEvent (load) { signalName = 'dfxfxvrs345345'; teleportXOffset = -200; teleportYOffset = 100; red = 0.2; green = 0.9; blue = 0.3; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; } onClipEvent (enterFrame) { t = 0; while (t <= _root.nrOfTeleporters) { if (this.hitTest(_root['teleporter' + t])) { teleporterName = 'teleporter' + t; } ++t; } this.onEnterFrame = function () { if (_root.dfxfxvrs345345) { _root[teleporterName].teleportYOffset = -100; } else { _root[teleporterName].teleportYOffset = 100; } }; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(11, 52, 0, 45, 81); triggerOnce = true; } } movieClip 1508 { frame 1 { stop(); ySpeed = -1.5; startY = _y; _root.depthSortCustomY(this, _y); onEnterFrame = function () { if (!_root.gamePause) { _y = _y + ySpeed; if (_y < startY) { ySpeed += 0.1; } else { ySpeed -= 0.1; } } }; } } frame 47 { if (!musicTrack3) { loadMusicTrack3(); } } frame 47 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } frameSetUp = false; _root.saveState(); _root.gotoAndStop(_root._currentframe + 1); } frame 48 { if (!_root.megaTeddington) { com.newgrounds.API.logCustomEvent('Game_W3_L2'); } else { com.newgrounds.API.logCustomEvent('Ted_Game_W3_L2'); } } frame 48 { setUpFrame(); } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -2; signalName = 'nu3771'; conveyorGroup = 'jjnnsuu4737'; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2; signalName = 'nu3771'; conveyorGroup = 'jjnnsuu4737'; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -2; signalName = 'nu3771'; conveyorGroup = 'jjnnsuu4737'; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2; signalName = 'nu3771'; conveyorGroup = 'jjnnsuu4737'; } } instance of movieClip 1293 { onClipEvent (load) { signalName = 'adadadzzve33'; red = 0; green = 0.3; blue = 1; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'adadadzzve33'; red = 0; green = 0.3; blue = 1; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'agadgee444'; detectWalls = true; detectPushBlockWalls = true; detectRapidHitBlockers = true; } } instance of movieClip 1486 { onClipEvent (load) { invertMultiplier = 1; hitEffectMultiplier = 0.6; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'nu3771'; inverted = false; red = 1; green = 1; blue = 1; } } instance of movieClip 1301 { onClipEvent (load) { restrictZoneName = 'agadgee444'; conveyorGroup = 'jjnnsuu4737'; } } instance of movieClip 1486 { onClipEvent (load) { invertMultiplier = -1; hitEffectMultiplier = 0.6; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2; signalName = 'nu3771'; conveyorGroup = 'jjnnsuu4737'; _visible = false; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2; signalName = 'nu3771'; conveyorGroup = 'jjnnsuu4737'; _visible = false; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 100; focusOffsetY = 0; focusPowerX = 0.5; focusPowerY = 0.5; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 50; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(0, 34.5, 51, 19, 36.2); triggerOnce = true; } } instance of movieClip 1464 { onClipEvent (load) { signalName = 'jkjna266'; inverted = true; teleportXOffset = -400; teleportYOffset = 0; red = 0.1; green = 0.9; blue = 0.3; hitbox._height += 10; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0.8; focusPowerY = 0.8; } } instance of movieClip 1468 { onClipEvent (load) { red = 0.1; green = 0.9; blue = 0.3; } } instance of movieClip 1301 { onClipEvent (load) { restrictZoneName = 'klljnea82'; } } instance of movieClip 1293 { onClipEvent (load) { signalName = 'jkjna266'; red = 0.1; green = 0.9; blue = 0.3; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'klljnea82'; detectWalls = true; detectTeleporters = true; } } instance of movieClip 644 soldier { onClipEvent (load) { sType = 7; signalName = 'fefe1414'; restrictZoneName = 'fjfyjfj4445252'; playIdleAnim = true; faceLeft = true; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'fefe1414'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'fjfyjfj4445252'; detectWalls = true; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(61, 34.5, 0, 0, 36.2); triggerOnce = true; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'xxggrrw33'; red = 1; green = 0; blue = 0; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -2; conveyorGroup = 'lsjs83'; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2; conveyorGroup = 'lsjs83'; } } instance of movieClip 1301 { onClipEvent (load) { restrictZoneName = 'aadwdwawdzz33'; conveyorGroup = 'lsjs83'; } } instance of movieClip 1486 { onClipEvent (load) { invertMultiplier = 1; hitEffectMultiplier = 0.6; } } instance of movieClip 1486 { onClipEvent (load) { invertMultiplier = -1; hitEffectMultiplier = 0.6; } } instance of movieClip 1293 { onClipEvent (load) { signalName = 'xxggrrw33'; red = 1; green = 0; blue = 0; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'aadwdwawdzz33'; detectWalls = true; detectPushBlockWalls = true; detectRapidHitBlockers = true; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -75; focusPowerX = 0.8; focusPowerY = 0.8; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 50; } } instance of movieClip 1195 { onClipEvent (load) { gnomeNumber = 8; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(0, 0, 64.5, 25.5, 0); triggerOnce = true; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2; conveyorGroup = 'piij32'; } } instance of movieClip 1301 { onClipEvent (load) { upMovement = 200; downMovement = 0; rightMovement = 450; leftMovement = 0; restrictZoneName = 'rararazzf3'; conveyorGroup = 'piij32'; } } instance of movieClip 1293 { onClipEvent (load) { signalName = 'afggh4422ujj'; red = 1; green = 0.1; blue = 0.1; } } instance of movieClip 1486 { onClipEvent (load) { invertMultiplier = -1; hitEffectMultiplier = 0.6; } } instance of movieClip 1506 { onClipEvent (load) { invertMultiplier = 1; hitEffectMultiplier = 1; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'afggh4422ujj'; red = 1; green = 0.1; blue = 0.1; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'rararazzf3'; detectWalls = true; detectPushBlockWalls = true; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -25; focusPowerX = 0.7; focusPowerY = 0.7; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 30; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(61, 34.5, 24.4, 19, 36.2); triggerOnce = true; } } movieClip 1510 { } movieClip 1512 { } movieClip 1514 { } movieClip 1516 { } movieClip 1518 { } movieClip 1519 { frame 1 { scale = 100; scaleTarget = 100; scaleSpeed = 0; timer = 15; recoverTimer = 15; health = 18; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root.depthSortCustomY(this, this._y - hitbox._height / 2); onEnterFrame = function () { if (_root.onScreen.hitTest(this)) { --recoverTimer; if (timer <= 0 && _root.nrOfHatBirds < 5) { _root.playSound('bird_pop_', _x, _y, 1 + random(3)); _root.attachMovie('fly', 'FLY' + _root.nrOfFlies, _root.getNextHighestDepth()); _root['FLY' + _root.nrOfFlies]._x = _x; _root['FLY' + _root.nrOfFlies]._y = _y - 50; ++_root.nrOfFlies; scaleSpeed -= 25; timer = 25 + random(20); } else { --timer; } if (recoverTimer <= 0) { p = 1; while (p <= _root.nrOfPlayers) { if (hitbox.hitTest(_root['heroAttackHitboxP' + p])) { _root.playSound('nunchuck_hit_', _x, _y, 1 + random(4)); m = 0; while (m < _root['heroAttackHitboxP' + p].damageMultiplier) { health -= 1; _root.addMultiplier(p); _root.giveScore(p, 10); _root.addStar(_x, _y - 50, 200); recoverTimer = 4; if (health <= 0) { _root.playSound('box_hit_', _x, _y, 1 + random(4)); _root.addSmoke(_x, _y); _root.giveScore(p, 100); m = _root['heroAttackHitboxP' + p].damageMultiplier; _root[collisionName].activated = false; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } ++m; } } ++p; } } scaleSpeed += (scaleTarget - scale) * 0.3; scaleSpeed *= 0.8; scale += scaleSpeed; bottom._yscale = scale; bottom._xscale = bottom._yscale; middle._xscale = scale; middle._yscale = 200 - middle._xscale; top._y = -middle._height; stripe._y = -35 * (middle._yscale / 100); stripe._yscale = scale; stripe._xscale = stripe._yscale; shadow._alpha = scale; } }; } } instance of movieClip 1151 { onClipEvent (load) { signalName = 'adawdbbteruryhj443'; red = 1; green = 0; blue = 0; } } instance of movieClip 566 robot { onClipEvent (load) { leftMovement = 0; rightMovement = 400; stunned = true; } } instance of movieClip 1340 { onClipEvent (load) { signalName = 'adawdbbteruryhj443'; red = 1; green = 0; blue = 0; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 50; focusOffsetY = 0; focusPowerX = 0.8; focusPowerY = 0.7; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(0, 0, 70.55, 0, 40); triggerOnce = true; } } instance of movieClip 1340 { onClipEvent (load) { signalName = 'bxrrs2255523'; red = 0.3; green = 0.3; blue = 1; } } instance of movieClip 1340 { onClipEvent (load) { signalName = 'bxrrs223'; red = 1; green = 0.3; blue = 0.3; } } instance of movieClip 566 robot { onClipEvent (load) { leftMovement = -200; rightMovement = 20; stunned = true; } } instance of movieClip 1340 { onClipEvent (load) { signalName = 'bxrrs2255556423'; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 1464 { onClipEvent (load) { signalName = 'bxrrs2255523'; teleportXOffset = -400; teleportYOffset = 0; red = 0.3; green = 0.3; blue = 1; } } instance of movieClip 1468 { onClipEvent (load) { red = 1; green = 1; blue = 1; } } instance of movieClip 1464 { onClipEvent (load) { signalName = 'bxrrs2255556423'; teleportXOffset = -600; teleportYOffset = 0; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 1464 { onClipEvent (load) { signalName = 'bxrrs223'; teleportXOffset = -200; teleportYOffset = 0; red = 1; green = 0.3; blue = 0.3; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0.5; focusPowerY = 0.8; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 10; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(50, 59, 46.2, 0, 40); triggerOnce = true; } } instance of movieClip 1127 { } instance of movieClip 1127 { } instance of movieClip 1127 { } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = -100; focusOffsetY = 0; focusPowerX = 0.5; focusPowerY = 0.9; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 30; } } movieClip 1521 { } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(24, 57.2, 70.55, 11.7, 13); triggerOnce = true; } } instance of movieClip 1301 { onClipEvent (load) { upMovement = 350; downMovement = 30; rightMovement = 0; leftMovement = 100; restrictZoneName = 'nnssee3443'; } } instance of movieClip 1464 { onClipEvent (load) { signalName = 'oajwn2845'; teleportXOffset = 400; teleportYOffset = 0; red = 0.1; green = 1; blue = 0.5; } } instance of movieClip 1464 { onClipEvent (load) { signalName = 'oajwn2845'; teleportXOffset = -400; teleportYOffset = 0; red = 0.1; green = 1; blue = 0.5; } } instance of movieClip 1340 { onClipEvent (load) { signalName = 'oajwn2845'; red = 0.1; green = 1; blue = 0.5; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'aadaad223ar'; detectTeleporters = true; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -50; focusPowerX = 0.8; focusPowerY = 0.4; } } instance of movieClip 1293 { onClipEvent (load) { signalName = 'aadxggtr33'; red = 1; green = 0; blue = 0; } } instance of movieClip 1151 { onClipEvent (load) { signalName = 'aadxggtr33'; red = 1; green = 0; blue = 0; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 50; } } instance of movieClip 566 robot { onClipEvent (load) { leftMovement = -50; rightMovement = 100; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'nnssee3443'; detectWalls = true; } } instance of movieClip 644 soldier { onClipEvent (load) { sType = 6; signalName = 'fbxb5353'; restrictZoneName = 'fgjtjt6666'; playIdleAnim = true; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'fbxb5353'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'fgjtjt6666'; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(61, 34.5, 0, 0, 0); triggerOnce = true; } } instance of movieClip 1464 { onClipEvent (load) { signalName = 'vvaaverrhh21256'; inverted = true; teleportXOffset = -400; teleportYOffset = 0; red = 0.1; green = 0.3; blue = 1; hitbox._height += 10; } } instance of movieClip 1468 { onClipEvent (load) { teleportXOffset = -400; teleportYOffset = 200; red = 0.1; green = 0.3; blue = 1; } } instance of movieClip 1301 { onClipEvent (load) { upMovement = 30; downMovement = 200; rightMovement = 200; leftMovement = 200; restrictZoneName = 'wawawa2231vr'; } } instance of movieClip 1293 { onClipEvent (load) { signalName = 'vvaaverrhh21256'; red = 0.1; green = 0.3; blue = 1; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'wawawa2231vr'; detectWalls = true; detectPushBlockWalls = true; detectTeleporters = true; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0.8; focusPowerY = 0.8; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(61, 34.5, 0, 19, 36.2); triggerOnce = true; } } instance endPoint of movieClip 1070 { } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'gsgs35353'; } } instance of movieClip 1180 { onClipEvent (load) { wave = new Array([[6, 1, 2], [6, 0, 0]], [[7, 0, 0], [7, 1, 2], [7, 0, 0]], [[6, 0, 2], [7, 1, 0], [6, 0, 0], [7, 1, 2]]); restrictZoneName = 'gsgs35353'; startMusicLayerVolsArray = new Array(32.25, 0, 46.2, 66, 66); } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'hdhdh245235'; } } instance of movieClip 1180 { onClipEvent (load) { wave = new Array([[6, 1, 2], [6, 0, 0], [6, 0, 2]], [[6, 0, 2], [7, 1, 0], [6, 0, 0], [7, 1, 2]]); restrictZoneName = 'hdhdh245235'; startMusicLayerVolsArray = new Array(32.25, 47, 38, 66, 66); endMusicLayerVolsArray = new Array(61, 0, 0, 0, 0); } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(24, 100, 0, 46.5, 9); triggerOnce = true; } } instance startPoint of movieClip 1048 { } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -0.8; signalName = 'affae3355'; conveyorGroup = 'njnkjkaf93'; } } instance of movieClip 566 robot { onClipEvent (load) { leftMovement = -100; rightMovement = 100; conveyorGroup = 'njnkjkaf93'; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 0.8; signalName = 'affae3355'; conveyorGroup = 'njnkjkaf93'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'vvvreq133'; detectWalls = true; } } instance of movieClip 1340 { onClipEvent (load) { signalName = 'oiueuau3971684713'; red = 0.3; green = 0.3; blue = 1; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'affae3355'; inverted = false; red = 1; green = 1; blue = 1; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'oiueuau3971684713'; red = 0.3; green = 0.3; blue = 1; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 50; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 100; focusOffsetY = 0; focusPowerX = 0.5; focusPowerY = 0.5; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -0.8; conveyorGroup = 'njnkjkaf93'; _visible = false; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -0.8; signalName = 'affae3355'; conveyorGroup = 'njnkjkaf93'; _visible = false; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 0.8; signalName = 'affae3355'; conveyorGroup = 'njnkjkaf93'; _visible = false; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(0, 0, 46.2, 0, 0); triggerOnce = true; } } frame 49 { if (!musicTrack3) { loadMusicTrack3(); } } frame 49 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } frameSetUp = false; _root.saveState(); _root.gotoAndStop(_root._currentframe + 1); } frame 50 { if (!_root.megaTeddington) { com.newgrounds.API.logCustomEvent('Game_W3_L3'); } else { com.newgrounds.API.logCustomEvent('Ted_Game_W3_L3'); } } frame 50 { setUpFrame(); } movieClip 1524 { frame 1 { stop(); } } movieClip 1527 { frame 1 { stop(); } } movieClip 1530 { frame 1 { stop(); } } movieClip 1532 { } movieClip 1533 { frame 1 { topSpeed = 100; endThickness = 15; stretch = 0; stretchSpeed = 0; stretchSpeed2 = topSpeed; reachedBottom = false; heightOffSet = midBody._y; hitTimer = 0; shakeOffset = 3; startX = _x; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName]._width = hitbox._width; _root[collisionName]._height = hitbox._height; _root[collisionName]._x = _x; _root[collisionName]._y = _y + hitbox._y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; ++hitbox._width; playedSound = false; onEnterFrame = function () { if (_root.onScreen.hitTest(this)) { if (hitTimer <= 0) { stretchSpeed += (stretchSpeed2 - stretchSpeed) * 0.05; stretch += stretchSpeed; backBody.gotoAndStop(1); midBody.gotoAndStop(1); face.gotoAndStop(1); } else { shakeOffset *= 0.95; _x = startX + shakeOffset; shakeOffset *= -1; backBody.gotoAndStop(2); midBody.gotoAndStop(2); face.gotoAndStop(2); --hitTimer; } if (reachedBottom) { if (!playedSound) { _root.playSound('sticky_', _x, _y + face2._y, 1 + random(3)); playedSound = true; } if (stretch < endThickness) { stretch = endThickness; stretchSpeed2 = topSpeed; stretchSpeed = 0; } else { if (stretch > stretchLength) { stretch = stretchLength; stretchSpeed = 0; stretchSpeed2 = -topSpeed; reachedBottom = false; } } midBody._y = heightOffSet + stretchLength - stretch; } else { if (playedSound) { _root.playSound('sticky_', _x, _y + face2._y, 1 + random(3)); playedSound = false; } if (stretch > stretchLength) { stretchSpeed2 = -topSpeed; stretchSpeed = 0; reachedBottom = true; stretch = stretchLength; } else { if (stretch < endThickness) { stretch = endThickness; stretchSpeed2 = topSpeed; stretchSpeed = 0; } } } midBody._height = stretch; face._yscale = 80 + (stretchLength - stretch) * 0.1; face._xscale = face._yscale; midBody._xscale = face._yscale; backBody._yscale = face._yscale; backBody._xscale = face._yscale; face2._yscale = 100 + (stretchLength - stretch) * 0.05; face2._xscale = face2._yscale; face2._rotation = _root.getAngle(_x, _y + face2._y, _root.heroP1._x, _root.heroP1._y); hitbox._height = midBody._height + 103; hitbox2._height = midBody._height; shadow._y = midBody._y + midBody._height / 2 - heightOffSet; hitbox2._y = shadow._y; hitbox._y = shadow._y; shadow.mid._height = midBody._height; shadow.bottom._y = shadow.mid._height / 2; shadow.top._y = -shadow.mid._height / 2; face._y = midBody._y + midBody._height; backBody._y = midBody._y; face2._y = face._y; if (hitTimer <= 1) { p = 1; while (p <= _root.nrOfPlayers) { if (hitbox.hitTest(_root['heroAttackHitboxP' + p])) { bb = 0; while (bb < 3) { _root.addStar(this._x, _root['heroP' + p]._y - 50, 150); ++bb; } _root.playSound('nunchuck_hit_', this._x, _root['heroP' + p]._y - 50, 1 + random(4)); _root.playSound('sticky_wobble_', this._x, _root['heroP' + p]._y - 50, 1 + random(3)); shakeOffset = 3; hitTimer = 60; } if (hitbox2.hitTest(_root['heroHitboxP' + p])) { _root['heroP' + p].squishTimer = 2; if (_root['heroHitboxP' + p]._x < _x) { _root.hurtHero(p, 1, 10); } else { _root.hurtHero(p, -1, 10); } } ++p; } } _root[collisionName]._height = hitbox._height - 100; _root[collisionName]._y = _y + hitbox._y; _root.depthSortCustomY(this, this._y + midBody._y - heightOffSet); } }; } } instance of movieClip 1533 { onClipEvent (load) { stretchLength = 150; } } instance of movieClip 1533 { onClipEvent (load) { stretchLength = 150; } } instance of movieClip 1533 { onClipEvent (load) { stretchLength = 150; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -50; focusPowerX = 0; focusPowerY = 0.8; } } instance of movieClip 644 soldier { onClipEvent (load) { sType = 6; signalName = 'fefe1wt414'; restrictZoneName = 'fjfyjfj4445252'; playIdleAnim = true; faceLeft = true; } } instance of movieClip 1050 { onClipEvent (load) { signalName = 'fefe1wt414'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'fjfyjfj4445252'; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(51, 0, 0, 21, 66); triggerOnce = true; } } instance of movieClip 1533 { onClipEvent (load) { stretchLength = 300; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -50; focusPowerX = 0; focusPowerY = 0.8; } } instance of movieClip 1533 { onClipEvent (load) { stretchLength = 300; } } instance of movieClip 1533 { onClipEvent (load) { stretchLength = 300; } } instance of movieClip 1506 { onClipEvent (load) { invertMultiplier = 1; hitEffectMultiplier = 1; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -50; focusPowerX = 0; focusPowerY = 0.8; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -50; focusPowerX = 0; focusPowerY = 0.8; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(51, 55, 0, 17, 29); triggerOnce = true; } } instance of movieClip 1533 { onClipEvent (load) { stretchLength = 300; } } instance of movieClip 1533 { onClipEvent (load) { stretchLength = 300; } } instance of movieClip 1533 { onClipEvent (load) { stretchLength = 300; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -50; focusPowerX = 0; focusPowerY = 0.8; } } instance of movieClip 159 checkpoint { onClipEvent (load) { this.hitbox._height = 300; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(51, 55, 64.5, 25.5, 0); triggerOnce = true; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(0, 0, 64.5, 25.5, 0); triggerOnce = true; } } instance startPoint of movieClip 1048 { } instance of movieClip 1481 { onClipEvent (load) { dontDepthSort = true; } } instance of movieClip 1481 { onClipEvent (load) { dontDepthSort = true; } } instance of movieClip 1422 { onClipEvent (load) { dontDepthSort = true; } } instance of movieClip 1422 { onClipEvent (load) { dontDepthSort = true; } } instance of movieClip 1422 { onClipEvent (load) { dontDepthSort = true; } } instance of movieClip 1481 { onClipEvent (load) { dontDepthSort = true; } } instance of movieClip 1481 { onClipEvent (load) { dontDepthSort = true; } } instance of movieClip 1481 { onClipEvent (load) { dontDepthSort = true; } } instance of movieClip 1481 { onClipEvent (load) { dontDepthSort = true; } } instance of movieClip 1422 { onClipEvent (load) { dontDepthSort = true; } } movieClip 1538 { } movieClip 1540 { } movieClip 1541 { frame 1 { function spawnPlayer(heroNr, xPos, yPos) { if (!_root.megaTeddington || heroNr == 2) { this.mirrored.attachMovie('hero' + heroNr, 'heroP' + heroNr, this.mirrored.getNextHighestDepth()); this.mirrored.attachMovie('heroSword', 'heroSwordP' + heroNr, this.mirrored.getNextHighestDepth()); this.mirrored['heroSwordP' + heroNr]._x = xPos; this.mirrored['heroP' + heroNr]._x = this.mirrored['heroSwordP' + heroNr]._x; this.mirrored['heroSwordP' + heroNr]._y = yPos; this.mirrored['heroP' + heroNr]._y = this.mirrored['heroSwordP' + heroNr]._y; } else { this.mirrored.attachMovie('hero1MegaTeddington', 'heroP' + heroNr, this.mirrored.getNextHighestDepth()); this.mirrored['heroP' + heroNr]._x = xPos; this.mirrored['heroP' + heroNr]._y = yPos; } this.mirrored.setMask(mirrorMask); } function mirrorPlayer(heroNr) { mirrorAttribute(this.mirrored['heroP' + heroNr], _root['heroP' + heroNr], true, false); mirrorAttribute(this.mirrored['heroP' + heroNr].lowerBody, _root['heroP' + heroNr].lowerBody); mirrorAttribute(this.mirrored['heroP' + heroNr].middle, _root['heroP' + heroNr].middle); mirrorAttribute(this.mirrored['heroP' + heroNr].upperBody, _root['heroP' + heroNr].upperBody); mirrorAttribute(this.mirrored['heroP' + heroNr].upperBody.face, _root['heroP' + heroNr].upperBody.face); mirrorAttribute(this.mirrored['heroP' + heroNr].upperBody.hair, _root['heroP' + heroNr].upperBody.hair); if (!_root.megaTeddington || heroNr == 2) { mirrorAttribute(this.mirrored['heroSwordP' + heroNr].innerSword.nunchuck.charge, _root['heroSwordP' + heroNr].innerSword.nunchuck.charge); mirrorAttribute(this.mirrored['heroSwordP' + heroNr].innerSword.nunchuck.swoosh, _root['heroSwordP' + heroNr].innerSword.nunchuck.swoosh); mirrorAttribute(this.mirrored['heroSwordP' + heroNr].innerSword.nunchuck.power, _root['heroSwordP' + heroNr].innerSword.nunchuck.power); mirrorAttribute(this.mirrored['heroSwordP' + heroNr].innerSword.nunchuck, _root['heroSwordP' + heroNr].innerSword.nunchuck); mirrorAttribute(this.mirrored['heroSwordP' + heroNr].innerSword, _root['heroSwordP' + heroNr].innerSword); mirrorAttribute(this.mirrored['heroSwordP' + heroNr], _root['heroSwordP' + heroNr], true, true); this.mirrored['heroSwordP' + heroNr]._visible = this.mirrored['heroP' + heroNr]._visible; } else { mirrored.heroP1.upperBody.laserCannon._rotation = _root.heroP1.upperBody.laserCannon._rotation; } } function mirrorAttribute(mirrorObj, rootObj, mirrorPos, isSword) { mirrorObj._xscale = rootObj._xscale; mirrorObj._yscale = rootObj._yscale; mirrorObj._alpha = rootObj._alpha; mirrorObj._rotation = rootObj._rotation; mirrorObj.gotoAndStop(rootObj._currentframe); if (mirrorPos) { mirrorObj._x = rootObj._x - _x; if (isSword) { mirrorObj._y = _y - rootObj._y + rootObj.yOffset * 2; } else { mirrorObj._y = _y - rootObj._y; } } else { mirrorObj._x = rootObj._x; mirrorObj._y = rootObj._y; } if (!isSword) { if (mirrorObj._y < 0 || !mirrorPos) { mirrorObj._visible = rootObj._visible; } else { mirrorObj._visible = false; } } } this.createEmptyMovieClip('mirrored', this.getNextHighestDepth()); _root.depthSort(this); spawnPlayer(1, 0, 0); if (_root.nrOfPlayers == 2) { spawnPlayer(2, 0, 0); } glass.swapDepths(this.getNextHighestDepth()); onEnterFrame = function () { if (this.hitTest(_root.onScreen)) { mirrorPlayer(1); if (_root.nrOfPlayers == 2) { if (mirrored.heroP2 == undefined) { spawnPlayer(2, 0, 0); } mirrorPlayer(2); mirrored.heroP2.swapDepths(_root.heroP1.getDepth()); mirrored.heroSwordP2.swapDepths(_root.heroSwordP1.getDepth()); mirrored.heroP1.swapDepths(_root.heroP2.getDepth()); mirrored.heroSwordP1.swapDepths(_root.heroSwordP2.getDepth()); } else { if (mirrored.heroP2 != undefined) { mirrored.heroP2.swapDepths(mirrored.getNextHighestDepth()); mirrored.heroP2.removeMovieClip(); mirrored.heroSwordP2.swapDepths(mirrored.getNextHighestDepth()); mirrored.heroSwordP2.removeMovieClip(); } } } }; } } instance of movieClip 1464 { onClipEvent (load) { signalName = 'gaegagddg4554'; teleportXOffset = 0; teleportYOffset = -110; red = 1; green = 0; blue = 0; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'gaegagddg4554'; inverted = false; red = 1; green = 0; blue = 0; } } instance of movieClip 1195 { onClipEvent (load) { gnomeNumber = 9; } } instance of movieClip 1464 { onClipEvent (load) { signalName = 'gaegagddg4554'; teleportXOffset = 0; teleportYOffset = 130; red = 1; green = 0; blue = 0; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'gaegagddg4554'; inverted = false; red = 1; green = 0; blue = 0; _visible = false; } } movieClip 1543 { frame 1 { _root.depthSort(this); } } instance of movieClip 1230 { onClipEvent (load) { restrictZoneName = 'sh3523524'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'sh3523524'; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0; focusPowerY = 0.5; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(0, 88, 0, 0, 0); triggerOnce = true; } } movieClip 1547 { } movieClip 1550 { } movieClip 1552 { } movieClip 1554 { frame 1 { left.startX = left._x; left.startY = left._y; right.startX = right._x; right.startY = right._y; glow._alpha = 0; _root.depthSort(this); onEnterFrame = function () { if (!_root.gamePause) { if (_root.openFinalHeartDoor) { if (!playedSound) { musicLayerVolsArray = new Array(0, 0, 0, 0, 0); _root.setMusicLayerVols(musicLayerVolsArray); _root.playSound('heart_door_open', _x, _y); playedSound = true; } if (right._x < right.startX + 300) { right._y = right.startY - 1 + random(3); right._x += 0.5; left._y = left.startY + random(3); left._x -= 0.5; if (glow._width < 100) { glow._width = right._x - left._x; } if (glow._alpha < 80) { glow._alpha += 1; } if (glow._x - glow._width / 2 < -50) { glow._x = -50 + glow._width / 2; } } } } }; } } instance lastCombatZone of movieClip 1180 { onClipEvent (load) { wave = new Array([[1, 1, 2], [1, 1, 0], [2, 0, 2], [1, 1, 0]], [[2, 1, 0], [2, 1, 2], [3, 1, 0], [3, 1, 2]], [[3, 1, 2], [3, 1, 0], [4, 0, 2], [4, 1, 0]], [[4, 1, 2], [4, 1, 0], [5, 0, 2], [5, 1, 0], [-1, 0, 1]], [[6, 1, 2], [6, 1, 0], [7, 0, 2], [7, 1, 0]]); focusPowerX = 0.95; restrictZoneName = 'ljnsljn4827'; detectHorizontal = true; endMusicLayerVolsArray = new Array(0, 0, 0, 0, 100); triggerOffSetX = 100; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'ljnsljn4827'; } } instance of movieClip 187 egg { onClipEvent (load) { sType = 3; } } instance of movieClip 187 egg { onClipEvent (load) { sType = 2; } } instance of movieClip 187 egg { onClipEvent (load) { sType = 1; } } instance of movieClip 187 egg { onClipEvent (load) { sType = 1; } } instance of movieClip 187 egg { onClipEvent (load) { sType = 3; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0.95; focusPowerY = 0; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(100, 16, 100, 0, 54.9); triggerOnce = true; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 0; _root.endPoint.startY = _root.endPoint._y; _root.endPoint._y -= 300; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (_root.lastCombatZonetrigger == false) { ++timer; } if (timer == 10) { _root.cutscene = true; _root.heroP1.waypointX = _x + 100; _root.heroP1.waypointY = _y; if (_root.nrOfPlayers == 2) { _root.heroP2.waypointX = _x - 100; _root.heroP2.waypointY = _y; } _root.heartDoorOpenCam = true; } if (timer == 20) { _root.openFinalHeartDoor = true; } if (timer == 140) { _root.cutscene = false; _root.endPoint._y = _root.endPoint.startY; _root.heartDoorOpenCam = false; } } } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 1; focusPowerY = 1; signalName = 'heartDoorOpenCam'; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -12; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -12; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'asdaxgrr1'; red = 1; green = 0.3; blue = 0.3; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'asdaxgrr1'; inverted = false; red = 1; green = 0.3; blue = 0.3; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'asdaxgrr2'; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'asdaxgrr2'; inverted = false; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'asdaxgrr3'; red = 0.3; green = 0.3; blue = 1; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'asdaxgrr3'; inverted = false; red = 0.3; green = 0.3; blue = 1; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 40; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 12; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'asdaxgrr2'; inverted = true; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -12; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -12; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 12; } } instance of movieClip 1127 { onClipEvent (load) { this.health = 1; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -12; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -12; } } instance of movieClip 1127 { onClipEvent (load) { this.health = 1; } } instance of movieClip 1127 { onClipEvent (load) { this.health = 1; } } instance of movieClip 1127 { onClipEvent (load) { this.health = 1; } } instance of movieClip 1127 { onClipEvent (load) { this.health = 1; } } instance of movieClip 1127 { onClipEvent (load) { this.health = 1; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -18; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 90; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -8; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 8; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 8; } } instance of movieClip 1506 { onClipEvent (load) { invertMultiplier = 1; hitEffectMultiplier = 1; } } instance of movieClip 1185 { onClipEvent (load) { signalName = 'fj65yye'; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 4; _visible = false; } } instance of movieClip 1147 { onClipEvent (load) { signalName = 'fj65yye'; inverted = false; red = 0.3; green = 1; blue = 0.3; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -8; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -4; _visible = false; } } instance of movieClip 149 camZoom { onClipEvent (load) { zoom = 20; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 50; focusOffsetY = 0; focusPowerX = 0.5; focusPowerY = 0.5; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 5; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 5; } } instance of movieClip 1506 { onClipEvent (load) { invertMultiplier = 1; hitEffectMultiplier = 1; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2.5; _visible = false; } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = 2.5; _visible = false; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(73, 79, 48, 28, 35); triggerOnce = true; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; } onClipEvent (enterFrame) { p = 1; while (p <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + p])) { if (!_root.dontHitMrPinkAchievementFailed) { _root.unlockAchievement(4); } this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } ++p; } } } instance of movieClip 1303 { onClipEvent (load) { conSpeed = -4; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 125; focusOffsetY = -25; focusPowerX = 0.6; focusPowerY = 0.8; } } instance of movieClip 1140 { onClipEvent (load) { musicLayerVolsArray = new Array(73, 77, 0, 0, 26); triggerOnce = true; } } instance endPoint of movieClip 1070 { } frame 51 { if (!musicTrack4) { stopAllSounds(); loadMusicTrack4(); bossMusicTVol = 15; } } frame 51 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'music' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } } frameSetUp = false; _root.saveState(); _root.gotoAndStop(_root._currentframe + 1); } frame 52 { if (!_root.megaTeddington) { com.newgrounds.API.logCustomEvent('Game_Final_boss'); } else { com.newgrounds.API.logCustomEvent('Ted_Game_Final_boss'); } } frame 52 { setUpFrame(); } movieClip 1557 { } instance spotlightTop of movieClip 1557 { onClipEvent (load) { _root.depthSortCustomY(this, _root.sizeOfArea._y + _root.sizeOfArea._height); } } movieClip 1559 { } instance spotlightBottom of movieClip 1559 { onClipEvent (load) { _root.depthSortCustomY(this, _root.sizeOfArea._y - 5 - _y / 100); } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = -600; teleportYOffset = 0; red = 1; green = 0; blue = 0; } } instance of movieClip 1464 { onClipEvent (load) { teleportXOffset = 600; teleportYOffset = 0; red = 1; green = 0; blue = 0; } } movieClip 1563 { frame 1 { _root.depthSort(this); } } movieClip 1565 { frame 1 { _root.depthSortCustomY(this, _y - 200); } } instance startPoint of movieClip 1048 { } instance of movieClip 187 egg { onClipEvent (load) { finalBoss = true; restrictZoneName = 'eggEnemiesRZ'; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'rghsh5656565'; } } instance chigeon of movieClip 1064 { onClipEvent (load) { if (_root.megaTeddington) { restrictZoneName = 'rghsh5656565_2'; } else { restrictZoneName = 'rghsh5656565'; } this.body.teddy.gotoAndStop(2); cutsceneMode = true; } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = -400; focusPowerX = 0.8; focusPowerY = 0.2; signalName = 'playCam'; } } instance endOfLevelTrigger of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; _root.cutscene = true; p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _root['waypoint1P' + p]._x; _root['heroP' + p].waypointY = _root['waypoint1P' + p]._y; ++p; } timer = 0; pauseTimer = false; _root.playCam = true; if (_root.megaTeddington) { _root.spotlightTop.swapDepths(_root.getNextHighestDepth()); _root.spotlightTop.removeMovieClip(); _root.spotlightBottom.swapDepths(_root.getNextHighestDepth()); _root.spotlightBottom.removeMovieClip(); } } onClipEvent (enterFrame) { if (!_root.gamePause) { if (_root.speechBubble == undefined && !pauseTimer) { ++timer; } if (!_root.megaTeddington) { if (timer == 90) { _root.playSound('spotlight_2'); _root.spotlightTop.blackout1._alpha = 0; } if (timer == 100) { _root.playCam = false; _root.bedCam = true; } if (timer == 185) { _root.playSound('spotlight_3'); _root.spotlightTop.blackout2._alpha = 0; } if (timer == 195) { _root.bedCam = false; _root.playCam = true; } if (timer == 210) { _root.addSpeechBubble(_root.heroP1._x, _root.heroP1._y - 120, 'What... What\'s going on here?', true, 100, undefined, 5); ++timer; } if (timer == 212) { _root.addSpeechBubble(_root.chigeon._x + 40, _root.chigeon._y - 80, 'Charlie...', true, -100, undefined, 7); ++timer; } if (timer == 214) { _root.addSpeechBubble(_root.heroP1._x, _root.heroP1._y - 120, 'Mr.Teddington! You can TALK?!', true, 100, undefined, 5); ++timer; } if (timer == 216) { _root.addSpeechBubble(_root.chigeon._x + 40, _root.chigeon._y - 80, 'Just because I can talk doesn\'t mean you\'ll ever listen!|Charlie, I\'m leaving you for Queen Chigeon!', true, -100, undefined, 7); ++timer; } if (timer == 218) { _root.addSpeechBubble(_root.heroP1._x, _root.heroP1._y - 120, 'But... Queen Chigeon kidnapped you!', true, 100, undefined, 5); ++timer; } if (timer == 220) { _root.addSpeechBubble(_root.chigeon._x + 40, _root.chigeon._y - 80, 'She never kidnapped me. She rescued me!|I\'ve been writing letters to Queen Chigeon for the past 6 months.|We finally decided we couldn\'t be apart any longer!', true, -100, undefined, 7); ++timer; } if (timer == 222) { _root.addSpeechBubble(_root.heroP1._x, _root.heroP1._y - 120, 'This... This is terrible...', true, 100, undefined, 5); ++timer; } if (timer == 224) { _root.addSpeechBubble(_root.chigeon._x + 40, _root.chigeon._y - 80, 'Oh come on! It\'s not like you couldn\'t see this coming!|You could never give me what Queen Chigeon have!', true, -100, undefined, 7); ++timer; } if (timer == 226) { _root.addSpeechBubble(_root.chigeon._x, _root.chigeon._y - 120, 'Ho ho ho!|That\'s right! I have a whole Queendom!|A Queendom you have caused quite a bit of damage to.|For that you shall pay!', true, -100, undefined, 4); ++timer; } if (timer == 228) { _root.addSpeechBubble(_root.heroP1._x, _root.heroP1._y - 120, 'Bring it on!', true, 100, undefined, 5); ++timer; } if (timer == 230) { _root.spotlightBottom.swapDepths(_root.getNextHighestDepth()); _root.spotlightBottom.removeMovieClip(); _root.spotlightTop.onEnterFrame = function () { this._alpha -= 5; if (this._alpha <= 0) { _root.bossMusicTVol = 100; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } }; } if (timer == 260) { _root.chigeon.cutsceneMode = false; _root.cutscene = false; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } else { if (timer == 90) { _root.addSpeechBubble(_root.heroP1._x, _root.heroP1._y - 120, 'Alright Queen Chigeon. You\'ve had your fun.|Now, let Charlie go and we can all just forget about this.', true, 100, undefined, 7); ++timer; } if (timer == 92) { _root.addSpeechBubble(_root.chigeon._x, _root.chigeon._y - 120, 'Ha!|Forget about this?|You have betrayed me!|Do you know who I am?|Nobody turns their back to me!|Now prepare to pay for your treason!', true, -100, undefined, 4); ++timer; } if (timer == 94) { _root.addSpeechBubble(_root.heroP1._x, _root.heroP1._y - 120, 'Whatever...', true, 100, undefined, 7); ++timer; } if (timer == 96) { _root.chigeon.cutsceneMode = false; _root.cutscene = false; _root.bossMusicTVol = 100; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } } instance of movieClip 147 camFocus { onClipEvent (load) { focusOffsetX = 0; focusOffsetY = 0; focusPowerX = 0.8; focusPowerY = 1; signalName = 'bedCam'; } } instance of movieClip 159 checkpoint { onClipEvent (load) { _visible = false; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'eggEnemiesRZ'; } } instance of movieClip 187 egg { onClipEvent (load) { finalBoss = true; restrictZoneName = 'eggEnemiesRZ'; } } instance of movieClip 187 egg { onClipEvent (load) { finalBoss = true; restrictZoneName = 'eggEnemiesRZ'; } } instance teddySequence of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; timer = 0; timer2 = 0; pauseTimer = true; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (_root.speechBubble == undefined && !pauseTimer) { ++timer; } if (!_root.megaTeddington) { if (timer == 40) { _root.bossMusicTVol = 0; _root.addSpeechBubble(_root.teddington._x, _root.teddington._y - 100, 'Charlie!|You defeated Queen Chigeon!|...|Maybe you do love me after all...', true, -100, undefined, 7); ++timer; } if (timer == 42) { _root.addSpeechBubble(_root.teddington._x, _root.teddington._y - 100, 'Oh, Charlie. Could you ever forgive me?', false, -100, undefined, 7); _root.no._visible = true; _root.yes._visible = _root.no._visible; _root.showUiTip('Do you forgive Mr.Teddington? Walk to either Yes or No to answer.', undefined); _root.answerYes._y = _root.answerYes.startY; _root.answerNo._y = _root.answerNo.startY; ++timer; } if (timer == 43) { ++timer2; if (timer2 == 30) { _root.cutscene = false; pauseTimer = true; ++timer; } } if (timer == 44) { if (_root.YESANSWER) { com.newgrounds.API.logCustomEvent('Game_Final_Forgive'); _root.unlockAchievement(12); p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _root['heroP' + p]._x; _root['heroP' + p].waypointY = _root['heroP' + p]._y; ++p; } _root.hideUiTip(); _root.no.remove = true; _root.yes.remove = _root.no.remove; _root.cutscene = true; _root.addSpeechBubble(_root.heroP1._x + 10, _root.heroP1._y - 120, 'Ofcouse I forgive you.|Come on, let\'s go home.|We could order take-away...', true, 0, undefined, 5); pauseTimer = false; ++timer; } else { if (_root.NOANSWER) { com.newgrounds.API.logCustomEvent('Game_Final_No_Forgive'); p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _root['heroP' + p]._x; _root['heroP' + p].waypointY = _root['heroP' + p]._y; ++p; } _root.hideUiTip(); _root.no.remove = true; _root.yes.remove = _root.no.remove; _root.cutscene = true; _root.addSpeechBubble(_root.heroP1._x + 10, _root.heroP1._y - 120, 'No.|I\'m better of without you!|Have a nice life, Mr.Teddington.', true, 0, undefined, 5); pauseTimer = false; ++timer; } } } if (timer == 46) { if (_root.NOANSWER) { p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p].waypointX = _root['waypoint1P' + p]._x + -300; _root['heroP' + p].waypointY = _root['waypoint1P' + p]._y; ++p; } if (_root.hud.blackFade._alpha >= 30) { _root.bossMusicTVol = 80; _root.slowFade = false; _root.hideUiTip(); _root.hud.attachMovie('endCredits', 'endCredits', _root.hud.getNextHighestDepth()); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } else { if (_root.YESANSWER) { if (_root.hud.blackFade._alpha >= 100) { _root.slowFade = false; _root.gotoAndStop(60); _root.hideUiTip(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } _root.unlockAchievement(9); pauseTimer = true; _root.slowFade = true; _root.hud.blackFade.fadeTarget = 120; } } else { if (timer == 40) { _root.addSpeechBubble(_root.teddington._x, _root.teddington._y - 100, 'Mmmphfglufpf!', true, -100, undefined, 5); ++timer; } if (timer == 42) { _root.addSpeechBubble(_root.heroP1._x + 10, _root.heroP1._y - 120, 'Oh, don\'t mention it...', true, 0, undefined, 7); ++timer; } if (timer == 44) { _root.addSpeechBubble(_root.teddington._x, _root.teddington._y - 100, 'Gflmuphf mfgluphfgh....', true, -100, undefined, 5); ++timer; } if (timer == 46) { _root.addSpeechBubble(_root.heroP1._x + 10, _root.heroP1._y - 120, 'I know...|And I\'m truly sorry.|We make a good team, you and me.|From now on, nothing will keep us apart!', true, 0, undefined, 7); ++timer; } if (timer == 48) { _root.addSpeechBubble(_root.teddington._x, _root.teddington._y - 100, 'Mmmm-mphf!', true, -100, undefined, 5); ++timer; } if (timer == 50) { _root.bossMusicTVol = 80; pauseTimer = true; _root.slowFade = true; _root.hud.blackFade.fadeTarget = 120; _root.hud.attachMovie('endCredits', 'endCredits', _root.hud.getNextHighestDepth()); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } } instance answerYes of movieClip 1050 { onClipEvent (load) { signalName = 'YESANSWER'; startY = _y; _y = _y + 2000; } } instance answerNo of movieClip 1050 { onClipEvent (load) { signalName = 'NOANSWER'; startY = _y; _y = _y + 2000; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'rghsh5656565_2'; } } frame 60 { if (!musicTrack1) { loadMusicTrack1(); } } frame 60 { for (cObject in _root) { if (typeof _root[cObject] == 'movieclip') { if (_root[cObject]._name != 'sfx' && _root[cObject]._name != 'hud' && _root[cObject]._name != 'onScreen' && _root[cObject]._name != 'gameCamera') { _root[cObject].swapDepths(_root.getNextHighestDepth()); _root[cObject].removeMovieClip(); } } else { if (typeof _root[cObject] != 'function' && typeof _root[cObject] != 'object') { if (cObject != 'hero2scoreContinuesGiven' && cObject != 'hero2displayScore' && cObject != 'hero2score' && cObject != 'hero1scoreContinuesGiven' && cObject != 'hero1displayScore' && cObject != 'hero1score' && cObject != 'sfxVolume' && cObject != 'musicVolume' && cObject != 'nrOfPlayers' && cObject != 'syncTracks') { delete _root[cObject]; } } } } stopAllSounds(); frameSetUp = false; _root.saveState(); _root.gotoAndStop(_root._currentframe + 1); } frame 61 { } frame 61 { setUpFrame(); spawnRandomMonsters = false; } movieClip 1578 { frame 1 { stop(); } instance duvetTop of movieClip 1031 { onClipEvent (load) { targetX = _x; } onClipEvent (enterFrame) { if (!_root.gamePause) { _x = _x + (targetX - _x) * 0.1; } } } instance peeper of movieClip 1021 { onClipEvent (load) { _alpha = 0; alphaTarget = 0; } onClipEvent (enterFrame) { if (!_root.gamePause) { _alpha = _alpha + (alphaTarget - _alpha) * 0.1; } } } } instance introTimer of movieClip 1050 { onClipEvent (load) { _root.cutscene = true; customOnEnterFrame = true; _root.heroP1.waypointX = _root.startPoint._x; _root.heroP1.waypointY = _root.startPoint._y; _root.heroP2.waypointX = _root.startPoint._x; _root.heroP2.waypointY = _root.startPoint._y; timer = 0; pauseTimer = false; collisionName = 'wall' + _root.nrOfWalls; _root.attachMovie('wall_collision', collisionName, _root.getNextHighestDepth()); ++_root.nrOfWalls; _root[collisionName].squishable = false; _root[collisionName]._width = _root.spawnWallHere._width; _root[collisionName]._height = _root.spawnWallHere._height; _root[collisionName]._x = _root.spawnWallHere._x; _root[collisionName]._y = _root.spawnWallHere._y; _root[collisionName].extraThicknessY = 0; _root[collisionName].extraThicknessX = 0; _root.hud.overheadDisplay._y = _root.hud.overheadDisplay.startY - 200; _root.hud.overheadDisplay._visible = false; _root.slowFade = true; _root.fadeTarget = 120; _root.hud.blackFade._alpha = 120; _root.hud.blackFade.gotoAndStop(1); _root.cameraFocusX = 400; _root.cameraFocusY = 800; _root.cameraFocusPowerX = 1; _root.cameraFocusPowerY = 1; _root.cameraOvershootX = 0; _root.cameraOvershootY = 0; _root.gameCamera._x = _root.cameraFocusX; _root.gameCamera._y = _root.cameraFocusY; } onClipEvent (enterFrame) { if (!_root.gamePause) { if (timer < 593) { p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p]._visible = false; _root['heroSwordP' + p]._visible = false; _root['heroShadowP' + p]._visible = false; ++p; } } if (_root.speechBubble == undefined && !pauseTimer) { ++timer; } if (timer < 5) { _root.fadeTarget = 120; _root.hud.blackFade._alpha = 120; _root.cameraFocusX = 400; _root.cameraFocusY = 800; _root.cameraFocusPowerX = 1; _root.cameraFocusPowerY = 1; _root.cameraOvershootX = 0; _root.cameraOvershootY = 0; _root.gameCamera._x = _root.cameraFocusX; _root.gameCamera._y = _root.cameraFocusY; } if (timer == 5) { pauseTimer = true; _root.cameraFocusY += (240 - _root.cameraFocusY) * 0.05; _root.fadeTarget = -20; if (_root.cameraFocusY < 243) { _root.slowFade = false; timer = 385; pauseTimer = false; } } if (timer == 390) { _root.addSpeechBubble(320, 260, 'Phew, I\'m sure glad that\'s over with!|Everything is back to normal...|Well... Sweet dreams then, Mr.Teddington.', true, 0, undefined, 5); ++timer; } if (timer == 392) { _root.playSound('kiss'); _root.attachMovie('heart', 'introHeart', _root.getNextHighestDepth()); _root.introHeart._x = 320; _root.introHeart._y = 300; _root.introHeart._yscale = 0; _root.introHeart._xscale = 0; _root.introHeart.onEnterFrame = function () { if (!_root.gamePause) { this._yscale += (100 - this._xscale) * 0.4; this._xscale = this._yscale; this._y -= 1.5; this._alpha -= 1; if (this._alpha <= 0) { this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } }; } if (timer == 430) { _root.introBackground.duvetTop.targetX -= 20; } if (timer == 475) { _root.introBackground.peeper.alphaTarget = 100; } if (timer == 510) { _root.hud.blackFade.fadeTarget = 120; } if (timer == 545) { _root.chigeon._visible = true; _root.chigeon.targetY += 50; _root.hud.blackFade.gotoAndStop(2); _root.introBackground.gotoAndStop(2); } if (timer == 547) { _root.clock.broken = true; _root.playSound('intro_wall_break'); _root.chigeon.body.teddy.gotoAndStop(3); _root.addSmoke(540, 290); _root.addSmoke(440, 270); _root.addSmoke(640, 270); _root.addStar(540, 190, 300); _root.cameraShakeTimer = 60; _root.hud.blackFade._alpha = 0; _root.hud.blackFade.fadeTarget = -20; } if (timer == 570) { _root.addSpeechBubble(320, 260, 'What the..?|... Again??', true, 0, undefined, 7); ++timer; } if (timer == 572) { _root.addSpeechBubble(500, 200, 'Ho ho ho!|You thought you could get rid of me THAT easily, huh?|Well, think again!|I will have my revenge on you, Charlie!', true, -200, undefined, 4); ++timer; } if (timer == 574) { _root.chigeon.targetY -= 500; _root.topBitCover._visible = true; } if (timer > 590 && _root.chigeon != undefined) { _root.chigeon._alpha -= 5; if (_root.chigeon._alpha <= 0) { _root.chigeon.swapDepths(_root.getNextHighestDepth()); _root.chigeon.removeMovieClip(); } } if (timer == 591) { _root.addSpeechBubble(320, 260, 'Weird...|I suppose there is only one thing I can do...', true, 0, undefined, 7); ++timer; } if (timer == 593) { _root.despawnPlayer(1); _root.megaTeddington = true; } if (timer == 595) { pauseTimer = true; if (_root.heroP1 != undefined) { _root.hud.overheadDisplay.iconP1.gotoAndStop(4); _root.heroP1.waypointX = _root.startPoint._x; _root.heroP1.waypointY = _root.startPoint._y; _root.heroP2.waypointX = _root.startPoint._x; _root.heroP2.waypointY = _root.startPoint._y; _root.introBackground.teddingtonOnBed._visible = false; p = 1; while (p <= _root.nrOfPlayers) { _root['heroP' + p]._visible = true; _root['heroSwordP' + p]._visible = true; _root['heroShadowP' + p]._visible = true; ++p; } pauseTimer = false; ++timer; } } if (timer == 662) { _root[collisionName].activated = false; _root.cutscene = false; _root.showUiTip('Exit through the light to enter The Wishing Well of Forbidden Wishes... Again', undefined); ++timer; } if (timer == 690) { _root.attachMovie('pTeddingtonControlHint', 'pTeddingtonControlHint', _root.getNextHighestDepth()); _root.pTeddingtonControlHint._x = _root.heroP1._x; _root.pTeddingtonControlHint._y = _root.heroP1._y - 130; this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } } } } instance chigeon of movieClip 1064 { onClipEvent (load) { restrictZoneName = 'agarg454'; cutsceneMode = true; lookAtX = 300; lookAtY = 500; _visible = false; } } instance of movieClip 1066 { onClipEvent (load) { restrictZoneName = 'agarg454'; } } instance topBitCover of movieClip 1068 { onClipEvent (load) { _visible = false; _root.depthSortCustomY(this, 350); } } instance endPoint of movieClip 1070 { onClipEvent (load) { gotoFrame = 17; fadeToWhite = true; fadeOutMusic = false; activated = true; } } instance of movieClip 1050 { onClipEvent (load) { customOnEnterFrame = true; } onClipEvent (enterFrame) { i = 1; while (i <= _root.nrOfPlayers) { if (this.hitTest(_root['heroHitboxP' + i])) { _root.hideUiTip(); _root.savedData.data.megaTeddington = true; _root.savedData.data.allowMegaTeddington = true; _root.savedData.flush(); this.swapDepths(_root.getNextHighestDepth()); this.removeMovieClip(); } ++i; } } } instance startPoint of movieClip 1048 { }




http://swfchan.com/42/207496/info.shtml
Created: 23/7 -2019 07:09:29 Last modified: 23/7 -2019 07:09:29 Server time: 18/04 -2024 06:05:38