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

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

dRive.swf

This is the info page for
Flash #51506

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


Text
dRive

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

game by axcho

music by SineRider

visit Twig Games at
www.twiggames.com

dRive

about

new game

continue game

scores

loading scores...

back to menu

design, graphics, and programming by
Alex Cho Snyder (axcho)
original music and sound effects by
Devin Powers (SineRider)
special thanks to
Donald Brinkman
Ruth Fruland
Erik Swanson
Peter Oppenheimer

evolutionlive.blogspot.com

sinerider.newgrounds.com

dRive is an experimental game
integrating the mind-splitting intensity
of simultaneous derivative motion and
the syncopated flow of glitch music.
Simple at first, you collect powerups to
upgrade your ship with higher
derivatives of motion, increasing both
payoff and challenge.

a creation of
Twig Games

www.twiggames.com

dRive is a game about derivatives. When we at Twig Games first came up with this design,
we were going for a game that would help you get an intuitive feel for derivatives, the
relationship between position, velocity, and acceleration. While dRive may not make you
ace your next intro physics course, we hope that it will provide you with a new perspective
on what the numbers actually mean. This is our first game and we hope that you will be
seeing more from us in the future!
dRive is also a game about glitch music. I have long been interested in integrating music
dynamically with gameplay, and dRive is an experimental step in that direction. If this one
goes over well, I would like to make a bigger version of dRive with even more music.
Working with SineRider has been a great experience, and I would love to get more
composers on board for the next version. If you are interested, please send me a PM on
Newgrounds.
- axcho (Twig Games)

ActionScript [AS1/AS2]

Frame 1
_accProps = new Object(); _accProps.name = "dRive"; _accProps.description = "dRive is an experimental game integrating the mind-splitting intensity of simultaneous derivative motion and the syncopated flow of glitch music. Simple at first, you collect powerups to upgrade your ship with higher derivatives of motion, increasing both payoff and challenge."; this._quality = "low"; var emptyMenu = new ContextMenu(); emptyMenu.hideBuiltInItems(); this.menu = emptyMenu; MochiAd.showPreGameAd({id:"ea9e4135bc2ffd68", res:"500x500", background:11789721, color:13434777, outline:10079359, no_bg:true});
Frame 2
var finish = this.getBytesTotal(); this.onEnterFrame = function () { with (this) { var bytes = getBytesLoaded(); var percent = int((100 * bytes) / finish); with (this) { clear(); lineStyle(0, 16777215); moveTo(250, 500); lineTo(250, 500 - (5 * percent)); } if (bytes >= finish) { this.clear(); this.onEnterFrame = null; play(); } } };
Frame 9
function __com_mochibot__(swfid, mc, lv, trk) { var x; var g; var s; var fv; var sb; var u; var res; var mb; var mbc; mb = "__mochibot__"; mbc = "mochibot.com"; g = (_global ? (_global) : (_level0._root)); if (g[mb + swfid]) { return(g[mb + swfid]); } s = System.security; x = mc._root.getSWFVersion; fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5))); if (!s) { s = {}; } sb = s.sandboxType; if (sb == "localWithFile") { return(null); } x = s.allowDomain; if (x) { s.allowDomain(mbc); } x = s.allowInsecureDomain; if (x) { s.allowInsecureDomain(mbc); } u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : ""); lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv)))); g[mb + "level"] = lv; if (fv == 5) { res = "_level" + lv; if (!eval (res)) { loadMovieNum (u, lv); } } else { res = mc.createEmptyMovieClip(mb + swfid, lv); res.loadMovie(u); } return(res); } mochi.MochiServices.connect("ea9e4135bc2ffd68"); __com_mochibot__("1f694e59", this, 10301, true); var g = new dRiveGraphics(); var game = new dRiveGame(this); game.initialize(g); game.pauseGame(); var blinkThis = function () { game.blink(this, 1, 7); }; var blink_id; var startBlink = function () { clearInterval(blink_id); blink_id = setInterval(blinkJIG, (30 * random(100)) + 300); }; var stopBlink = function () { clearInterval(blink_id); }; var blinkJIG = function () { game.blink(jig_btn.button_mc, 1, (2 * random(3)) + 1); startBlink(); };
Frame 16
stop(); game.blink(new_btn, 1, 3); startBlink(); if (game.going) { continue_btn.onRollOver = blinkThis; continue_btn.onRelease = function () { stopBlink(); gotoAndStop ("game"); }; } else { continue_btn._alpha = 50; } new_btn.onRollOver = blinkThis; new_btn.onRelease = function () { stopBlink(); game.going = false; gotoAndStop ("game"); }; about_btn.onRollOver = blinkThis; about_btn.onRelease = function () { stopBlink(); gotoAndStop ("credits"); }; scores_btn.onRollOver = blinkThis; scores_btn.onRelease = function () { stopBlink(); mochi.MochiScores.showLeaderboard({boardID:"c26c1f9e50c76ba8"}); }; jig_btn.button_mc.onRollOver = function () { jig_btn._alpha = 100; game.blink(jig_btn.button_mc, 1, 7); stopBlink(); }; jig_btn.button_mc.onRollOut = function () { jig_btn._alpha = 10; startBlink(); }; axcho_btn.onRollOver = blinkThis; axcho_btn.onRelease = function () { getURL ("http://evolutionlive.blogspot.com/"); }; rider_btn.onRollOver = blinkThis; rider_btn.onRelease = function () { getURL ("http://sinerider.newgrounds.com/"); }; twig_btn.onRollOver = blinkThis; twig_btn.onRelease = function () { getURL ("http://www.twiggames.com/"); };
Frame 17
gotoAndPlay ("menu");
Frame 22
stop(); if (game.going) { game.resumeGame(); } else { game.newGame(g); }
Frame 23
if (game.going) { gotoAndPlay ("menu"); } else if (game.score > 0) { var playerscore = game.score; mochi.MochiScores.showLeaderboard({boardID:"c26c1f9e50c76ba8", score:playerscore}); } else { gotoAndPlay ("menu"); } back_btn.onRollOver = blinkThis; back_btn.onRelease = function () { gotoAndStop ("menu"); };
Frame 24
gotoAndPlay ("menu");
Frame 28
stop(); axcho_btn.onRollOver = blinkThis; axcho_btn.onRelease = function () { getURL ("http://evolutionlive.blogspot.com/"); }; rider_btn.onRollOver = blinkThis; rider_btn.onRelease = function () { getURL ("http://sinerider.newgrounds.com/"); }; twig_btn.onRollOver = blinkThis; twig_btn.onRelease = function () { getURL ("http://www.twiggames.com/"); }; back_btn.onRollOver = blinkThis; back_btn.onRelease = function () { gotoAndStop ("menu"); }; egg_btn._focusrect = false; egg_btn.useHandCursor = false; egg_btn.onRelease = function () { g.B1 = 16777164 /* 0xFFFFCC */; g.B2 = 13421721 /* 0xCCCC99 */; g.B3 = 16777113 /* 0xFFFF99 */; g.B4 = 13382400 /* 0xCC3300 */; g.E1 = 13421721 /* 0xCCCC99 */; g.E2 = 16777164 /* 0xFFFFCC */; g.E3 = 6697728 /* 0x663300 */; g.E4 = 16724736 /* 0xFF3300 */; g.S1 = 16764006 /* 0xFFCC66 */; g.S2 = 15053619 /* 0xE5B333 */; g.S3 = 13408563 /* 0xCC9933 */; g.SG = 13941649 /* 0xD4BB91 */; g.T1 = 0; g.T2 = 16777215 /* 0xFFFFFF */; g.T3 = 10053120 /* 0x996600 */; };
Frame 34
gotoAndPlay ("menu");
Symbol 4 MovieClip [button1_mc] Frame 1
function answer() { answered = true; } function noResponse() { if (!answered) { getURL ("http://jayisgames.com/cgdc5/?ref=beb6655d"); } } if (flash.external.ExternalInterface.available) { flash.external.ExternalInterface.addCallback("answer", this, answer); } var answered = false; button_mc.onRelease = function () { if (flash.external.ExternalInterface.available) { flash.external.ExternalInterface.call("cgdc5close"); } setTimeout(noResponse, 500); }; function __com_mochibot__(swfid, mc, lv, trk) { var x; var g; var s; var fv; var sb; var u; var res; var mb; var mbc; mb = "__mochibot__"; mbc = "mochibot.com"; g = (_global ? (_global) : (_level0._root)); if (g[mb + swfid]) { return(g[mb + swfid]); } s = System.security; x = mc._root.getSWFVersion; fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5))); if (!s) { s = {}; } sb = s.sandboxType; if (sb == "localWithFile") { return(null); } x = s.allowDomain; if (x) { s.allowDomain(mbc); } x = s.allowInsecureDomain; if (x) { s.allowInsecureDomain(mbc); } u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : ""); lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv)))); g[mb + "level"] = lv; if (fv == 5) { res = "_level" + lv; if (!eval (res)) { loadMovieNum (u, lv); } } else { res = mc.createEmptyMovieClip(mb + swfid, lv); res.loadMovie(u); } return(res); } __com_mochibot__("beb6655d", this, 10301, true);
Symbol 55 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd { function MochiAd () { } static function getVersion() { return("2.2"); } static function showPreGameAd(options) { var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () { this.clip.stop(); }, ad_finished:function () { this.clip.play(); }}; options = _parseOptions(options, _local27); var clip = options.clip; var _local23 = 11000; var _local26 = options.ad_timeout; delete options.ad_timeout; var fadeout_time = options.fadeout_time; delete options.fadeout_time; if (!load(options)) { options.ad_finished(); return(undefined); } options.ad_started(); var mc = clip._mochiad; mc.onUnload = function () { options.ad_finished(); }; var _local14 = _getRes(options); var _local4 = _local14[0]; var _local13 = _local14[1]; mc._x = _local4 * 0.5; mc._y = _local13 * 0.5; var chk = mc.createEmptyMovieClip("_mochiad_wait", 3); chk._x = _local4 * -0.5; chk._y = _local13 * -0.5; var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4); _local7._x = 10; _local7._y = _local13 - 20; var _local22 = options.color; delete options.color; var _local19 = options.background; delete options.background; var _local24 = options.outline; delete options.outline; var _local5 = _local7.createEmptyMovieClip("_outline", 1); _local5.beginFill(_local19); _local5.moveTo(0, 0); _local5.lineTo(_local4 - 20, 0); _local5.lineTo(_local4 - 20, 10); _local5.lineTo(0, 10); _local5.lineTo(0, 0); _local5.endFill(); var _local3 = _local7.createEmptyMovieClip("_inside", 2); _local3.beginFill(_local22); _local3.moveTo(0, 0); _local3.lineTo(_local4 - 20, 0); _local3.lineTo(_local4 - 20, 10); _local3.lineTo(0, 10); _local3.lineTo(0, 0); _local3.endFill(); _local3._xscale = 0; var _local6 = _local7.createEmptyMovieClip("_outline", 3); _local6.lineStyle(0, _local24, 100); _local6.moveTo(0, 0); _local6.lineTo(_local4 - 20, 0); _local6.lineTo(_local4 - 20, 10); _local6.lineTo(0, 10); _local6.lineTo(0, 0); chk.ad_msec = _local23; chk.ad_timeout = _local26; chk.started = getTimer(); chk.showing = false; chk.last_pcnt = 0; chk.fadeout_time = fadeout_time; chk.fadeFunction = function () { var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)); if (_local2 > 0) { this._parent._alpha = _local2; } else { var _local3 = this._parent._parent; MochiAd.unload(_local3); delete this.onEnterFrame; } }; mc.lc.adLoaded = function (width, height) { }; mc.lc.adjustProgress = function (msec) { var _local2 = this.mc._mochiad_wait; _local2.server_control = true; _local2.started = getTimer(); _local2.ad_msec = msec; }; chk.onEnterFrame = function () { var _local6 = this._parent._parent; var _local12 = this._parent._mochiad_ctr; var _local5 = getTimer() - this.started; var _local3 = false; var _local4 = _local6.getBytesTotal(); var _local8 = _local6.getBytesLoaded(); var _local10 = (100 * _local8) / _local4; var _local11 = (100 * _local5) / chk.ad_msec; var _local9 = this._mochiad_bar._inside; var _local2 = Math.min(100, Math.min(_local10 || 0, _local11)); _local2 = Math.max(this.last_pcnt, _local2); this.last_pcnt = _local2; _local9._xscale = _local2; if (!chk.showing) { var _local7 = _local12.getBytesTotal(); if ((_local7 > 0) || (typeof(_local7) == "undefined")) { chk.showing = true; chk.started = getTimer(); } else if (_local5 > chk.ad_timeout) { _local3 = true; } } if (_local5 > chk.ad_msec) { _local3 = true; } if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) { if (this.server_control) { delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = chk.fadeFunction; } } }; } static function showInterLevelAd(options) { var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () { this.clip.stop(); }, ad_finished:function () { this.clip.play(); }}; options = _parseOptions(options, _local13); var clip = options.clip; var _local10 = 11000; var _local12 = options.ad_timeout; delete options.ad_timeout; var fadeout_time = options.fadeout_time; delete options.fadeout_time; if (!load(options)) { options.ad_finished(); return(undefined); } options.ad_started(); var mc = clip._mochiad; mc.onUnload = function () { options.ad_finished(); }; var _local5 = _getRes(options); var _local14 = _local5[0]; var _local11 = _local5[1]; mc._x = _local14 * 0.5; mc._y = _local11 * 0.5; var chk = mc.createEmptyMovieClip("_mochiad_wait", 3); chk.ad_msec = _local10; chk.ad_timeout = _local12; chk.started = getTimer(); chk.showing = false; chk.fadeout_time = fadeout_time; chk.fadeFunction = function () { var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time)); if (_local2 > 0) { this._parent._alpha = _local2; } else { var _local3 = this._parent._parent; MochiAd.unload(_local3); delete this.onEnterFrame; } }; mc.lc.adLoaded = function (width, height) { }; mc.lc.adjustProgress = function (msec) { var _local2 = this.mc._mochiad_wait; _local2.server_control = true; _local2.started = getTimer(); _local2.ad_msec = msec - 250; }; chk.onEnterFrame = function () { var _local5 = this._parent._mochiad_ctr; var _local4 = getTimer() - this.started; var _local2 = false; if (!chk.showing) { var _local3 = _local5.getBytesTotal(); if ((_local3 > 0) || (typeof(_local3) == "undefined")) { chk.showing = true; chk.started = getTimer(); } else if (_local4 > chk.ad_timeout) { _local2 = true; } } if (_local4 > chk.ad_msec) { _local2 = true; } if (_local2) { if (this.server_control) { delete this.onEnterFrame; } else { this.fadeout_start = getTimer(); this.onEnterFrame = this.fadeFunction; } } }; } static function showTimedAd(options) { showInterLevelAd(options); } static function showPreloaderAd(options) { showPreGameAd(options); } static function _allowDomains(server) { var _local1 = server.split("/")[2].split(":")[0]; if (System.security) { if (System.security.allowDomain) { System.security.allowDomain("*"); System.security.allowDomain(_local1); } if (System.security.allowInsecureDomain) { System.security.allowInsecureDomain("*"); System.security.allowInsecureDomain(_local1); } } return(_local1); } static function _loadCommunicator(options) { var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"}; options = _parseOptions(options, _local26); options.swfv = options.clip.getSWFVersion() || 6; options.mav = getVersion(); var _local18 = options.clip; var _local20 = "_mochiad_com_" + options.id; if (!_isNetworkAvailable()) { return(null); } if (_local18[_local20]) { return(_local18[_local20].lc); } var _local21 = options.com_server + options.id; _allowDomains(_local21); delete options.id; delete options.com_server; var _local25 = options.depth; delete options.depth; var _local17 = _local18.createEmptyMovieClip(_local20, _local25); var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1); for (var _local15 in options) { _local11[_local15] = options[_local15]; } var _local6 = new LocalConnection(); var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_"); _local6.mc = _local17; _local6.name = _local16; _local6.allowDomain = function (d) { return(true); }; _local6.allowInsecureDomain = _local6.allowDomain; _local6.connect(_local16); _local17.lc = _local6; _local11.lc = _local16; _local6._id = 0; _local6._queue = []; _local6.rpcResult = function (cb_arg) { var _local8 = parseInt(cb_arg); var _local4 = this._callbacks[_local8]; if (!_local4) { return(undefined); } delete this._callbacks[_local8]; var _local5 = []; var _local3 = 2; while (_local3 < _local4.length) { _local5.push(_local4[_local3]); _local3++; } _local3 = 1; while (_local3 < arguments.length) { _local5.push(arguments[_local3]); _local3++; } var _local6 = _local4[1]; var _local7 = _local4[0]; if (_local7 && (typeof(_local6) == "string")) { _local6 = _local7[_local6]; } if (_local6) { _local6.apply(_local7, _local5); } }; _local6._didConnect = function (endpoint) { this._endpoint = endpoint; var _local4 = this._queue; delete this._queue; var _local5 = this.doSend; var _local2 = 0; while (_local2 < _local4.length) { var _local3 = _local4[_local2]; _local5.apply(this, _local3); _local2++; } }; _local6.doSend = function (args, cbobj, cbfn) { if (this._endpoint == null) { var _local4 = []; var _local3 = 0; while (_local3 < arguments.length) { _local4.push(arguments[_local3]); _local3++; } this._queue.push(_local4); return(undefined); } this._id = this._id + 1; var _local5 = this._id; if ((cbfn === undefined) || (cbfn === null)) { cbfn = cbobj; } this._callbacks[_local5] = [cbobj, cbfn]; var _local7 = new LocalConnection(); var _local9 = _local7.send(this._endpoint, "rpc", _local5, args); }; _local6._callbacks = {}; _local6._callbacks[0] = [_local6, "_didConnect"]; _local11.st = getTimer(); _local11.loadMovie(_local21 + ".swf", "POST"); return(_local6); } static function fetchHighScores(options, callbackObj, callbackMethod) { var _local1 = _loadCommunicator({id:options.id}); if (!_local1) { return(false); } var _local4 = ["fetchHighScores", options]; _local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod); return(true); } static function sendHighScore(options, callbackObj, callbackMethod) { var _local1 = _loadCommunicator({id:options.id}); if (!_local1) { return(false); } var _local4 = ["sendHighScore", options]; _local1.doSend(["sendHighScore", options], callbackObj, callbackMethod); return(true); } static function load(options) { var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"}; options = _parseOptions(options, _local13); options.swfv = options.clip.getSWFVersion() || 6; options.mav = getVersion(); var _local9 = options.clip; if (!_isNetworkAvailable()) { return(null); } if (_local9._mochiad_loaded) { return(null); } var _local12 = options.depth; delete options.depth; var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12); var _local11 = _getRes(options); options.res = (_local11[0] + "x") + _local11[1]; options.server = options.server + options.id; delete options.id; _local9._mochiad_loaded = true; var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1); for (var _local7 in options) { _local4[_local7] = options[_local7]; } var _local10 = _local4.server; delete _local4.server; var _local14 = _allowDomains(_local10); _local6.onEnterFrame = function () { if (this._mochiad_ctr._url != this._url) { this.onEnterFrame = function () { if (!this._mochiad_ctr) { delete this.onEnterFrame; MochiAd.unload(this._parent); } }; } }; var _local5 = new LocalConnection(); var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_"); _local5.mc = _local6; _local5.name = _local8; _local5.hostname = _local14; _local5.allowDomain = function (d) { return(true); }; _local5.allowInsecureDomain = _local5.allowDomain; _local5.connect(_local8); _local6.lc = _local5; _local4.lc = _local8; _local4.st = getTimer(); _local4.loadMovie(_local10 + ".swf", "POST"); return(_local6); } static function unload(clip) { if (typeof(clip) == "undefined") { clip = _root; } if (clip.clip && (clip.clip._mochiad)) { clip = clip.clip; } if (!clip._mochiad) { return(false); } clip._mochiad.removeMovieClip(); delete clip._mochiad_loaded; delete clip._mochiad; return(true); } static function _isNetworkAvailable() { if (System.security) { var _local1 = System.security; if (_local1.sandboxType == "localWithFile") { return(false); } } return(true); } static function _getRes(options) { var _local3 = options.clip.getBounds(); var _local2 = 0; var _local1 = 0; if (typeof(options.res) != "undefined") { var _local4 = options.res.split("x"); _local2 = parseFloat(_local4[0]); _local1 = parseFloat(_local4[1]); } else { _local2 = _local3.xMax - _local3.xMin; _local1 = _local3.yMax - _local3.yMin; } if ((_local2 == 0) || (_local1 == 0)) { _local2 = Stage.width; _local1 = Stage.height; } return([_local2, _local1]); } static function _parseOptions(options, defaults) { var _local4 = {}; for (var _local8 in defaults) { _local4[_local8] = defaults[_local8]; } if (options) { for (var _local8 in options) { _local4[_local8] = options[_local8]; } } if (_root.mochiad_options) { var _local5 = _root.mochiad_options.split("&"); var _local2 = 0; while (_local2 < _local5.length) { var _local3 = _local5[_local2].split("="); _local4[unescape(_local3[0])] = unescape(_local3[1]); _local2++; } } if (_local4.id == "test") { trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!"); } return(_local4); } }
Symbol 56 MovieClip [__Packages.dRiveGraphics] Frame 0
class dRiveGraphics { var f; function dRiveGraphics () { f = new TextFormat(); with (f) { align = "center"; font = "dRiveFont"; size = 10; } } function drawRectangle(mc, w, h, fill, line) { with (mc) { clear(); lineStyle(0, line); beginFill(fill); moveTo(0, 0); lineTo(w, 0); lineTo(w, h); lineTo(0, h); lineTo(0, 0); endFill(); } } function drawTriangle(mc, w, h, fill, line) { with (mc) { clear(); lineStyle(0, line); beginFill(fill); moveTo(0, 0); lineTo(w, 0); lineTo(w, h); lineTo(0, h); lineTo(0, 0); endFill(); } } function setText(mc, txt, c) { var t = addText(mc, 10, mc._width, 15); with (t) { _x = 0; _y = int(0.5 * mc._height) - 8; text = txt; } with (f) { color = c; } t.setTextFormat(f); } function addText(mc, d, w, h) { var _local1 = mc.createTextField(("text" + d) + "_txt", d, 0, 0, w, h); _local1.multiline = true; _local1.embedFonts = true; _local1.selectable = false; return(_local1); } var tTitle = "dRive"; var tScore = "score: "; var tUpgrade = "points to upgrade: "; var tTotal = "life: "; var tLives = "extra lives: "; var tPlace0 = "position"; var tPlace1 = "velocity"; var tPlace2 = "acceleration"; var tDelta = "speed"; var tLeft = "<"; var tRight = ">"; var tUp = "^"; var tDown = "v"; var tPause = " press space bar to pause"; var tMenu = " ESC"; var tMute = " M"; var txLeft = "press left arrow\ndecrease "; var txRight = "press right arrow\nincrease "; var txUp = "press up arrow\nswitch to "; var txDown = "press down arrow\nswitch to "; var txMenu = "press esc\nfor menu"; var txMute = "press m\nto mute"; var tAuthor = "game by axcho\nmusic by SineRider"; var tWebsite = "visit Twig Games at\nwww.twiggames.com"; var tFront = "( press space bar to resume )"; var tOver = "( game over )"; var txOver = "press space bar to submit score\nor press esc to continue to menu"; var tTrack = "new track earned! :)"; var tExtra = "extra life earned! :3"; var tSkip = "( press space bar \n to skip tutorial )"; var tSmall = " points!"; var tBig = " points!"; var tFast = "faster control"; var tSlow = "slower control"; var tSpike = "life lost :("; var tLife = "extra life! :D"; var tCombo = new Array("", "miss :o\nchain broken", "lovely!\n2x chain!", "excellent!\n3x chain!", "wonderful!\n4x chain!", "splendid!\n5x chain!", "marvelous!\n6x chain!", "fantastic!\n7x chain!", "brilliant!\n8x chain!", "magnificent!\n9x chain!", "superb!\n10x chain!"); var tHelp = new Array("Welcome to dRive.\n\nTry moving your ship by pressing the left and right arrow keys (or A and D).", "Move your ship to catch the small light squares.\n\nThey give you points.", "The big light squares give you lots of points.\n\nTry to catch them.", "Press the up arrow (or W) to control the new track.\n\nDo it now.", "Press the down arrow key (or S) to switch back.\n\nTry each of the two tracks.", "The + squares speed up your sideways movement.\n\nCollect them.", "The - squares slow down your sideways movement.\n\nAvoid them.", "Press up (or W) until the third track is active.\n\nIts points are worth more.", "Experiment with controlling each track.\n\nFind your favorite.", "Avoid the big dark squares at all costs!\n\nThey reduce your life and destroy your tracks.", "The miniature ship squares are extra lives.\n\nCollect them.", "", ""); var tExplain = "You start with one ship in one track. As you earn points, a second and a third track will be added, along with a separate ship in each.\n\nStreaming through each track are various objects, some good and others bad. You must maneuver your ships to collect and avoid them.\n\nYou can control only one ship directly, but the other ships move based on that ship's placement in its track. Each ship marks a point on a scale, where the track center is 0, and on its left and right are - and + values.\n\nThe placement of the second ship represents the current speed of the first ship: velocity. The third ship represents the speed of the second ship, and the change in speed of the first: acceleration.\n\nPlay with it for a while and it will make more sense."; var B1 = 16777164; var B2 = 10092288; var B3 = 13434828; var B4 = 52224; var E1 = 13421721; var E2 = 6736896; var E3 = 26112; var E4 = 39168; var S1 = 13434777; var S2 = 11789721; var S3 = 10079359; var SG = 12309674; var T1 = 0; var T2 = 16777215; var T3 = 6710886; }
Symbol 57 MovieClip [__Packages.dRiveGame] Frame 0
class dRiveGame { var root, kLeft, kRight, kUp, kDown, kPause, kMenu, kMute, track, back, bar, bLeft, bRight, bUp, bDown, bPause, bMenu, bMute, stats, labels, meter, front, g, f, going, vol, sfx, score, lives, upgrade, steps, running, muted, tracks, active, blinker, counter, rate, times, helpSeen, page, wUp, wDown, wPause, wMenu, wMute, pLeft, pRight, pUp, pDown, pPause, pMenu, pMute, handleInput, earn_txt, total_txt, lives_txt, score_txt, upgrade_txt, left_txt, right_txt, up_txt, down_txt, help_txt, explain_txt, over_txt, main_id; function dRiveGame (parent) { root = parent.createEmptyMovieClip("game_mc", 0); kLeft = LEFT; kRight = RIGHT; kUp = UP; kDown = DOWN; kPause = SPACE; kMenu = ESCAPE; kMute = M; track = new Array(3); back = root.createEmptyMovieClip("back_mc", 0); bar = root.createEmptyMovieClip("bar_mc", 1); bLeft = root.createEmptyMovieClip("b_left_mc", 10); bRight = root.createEmptyMovieClip("b_right_mc", 11); bUp = root.createEmptyMovieClip("b_up_mc", 12); bDown = root.createEmptyMovieClip("b_down_mc", 13); bPause = root.createEmptyMovieClip("b_pause_mc", 14); bMenu = root.createEmptyMovieClip("b_menu_mc", 15); bMute = root.createEmptyMovieClip("b_mute_mc", 16); bLeft.cacheAsBitmap = true; bRight.cacheAsBitmap = true; bUp.cacheAsBitmap = true; bDown.cacheAsBitmap = true; bPause.cacheAsBitmap = true; bMenu.cacheAsBitmap = true; bMute.cacheAsBitmap = true; track[0] = new dRiveTrack(root.createEmptyMovieClip("pane0_mc", 17), this); track[1] = new dRiveTrack(root.createEmptyMovieClip("pane1_mc", 18), this); track[2] = new dRiveTrack(root.createEmptyMovieClip("pane2_mc", 19), this); stats = root.createEmptyMovieClip("stats_mc", 20); labels = root.createEmptyMovieClip("labels_mc", 21); meter = root.createEmptyMovieClip("meter_mc", 22); front = root.createEmptyMovieClip("front_mc", 30); stats.cacheAsBitmap = true; labels.cacheAsBitmap = true; } function initialize(graphics) { g = graphics; f = new TextFormat(); going = false; vol = 50; sfx = 100; score = 0; lives = 3; upgrade = 500; steps = dRiveTrack.TH / 500; running = true; muted = false; tracks = 1; active = 0; blinker = new Array(3); counter = new Array(3); rate = new Array(3); times = new Array(3); helpSeen = new Array(10); var _local2 = 0; while (_local2 < 10) { helpSeen[_local2] = false; _local2++; } page = 0; wUp = false; wDown = false; wPause = false; wMenu = false; wMute = false; pLeft = false; pRight = false; pUp = false; pDown = false; pPause = false; pMenu = false; pMute = false; handleInput = preInput; g.drawRectangle(back, SW, SH, g.SG, g.SG); g.drawRectangle(bar, SW, 50, g.S2, g.S2); bar._y = SH - bar._height; front.clear(); front._alpha = 75; front._visible = false; g.setText(front, "", g.T2); meter.clear(); track[0].initialize(g, "Position", g.tPlace0, 1, 1, null, track[1]); track[1].initialize(g, "Velocity", g.tPlace1, 0.1, 2, track[0], track[2]); track[2].initialize(g, "Acceleration", g.tPlace2, 0.01, 4, track[1], null); track[1].pane._x = int((0.5 * SW) - (0.5 * dRiveTrack.TW)); track[0].pane._x = (track[1].pane._x - dRiveTrack.TW) - 2; track[2].pane._x = (track[1].pane._x + dRiveTrack.TW) + 2; track[0].pane._y = 20; track[1].pane._y = 20; track[2].pane._y = 20; initializeButtons(); initializeLabels(); moveButtons(); _local2 = 0; while (_local2 < tracks) { track[_local2].enable(); _local2++; } track[active].activate(); track[active].running = false; } function initializeButtons() { g.drawRectangle(bLeft, BW, BH, g.S2, g.S2); g.setText(bLeft, g.tLeft, g.T1); bLeft._x = int(track[0].pane._x + (0.5 * BW)); bLeft._y = bar._y - (2 * BH); g.drawRectangle(bRight, BW, BH, g.S2, g.S2); g.setText(bRight, g.tRight, g.T1); bRight._x = int((track[0].pane._x + dRiveTrack.TW) - (1.5 * BW)); bRight._y = bar._y - (2 * BH); g.drawRectangle(bUp, BW, BH, g.S1, g.S1); g.setText(bUp, g.tUp, g.T1); bUp._x = int((track[1].pane._x + (0.5 * dRiveTrack.TW)) - (0.5 * BW)); bUp._y = bar._y - (2 * BH); g.drawRectangle(bDown, BW, BH, g.S1, g.S1); g.setText(bDown, g.tDown, g.T1); bDown._x = int((track[2].pane._x + (0.5 * dRiveTrack.TW)) - (0.5 * BW)); bDown._y = bar._y - (2 * BH); g.drawRectangle(bPause, dRiveTrack.TW, BH, g.S3, g.S3); g.setText(bPause, g.tPause, g.T2); bPause._x = track[1].pane._x; bPause._y = SH - 40; g.drawRectangle(bMenu, BW, BH, g.S3, g.S3); g.setText(bMenu, g.tMenu, g.T1); bMenu._x = int((track[0].pane._x + (0.5 * dRiveTrack.TW)) - (0.5 * BW)); bMenu._y = SH - 40; g.drawRectangle(bMute, BW, BH, g.S3, g.S3); g.setText(bMute, g.tMute, g.T1); bMute._x = int((track[2].pane._x + (0.5 * dRiveTrack.TW)) - (0.5 * BW)); bMute._y = SH - 40; var game = this; var _local3 = blinker; var _local2 = function () { this.i = game.blink(this, 1, 3); }; bUp.onRollOver = _local2; bDown.onRollOver = _local2; bPause.onRollOver = _local2; bMenu.onRollOver = _local2; bMute.onRollOver = _local2; bLeft.onRollOver = function () { game.pLeft = true; game.blink(this, 1, 3); }; bRight.onRollOver = function () { game.pRight = true; game.blink(this, 1, 3); }; bLeft.onDragOver = bLeft.onRollOver; bRight.onDragOver = bRight.onRollOver; bLeft.onRollOut = function () { game.pLeft = false; }; bRight.onRollOut = function () { game.pRight = false; }; bLeft.onDragOut = bLeft.onRollOut; bRight.onDragOut = bRight.onRollOut; bUp.onPress = function () { game.pUp = true; }; bDown.onPress = function () { game.pDown = true; }; bPause.onRelease = function () { game.pPause = true; }; bMenu.onRelease = function () { game.pMenu = true; }; bMute.onRelease = function () { game.pMute = true; }; } function initializeLabels() { var _local2; f.font = "dRiveFont"; f.size = 10; _local2 = g.addText(stats, 0, dRiveTrack.TW, 15); f.align = "center"; f.color = g.T1; _local2._x = track[1].pane._x; _local2._y = 2; _local2.text = g.tTitle; _local2.setTextFormat(f); _local2 = g.addText(stats, 5, dRiveTrack.TW, 31); f.align = "center"; f.color = g.T1; _local2._x = track[1].pane._x; _local2._y = track[1].pane._y; _local2.text = ""; _local2._visible = false; earn_txt = _local2; _local2 = g.addText(stats, 1, dRiveTrack.TW, 15); f.align = "left"; f.color = g.T2; _local2._x = track[0].pane._x; _local2._y = 2; _local2.text = g.tTotal + (lives + tracks); _local2.setTextFormat(f); total_txt = _local2; _local2 = g.addText(stats, 2, dRiveTrack.TW, 15); f.align = "left"; f.color = g.T3; _local2._x = track[0].pane._x; _local2._y = track[0].pane._y; _local2.text = g.tLives + lives; _local2.setTextFormat(f); lives_txt = _local2; _local2 = g.addText(stats, 3, dRiveTrack.TW, 15); f.align = "right"; f.color = g.T2; _local2._x = track[2].pane._x; _local2._y = 2; _local2.text = g.tScore + score; _local2.setTextFormat(f); score_txt = _local2; _local2 = g.addText(stats, 4, dRiveTrack.TW, 15); f.align = "right"; f.color = g.T3; _local2._x = track[2].pane._x; _local2._y = track[2].pane._y; _local2.text = g.tUpgrade + upgrade; _local2.setTextFormat(f); upgrade_txt = _local2; labels.clear(); _local2 = g.addText(labels, 0, 105, 31); f.align = "right"; f.color = g.T2; _local2._x = 0; _local2._y = SH - 40; _local2.text = g.tAuthor; _local2.setTextFormat(f); labels.lineStyle(0, g.T2); labels.moveTo(0, SH - 10); labels.lineTo(bMenu._x, SH - 10); _local2 = g.addText(labels, 1, 105, 31); f.align = "left"; f.color = g.T2; _local2._x = SW - _local2._width; _local2._y = SH - 40; _local2.text = g.tWebsite; _local2.setTextFormat(f); labels.lineStyle(0, g.T2); labels.moveTo(SW, SH - 10); labels.lineTo((bMute._x + bMute._width) + 1, SH - 10); _local2 = g.addText(labels, 2, 50, 31); f.align = "left"; f.color = g.T3; _local2._x = (bMenu._x + bMenu._width) + 1; _local2._y = SH - 40; _local2.text = g.txMenu; _local2.setTextFormat(f); _local2 = g.addText(labels, 3, 50, 31); f.align = "right"; f.color = g.T3; _local2._x = (bMute._x - _local2._width) + 1; _local2._y = SH - 40; _local2.text = g.txMute; _local2.setTextFormat(f); _local2 = g.addText(labels, 4, 110, 31); f.align = "right"; f.color = g.T3; _local2._x = ((bLeft._x + bLeft._width) - _local2._width) + 10; _local2._y = bLeft._y + bLeft._height; _local2.text = g.txLeft + track[0].tPlace; _local2.setTextFormat(f); left_txt = _local2; _local2 = g.addText(labels, 5, 110, 31); f.align = "left"; f.color = g.T3; _local2._x = bRight._x - 10; _local2._y = bRight._y + bRight._height; _local2.text = g.txRight + track[0].tPlace; _local2.setTextFormat(f); right_txt = _local2; _local2 = g.addText(labels, 6, 110, 31); f.align = "left"; f.color = g.T3; _local2._x = bUp._x; _local2._y = bUp._y + bUp._height; _local2.text = g.txUp + track[1].tPlace; _local2.setTextFormat(f); up_txt = _local2; _local2 = g.addText(labels, 7, 110, 31); f.align = "right"; f.color = g.T3; _local2._x = (bDown._x + bDown._width) - _local2._width; _local2._y = bDown._y + bDown._height; _local2.text = g.txDown + track[2].tPlace; _local2.setTextFormat(f); down_txt = _local2; _local2 = g.addText(labels, 8, 131, 95); _local2.wordWrap = true; _local2._x = track[0].pane._x; _local2._y = track[0].pane._y + 127; help_txt = _local2; _local2 = g.addText(labels, 9, 275, 255); _local2.wordWrap = true; f.align = "left"; f.color = g.T3; _local2._x = track[1].pane._x + 7; _local2._y = track[1].pane._y + 31; _local2.text = g.tExplain; _local2.setTextFormat(f); explain_txt = _local2; _local2 = g.addText(front, 1, SW, 63); _local2._y = int(0.5 * SH) + 15; _local2.text = ""; over_txt = _local2; } function main() { handleInput(); updateTracks(); updateBlinks(); } function preInput() { var _local3; if (running) { if (((pLeft or PRESSED(kLeft)) or PRESSED(A)) or ((pRight or PRESSED(kRight)) or PRESSED(D))) { blink(earn_txt, 1, 16); explain_txt.text = ""; explain_txt.removeTextField(); handleInput = postInput; track[active].resumeTrack(); track[active].wipe(); } } _local3 = PRESSED(kPause); if (pPause or (wPause and (!_local3))) { pPause = false; showHelp(-1); earn_txt.text = ""; earn_txt._visible = false; explain_txt.text = ""; explain_txt.removeTextField(); handleInput = postInput; track[active].resumeTrack(); } wPause = _local3; _local3 = PRESSED(kMenu); if (pMenu or (wMenu and (!_local3))) { pMenu = false; endGame(); } wMenu = _local3; _local3 = PRESSED(kMute); if (pMute or (wMute and (!_local3))) { pMute = false; if (muted) { muted = false; var _local2 = 0; while (_local2 < tracks) { track[_local2].unmute(); _local2++; } } else { muted = true; var _local2 = 0; while (_local2 < tracks) { track[_local2].mute(); _local2++; } } } wMute = _local3; } function postInput() { var _local3; if (running) { if ((pLeft or PRESSED(kLeft)) or PRESSED(A)) { track[active].moveLeft(); } else if ((pRight or PRESSED(kRight)) or PRESSED(D)) { track[active].moveRight(); } else { track[active].moveZero(); } _local3 = PRESSED(kUp) or PRESSED(W); if (pUp or (wUp and (!_local3))) { pUp = false; if ((active + 1) < tracks) { track[active].deactivate(); active++; track[active].activate(); moveButtons(); if (1 == active) { showHelp(4); } else if (2 == active) { showHelp(8); } } } wUp = _local3; _local3 = PRESSED(kDown) or PRESSED(S); if (pDown or (wDown and (!_local3))) { pDown = false; if (active > 0) { track[active].deactivate(); active--; track[active].activate(); moveButtons(); if (0 == active) { showHelp(11); } else if (1 == active) { showHelp(12); } } } wDown = _local3; } _local3 = PRESSED(kPause); if (pPause or (wPause and (!_local3))) { pPause = false; if (going) { if (running) { running = false; var _local2 = 0; while (_local2 < tracks) { track[_local2].pauseTrack(); _local2++; } g.drawRectangle(front, SW, SH, g.S1, g.S1); g.setText(front, g.tFront, g.T1); front._visible = true; } else { running = true; var _local2 = 0; while (_local2 < tracks) { track[_local2].resumeTrack(); _local2++; } front.clear(); g.setText(front, "", g.T2); front._visible = false; } } else { endGame(); } } wPause = _local3; _local3 = PRESSED(kMenu); if (pMenu or (wMenu and (!_local3))) { pMenu = false; if (!going) { score = 0; } endGame(); } wMenu = _local3; _local3 = PRESSED(kMute); if (pMute or (wMute and (!_local3))) { pMute = false; if (muted) { muted = false; var _local2 = 0; while (_local2 < tracks) { track[_local2].unmute(); _local2++; } } else { muted = true; var _local2 = 0; while (_local2 < tracks) { track[_local2].mute(); _local2++; } } } wMute = _local3; } function updateTracks() { var _local2 = 0; while (_local2 < tracks) { track[_local2].update(); _local2++; } } function addTrack() { if (tracks < 3) { track[tracks].enable(); tracks++; moveButtons(); } displayLives(); if (2 == tracks) { showHelp(3); } else if (3 == tracks) { showHelp(7); } } function removeTrack() { if (tracks > 1) { if (active == (tracks - 1)) { track[active].deactivate(); track[active].disable(); tracks--; active = tracks - 1; track[active].activate(); } else { track[tracks - 1].disable(); tracks--; } moveButtons(); } else { track[active].deactivate(); track[active].disable(); tracks--; going = false; running = false; g.drawRectangle(front, SW, SH, g.SG, g.SG); g.setText(front, g.tOver, g.T1); f.align = "center"; f.color = g.T2; over_txt.text = (score + "\n\n") + g.txOver; over_txt.setTextFormat(f); front._visible = true; showHelp(-1); moveButtons(); meter.clear(); } } function moveButtons() { if (tracks > 0) { bLeft._x = int(track[active].pane._x + (0.5 * BW)); left_txt._visible = true; bLeft._visible = true; bRight._x = int((track[active].pane._x + dRiveTrack.TW) - (1.5 * BW)); right_txt._visible = true; bRight._visible = true; } else { left_txt._visible = false; bLeft._visible = false; right_txt._visible = false; bRight._visible = false; } var _local3 = active + 1; if (_local3 < tracks) { up_txt._visible = true; bUp._visible = true; bUp._x = int((track[_local3].pane._x + (0.5 * dRiveTrack.TW)) - (0.5 * BW)); } else { up_txt._visible = false; bUp._visible = false; } var _local2 = active - 1; if (_local2 >= 0) { down_txt._visible = true; bDown._visible = true; bDown._x = int((track[_local2].pane._x + (0.5 * dRiveTrack.TW)) - (0.5 * BW)); } else { down_txt._visible = false; bDown._visible = false; } meter._x = (track[tracks - 1].pane._x + dRiveTrack.TW) + 2; meter._y = track[tracks - 1].pane._y; f.color = g.T3; f.align = "right"; left_txt._x = ((bLeft._x + bLeft._width) - left_txt._width) + 10; left_txt._y = bLeft._y + bLeft._height; left_txt.text = g.txLeft + track[active].tPlace; left_txt.setTextFormat(f); f.align = "left"; right_txt._x = bRight._x - 10; right_txt._y = bRight._y + bRight._height; right_txt.text = g.txRight + track[active].tPlace; right_txt.setTextFormat(f); f.align = "left"; up_txt._x = bUp._x; up_txt._y = bUp._y + bUp._height; up_txt.text = g.txUp + track[_local3].tPlace; up_txt.setTextFormat(f); f.align = "right"; down_txt._x = (bDown._x + bDown._width) - down_txt._width; down_txt._y = bDown._y + bDown._height; down_txt.text = g.txDown + track[_local2].tPlace; down_txt.setTextFormat(f); help_txt._x = track[active].pane._x; } function updateBlinks() { for (var _local4 in blinker) { var _local3 = blinker[_local4]; if (_local3 != undefined) { var _local2 = counter[_local4]; if (_local2 > 0) { _local2--; if (_local2 <= 0) { _local2 = -rate[_local4]; times[_local4]--; _local3._alpha = 100; _local3._visible = true; } } else if (_local2 < 0) { _local2++; if (_local2 >= 0) { _local2 = 1; times[_local4]--; _local3._alpha = 0; } } counter[_local4] = _local2; if (times[_local4] <= 0) { if (_local3._alpha == 0) { _local3._alpha = 100; _local3._visible = false; } blinker[_local4] = undefined; } } } updateAfterEvent(); } function blink(mc, r, t) { var _local2 = blinker.length; while (_local2--) { if (blinker[_local2] == undefined) { blinker[_local2] = mc; rate[_local2] = (2 * r) - 1; times[_local2] = t; counter[_local2] = r; mc._alpha = 0; return(undefined); } } _local2 = blinker.length; blinker[_local2] = mc; rate[_local2] = (2 * r) - 1; times[_local2] = t; counter[_local2] = r; mc._alpha = 0; return(_local2); } function displayScore() { f.align = "right"; f.color = g.T2; score_txt.text = g.tScore + score; score_txt.setTextFormat(f); f.color = g.T3; upgrade_txt.text = g.tUpgrade + upgrade; upgrade_txt.setTextFormat(f); meter.clear(); meter.lineStyle(0, g.T1); meter.moveTo(0, dRiveTrack.TH); meter.lineTo(0, steps * upgrade); } function increaseScore(a) { score = score + a; upgrade = upgrade - a; if (upgrade <= 0) { if (tracks < 3) { addTrack(); earn_txt.text = g.tTrack; var _local2 = 0; while (_local2 < tracks) { track[_local2].lull(); _local2++; } } else { increaseLives(); earn_txt.text = g.tExtra; var _local2 = 0; while (_local2 < tracks) { track[_local2].calm(); _local2++; } } f.align = "center"; f.color = g.T1; earn_txt.setTextFormat(f); blink(earn_txt, 2, 64); upgrade = 500 * (lives + ((0.5 * tracks) * (tracks + 1))); steps = dRiveTrack.TH / upgrade; } displayScore(); blink(meter, 1, 3); } function displayLives() { f.align = "left"; f.color = g.T2; total_txt.text = g.tTotal + (lives + tracks); total_txt.setTextFormat(f); f.color = g.T3; lives_txt.text = g.tLives + lives; lives_txt.setTextFormat(f); } function increaseLives() { lives++; displayLives(); } function decreaseLives() { if (lives <= 0) { removeTrack(); } else { lives--; } displayLives(); var _local2 = 0; while (_local2 < tracks) { track[_local2].invincible(); _local2++; } } function pauseGame() { running = false; var _local2 = 0; while (_local2 < tracks) { track[_local2].pauseTrack(); _local2++; } root._visible = false; clearInterval(main_id); main_id = setInterval(mx.utils.Delegate.create(this, updateBlinks), 30); } function resumeGame() { running = true; var _local2 = 0; while (_local2 < tracks) { track[_local2].resumeTrack(); _local2++; } root._visible = true; front.clear(); g.setText(front, "", g.T2); front._visible = false; clearInterval(main_id); main_id = setInterval(mx.utils.Delegate.create(this, main), 30); } function newGame(graphics) { initialize(graphics); var _local2 = 0; while (_local2 < 3) { track[_local2].startTrack(); _local2++; } root._visible = true; going = true; showHelp(0); f.align = "center"; f.color = g.T1; earn_txt.text = g.tSkip; earn_txt.setTextFormat(f); blink(earn_txt, 1, 15); clearInterval(main_id); main_id = setInterval(mx.utils.Delegate.create(this, main), 30); } function endGame() { pauseGame(); _root.play(); } function showHelp(p) { if (page >= 0) { if (p < 0) { help_txt.text = ""; help_txt.removeTextField(); } else if (!helpSeen[p]) { f.align = "left"; f.color = g.T1; help_txt.text = g.tHelp[p]; help_txt.setTextFormat(f); helpSeen[p] = true; if (p) { blink(help_txt, 2, 31); var _local2 = 0; while (_local2 < tracks) { track[_local2].wipe(); _local2++; } } } page = p; } } static var SW = 500; static var SH = 500; static var BW = 31; static var BH = 31; static var PRESSED = Key.isDown; static var LEFT = 37; static var RIGHT = 39; static var UP = 38; static var DOWN = 40; static var SPACE = 32; static var ENTER = 13; static var ESCAPE = 27; static var M = 77; static var A = 65; static var D = 68; static var W = 87; static var S = 83; }
Symbol 58 MovieClip [__Packages.dRiveTrack] Frame 0
class dRiveTrack { var pane, game, back, objects, grid, ship, lines, f, music, small_fx, big_fx, fast_fx, slow_fx, spike_fx, life_fx, graph, g, tPlace, scale, bonus, chain, plier, pSmall, pBig, low, high, ratio, sum, density, speed, points, timer, when, pathi, xPos, xVel, xAcc, total, place_txt, delta_txt, alert_txt, combo_txt, object, live, yv, k, active, running, unlife, xDelta, tDelta; function dRiveTrack (parent, shell) { pane = parent; game = shell; back = pane.createEmptyMovieClip("back_mc", 1); objects = pane.createEmptyMovieClip("objects_mc", 2); grid = pane.createEmptyMovieClip("grid_mc", 3); ship = pane.createEmptyMovieClip("ship_mc", 4); lines = pane.createEmptyMovieClip("lines_mc", 5); var _local2 = pane.createEmptyMovieClip("hold_mc", 6); grid.cacheAsBitmap = true; f = new TextFormat(); music = new Sound(pane); small_fx = new Sound(back); big_fx = new Sound(objects); fast_fx = new Sound(grid); slow_fx = new Sound(ship); spike_fx = new Sound(lines); life_fx = new Sound(_local2); graph = new dRiveGraph(_local2, game); } function initialize(graphics, song, place, size, prize, lower, higher) { g = graphics; tPlace = place; scale = size; bonus = prize; chain = 2; plier = 1; pSmall = (10 * bonus) * plier; pBig = (100 * bonus) * plier; low = lower; high = higher; ratio = new Array(6); var _local2 = 0; while (_local2 < 6) { ratio[_local2] = 0; _local2++; } sum = 0; density = 30; speed = 3; points = 0; timer = 30; when = 100; pathi = 0; xPos = 0; xVel = 0; xAcc = 0; resetDelta(); music.attachSound(song); total = 0.001 * music.duration; music.onSoundComplete = music.start; small_fx.attachSound("Small"); big_fx.attachSound("Big"); fast_fx.attachSound("Fast"); slow_fx.attachSound("Slow"); spike_fx.attachSound("Spike"); life_fx.attachSound("Life"); unmute(); g.drawRectangle(back, TW, TH, g.S2, g.S2); objects.scrollRect = new flash.geom.Rectangle(0, 0, TW, TH); objects.cacheAsBitmap = true; for (_local2 in objects) { objects[_local2].removeMovieClip(); } g.drawTriangle(ship, PW, PH, g.E1, g.B1); ship.lineStyle(0, g.T2); ship.moveTo(int(0.5 * PW), PH + 6); ship.lineTo(int(0.5 * PW), PH + 10); ship._x = CTR; ship._y = (TH - PH) - 10; grid.clear(); grid.lineStyle(0, g.T1); grid.moveTo(0, TH); grid.lineTo(TW, TH); grid.moveTo(int(0.5 * TW), TH); grid.lineTo(int(0.5 * TW), TH - 4); grid.moveTo(int(0.25 * TW), TH); grid.lineTo(int(0.25 * TW), TH - 4); grid.moveTo(int(0.75 * TW), TH); grid.lineTo(int(0.75 * TW), TH - 4); f.color = g.T1; f.font = "dRiveFont"; f.size = 10; var _local3 = g.addText(grid, 0, TW, 15); f.align = "center"; _local3._y = TH; _local3.text = "0"; _local3.setTextFormat(f); var _local6 = g.addText(grid, 1, TW, 15); f.align = "left"; f.color = g.T3; _local6._y = TH; _local6.text = "-" + (scale * int((0.5 * TW) + 1)); _local6.setTextFormat(f); var _local4 = g.addText(grid, 2, TW, 15); f.align = "right"; f.color = g.T2; _local4._y = TH; _local4.text = "+" + (scale * int((0.5 * TW) + 1)); _local4.setTextFormat(f); var _local7 = g.addText(grid, 3, TW, 15); f.align = "left"; f.color = g.T1; _local7._y = TH + 30; _local7.text = tPlace; _local7.setTextFormat(f); var _local5 = g.addText(grid, 4, TW, 15); f.align = "right"; f.color = g.T3; _local5._y = TH + 30; _local5.text = g.tDelta; _local5.setTextFormat(f); place_txt = g.addText(lines, 0, TW, 15); place_txt._y = TH + 20; delta_txt = g.addText(lines, 1, TW, 15); delta_txt._y = TH + 20; alert_txt = g.addText(lines, 2, TW, 15); alert_txt._y = ship._y - ship._height; alert_txt._visible = false; combo_txt = g.addText(lines, 3, TW, 31); combo_txt._y = ship._y - (2 * ship._height); combo_txt._visible = false; updatePlace(); object = new Array(); live = new Array(); yv = new Array(); k = new Array(); graph.initialize(g, scale); active = false; running = false; pane._visible = false; mute(); } function update() { if (!running) { return(undefined); } if (!active) { if (low.active) { var _local8 = (low.getVel() / scale) + CTR; var _local7 = _local8 - ship._x; xAcc = _local7 - xVel; xVel = _local7; ship._x = _local8; } else if (high.running) { ship._x = ship._x + (high.getPos() / scale); } else { ship._x = (low.getAcc() / scale) + CTR; } if (ship._x < 0) { ship._x = 0; } else if (ship._x > RHT) { ship._x = RHT; } } if (unlife) { unlife--; } for (var _local6 in object) { var _local2 = object[_local6]; if (live[_local6]) { if (live[_local6] < 0) { live[_local6]++; } else { _local2._y = _local2._y + yv[_local6]; if (_local2._y >= (TH + _local2._height)) { _local2.clear(); _local2._visible = false; live[_local6] = 0; if (SMALL == k[_local6]) { if (plier > 1) { plier = 1; updateCombo(plier); pSmall = (10 * bonus) * plier; pBig = (100 * bonus) * plier; } chain = 2; } } else { var _local3 = _local2._y; if (_local3 >= (HIT - _local2._height)) { if (_local3 <= (TH - 10)) { if (_local2.hitTest(ship)) { game.blink(_local2, 2, 4); live[_local6] = -10; switch (k[_local6]) { case SMALL : small_fx.start(); points = points + pSmall; checkProgress(); game.increaseScore(pSmall); updateAlert(("+" + pSmall) + g.tSmall); chain--; if (!chain) { plier++; if (plier > 10) { plier = 10; } updateCombo(plier); pSmall = (10 * bonus) * plier; pBig = (100 * bonus) * plier; chain = 2; } break; case BIG : big_fx.start(); points = points + pBig; checkProgress(); game.increaseScore(pBig); updateAlert(("+" + pBig) + g.tBig); break; case FAST : fast_fx.start(); increaseDelta(); updateAlert(g.tFast); break; case SLOW : slow_fx.start(); decreaseDelta(); updateAlert(g.tSlow); break; case SPIKE : if (!unlife) { spike_fx.start(); invincible(); game.decreaseLives(); updateAlert(g.tSpike); } break; case LIFE : life_fx.start(); game.increaseLives(); updateAlert(g.tLife); } } } } } } } } if (density) { when++; if (random(density)) { if (when > (3 * density)) { addSmall(); when = 0; } } else { var _local5 = random(sum); var _local4 = ratio[SMALL]; if (_local5 < _local4) { addSmall(); when = 0; } else { _local4 = _local4 + ratio[FAST]; if (_local5 < _local4) { addFast(); when = 0; } else { _local4 = _local4 + ratio[SLOW]; if (_local5 < _local4) { addSlow(); when = 0; } else { _local4 = _local4 + ratio[SPIKE]; if (_local5 < _local4) { addSpike(); when = 0; } else { _local4 = _local4 + ratio[LIFE]; if (_local5 < _local4) { addLife(); when = 0; } else { _local4 = _local4 + ratio[BIG]; if (_local5 < _local4) { addBig(); when = 0; } } } } } } } } timer--; if (!timer) { if (speed < 10) { speed++; } density = int(30 / speed); if (density < 2) { density = 2; } timer = (100 * speed) * speed; checkProgress(); } updatePlace(); graph.update(DEC * (ship._x - CTR)); } function newObject(mc) { var _local2 = object.length; while (_local2--) { var _local4 = object[_local2]; if (live[_local2] == 0) { live[_local2] = 1; _local4._visible = true; _local4._alpha = 100; return(_local2); } } var _local3 = objects.getNextHighestDepth(); var _local4 = objects.createEmptyMovieClip("o" + _local3, _local3); _local2 = object.length; object[_local2] = _local4; live[_local2] = 1; return(_local2); } function addSpike() { var _local2 = int(1.5 * PW) - 1; var _local4 = newObject(); var _local3 = object[_local4]; g.drawTriangle(_local3, _local2, -_local2, g.E3, g.B3); _local3._x = random(TW - _local2); _local3._y = -_local2; yv[_local4] = speed; k[_local4] = SPIKE; } function addLife() { var _local2 = int(0.75 * PW) + 1; var _local4 = newObject(); var _local3 = object[_local4]; g.drawTriangle(_local3, _local2, _local2, g.E1, g.B1); _local3._x = random(TW - _local2); _local3._y = -_local2; yv[_local4] = speed; k[_local4] = LIFE; } function addSmall() { var _local2 = int(0.5 * PW) + 1; var _local4 = newObject(); var _local3 = object[_local4]; g.drawRectangle(_local3, _local2, _local2, g.E2, g.B2); _local3._x = random(TW - _local2); _local3._y = -_local2; yv[_local4] = speed + random(2); k[_local4] = SMALL; } function addBig() { var _local2 = PW; var _local4 = newObject(); var _local3 = object[_local4]; g.drawRectangle(_local3, _local2, _local2, g.E2, g.B2); _local3._x = random(TW - _local2); _local3._y = -_local2; yv[_local4] = speed + random(2); k[_local4] = BIG; } function addFast() { var _local4 = int(0.75 * PW) + 1; var _local2 = int(0.5 * _local4); var _local5 = newObject(); var _local3 = object[_local5]; g.drawTriangle(_local3, _local4, _local4, g.E4, g.B4); _local3.lineStyle(0, g.T2); _local3.moveTo(_local2 - 2, _local2); _local3.lineTo(_local2 + 3, _local2); _local3.moveTo(_local2, _local2 - 2); _local3.lineTo(_local2, _local2 + 3); _local3._x = random(TW - _local4); _local3._y = -_local4; yv[_local5] = speed + random(2); k[_local5] = FAST; } function addSlow() { var _local3 = int(0.75 * PW) + 1; var _local4 = int(0.5 * _local3); var _local5 = newObject(); var _local2 = object[_local5]; g.drawTriangle(_local2, _local3, _local3, g.E3, g.B3); _local2.lineStyle(0, g.T2); _local2.moveTo(_local4 - 2, _local4); _local2.lineTo(_local4 + 3, _local4); _local2._x = random(TW - _local3); _local2._y = -_local3; yv[_local5] = speed + random(2); k[_local5] = SLOW; } function resetDelta() { xDelta = 3; tDelta = 0.03; game.blink(delta_txt, 4, 3); } function increaseDelta() { xDelta = xDelta + 1; tDelta = tDelta + 0.01; if (xDelta > 10) { xDelta = 10; } if (tDelta > 0.1) { tDelta = 0.1; } } function decreaseDelta() { xDelta = xDelta - 1; tDelta = tDelta - 0.01; if (xDelta < 1) { xDelta = 1; } if (tDelta < 0.01) { tDelta = 0.01; } } function enable() { unmute(); running = true; pane._visible = true; game.blink(back, 2, 7); } function disable() { mute(); graph.reset(); running = false; for (var _local2 in objects) { objects[_local2].removeMovieClip(); } object = new Array(); live = new Array(); yv = new Array(); k = new Array(); game.blink(pane, 2, 8); } function activate() { active = true; g.drawRectangle(back, TW, TH, g.S1, g.S1); game.blink(ship, 2, 7); } function deactivate() { active = false; g.drawRectangle(back, TW, TH, g.S2, g.S2); } function startTrack() { music.stop(); music.start(); } function pauseTrack() { running = false; music.stop(); } function resumeTrack() { running = true; music.stop(); music.start(0.001 * music.position); } function mute() { music.setVolume(0); small_fx.setVolume(0); big_fx.setVolume(0); fast_fx.setVolume(0); slow_fx.setVolume(0); spike_fx.setVolume(0); life_fx.setVolume(0); } function unmute() { music.setVolume(game.vol); small_fx.setVolume(game.sfx); big_fx.setVolume(game.sfx); fast_fx.setVolume(game.sfx); slow_fx.setVolume(game.sfx); spike_fx.setVolume(game.sfx); life_fx.setVolume(game.sfx); } function wipe() { density = 0; if (speed > 0) { speed--; } timer = 200; plier = 1; updateCombo(0); pSmall = (10 * bonus) * plier; pBig = (100 * bonus) * plier; chain = 2; } function lull() { density = 0; if (speed > 0) { speed--; } timer = 100; plier = 1; updateCombo(0); pSmall = (10 * bonus) * plier; pBig = (100 * bonus) * plier; chain = 2; life_fx.start(); } function calm() { density = 0; timer = 100; plier = 1; updateCombo(0); pSmall = (10 * bonus) * plier; pBig = (100 * bonus) * plier; chain = 2; life_fx.start(); } function invincible() { unlife = 31; game.blink(ship, 1, 31); } function moveLeft() { var _local2 = ship._x - xDelta; if (_local2 < 0) { _local2 = 0; } xVel = _local2 - ship._x; ship._x = _local2; if (timer & 1) { var _local3 = (0.001 * music.position) - tDelta; music.stop(); music.start(_local3); } } function moveRight() { var _local2 = ship._x + xDelta; if (_local2 > RHT) { _local2 = RHT; } xVel = _local2 - ship._x; ship._x = _local2; if (timer & 1) { var _local3 = (0.001 * music.position) + tDelta; if (_local3 < total) { music.stop(); music.start(_local3); } } } function moveZero() { xVel = 0; } function getPos() { return(scale * (ship._x - CTR)); } function getVel() { return(scale * xVel); } function getAcc() { return(scale * xAcc); } function updatePlace() { f.align = "left"; f.color = g.T2; var _local2 = 0.001 * int(1000 * getPos()); place_txt.text = ((_local2 > 0) ? "+" : "") + _local2; place_txt.setTextFormat(f); f.align = "right"; f.color = g.T3; delta_txt.text = (scale * xDelta).toString(); delta_txt.setTextFormat(f); } function updateAlert(s) { f.align = "center"; f.color = g.T3; alert_txt.text = s; alert_txt.setTextFormat(f); alert_txt._visible = true; game.blink(alert_txt, 1, 16); } function updateCombo(m) { f.align = "center"; f.color = g.T3; combo_txt.text = g.tCombo[m]; combo_txt.setTextFormat(f); combo_txt._visible = true; if (m == 1) { game.blink(combo_txt, 2, 8); } else { game.blink(combo_txt, 1, 7); } } function checkProgress() { while (points >= path[pathi]) { switch (pathi) { case 0 : sum = sum + 60; ratio[SMALL] = ratio[SMALL] + 20; addSmall(); game.showHelp(1); break; case 1 : sum = sum + 3; ratio[BIG] = ratio[BIG] + 3; addBig(); game.showHelp(2); break; case 2 : sum = sum + 10; ratio[FAST] = ratio[FAST] + 10; addFast(); game.showHelp(5); break; case 3 : sum = sum + 0; ratio[SLOW] = ratio[SLOW] + 5; ratio[FAST] = ratio[FAST] - 5; addSlow(); game.showHelp(6); break; case 4 : sum = sum + 3; ratio[SPIKE] = ratio[SPIKE] + 2; ratio[BIG] = ratio[BIG] + 1; addSpike(); game.showHelp(9); break; case 5 : sum = sum + 3; ratio[LIFE] = ratio[LIFE] + 1; ratio[SPIKE] = ratio[SPIKE] + 2; addLife(); game.showHelp(10); break; case 6 : sum = sum + 1; ratio[SPIKE] = ratio[SPIKE] + 2; ratio[BIG] = ratio[BIG] + 1; break; case 7 : case 8 : case 9 : case 10 : case 11 : case 12 : case 13 : case 14 : case 15 : sum = sum + 1; ratio[SPIKE] = ratio[SPIKE] + 2; ratio[SMALL] = ratio[SMALL] + 1; game.showHelp(-1); break; default : return(undefined); } pathi++; } } static var TW = 127; static var TH = 255; static var PW = 15; static var PH = 15; static var CTR = (0.5 * TW) - (0.5 * PW); static var RHT = TW - PW; static var HIT = TH - (2 * PH); static var DEC = 1 / int(0.5 * TW); static var SPIKE = 0; static var LIFE = 1; static var SMALL = 2; static var BIG = 3; static var FAST = 4; static var SLOW = 5; static var path = new Array(0, 200, 800, 1200, 1600, 2000, 2400, 4000, 6000, 8000, 10000, 12000, 14000, 16000, 18000, 20000); }
Symbol 59 MovieClip [__Packages.dRiveGraph] Frame 0
class dRiveGraph { var game, hold, plot, grid, g, scale, yo; function dRiveGraph (parent, shell) { game = shell; hold = parent; plot = new flash.display.BitmapData(GW, GH); hold.attachBitmap(plot, 0, "never", false); grid = hold.createEmptyMovieClip("grid_mc", 1); grid.cacheAsBitmap = true; } function initialize(graphics, size) { g = graphics; scale = size; hold._y = dRiveTrack.TH + 45; reset(); grid.clear(); grid.lineStyle(0, g.T1); grid.moveTo(0, 0); grid.lineTo(0, GH); grid.moveTo(0, int(0.5 * GH)); grid.lineTo(4, int(0.5 * GH)); grid.moveTo(0, int(0.25 * GH)); grid.lineTo(4, int(0.25 * GH)); grid.moveTo(0, int(0.75 * GH)); grid.lineTo(4, int(0.75 * GH)); var _local2 = new TextFormat(); _local2.align = "left"; _local2.color = g.T1; _local2.font = "dRiveFont"; _local2.size = 10; var _local3 = g.addText(grid, 0, GW, 15); _local3._x = 10; _local3._y = int(0.5 * GH) - 8; _local3.text = "0"; _local3.setTextFormat(_local2); var _local5 = g.addText(grid, 1, GW, 15); _local2.color = g.T3; _local5._x = 4; _local5._y = GH - 15; _local5.text = "-" + (scale * int((0.5 * dRiveTrack.TW) + 1)); _local5.setTextFormat(_local2); var _local4 = g.addText(grid, 2, GW, 15); _local2.color = g.T2; _local4._x = 4; _local4._y = 0; _local4.text = "+" + (scale * int((0.5 * dRiveTrack.TW) + 1)); _local4.setTextFormat(_local2); } function update(xn) { plot.scroll(-1, 0); plot.setPixel(GW - 1, yo, g.S3); var _local2 = (-int(GH2 * xn)) + GH2; plot.setPixel(GW - 1, _local2, g.T2); yo = _local2; } function reset() { plot.fillRect(new flash.geom.Rectangle(0, 0, GW, GH), 4278190080 + g.S3); } static var GW = 127; static var GH = 63; static var GH2 = int(0.5 * GH); }
Symbol 60 MovieClip [__Packages.mx.utils.Delegate] Frame 0
class mx.utils.Delegate extends Object { var func; function Delegate (f) { super(); func = f; } static function create(obj, func) { var _local2 = function () { var _local2 = arguments.callee.target; var _local3 = arguments.callee.func; return(_local3.apply(_local2, arguments)); }; _local2.target = obj; _local2.func = func; return(_local2); } function createDelegate(obj) { return(create(obj, func)); } }
Symbol 61 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices { static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel; function MochiServices () { } static function get id() { return(_id); } static function get clip() { return(_container); } static function get childClip() { return(_clip); } static function getVersion() { return("1.31"); } static function allowDomains(server) { var _local1 = server.split("/")[2].split(":")[0]; if (System.security) { if (System.security.allowDomain) { System.security.allowDomain("*"); System.security.allowDomain(_local1); } if (System.security.allowInsecureDomain) { System.security.allowInsecureDomain("*"); System.security.allowInsecureDomain(_local1); } } return(_local1); } static function get isNetworkAvailable() { if (System.security) { var _local1 = System.security; if (_local1.sandboxType == "localWithFile") { return(false); } } return(true); } static function set comChannelName(val) { if (val != undefined) { if (val.length > 3) { _sendChannelName = val + "_fromgame"; _rcvChannelName = val; initComChannels(); } } //return(__get__comChannelName()); } static function get connected() { return(_connected); } static function connect(id, clip, onError) { if ((!_connected) && (_clip == undefined)) { trace("MochiServices Connecting..."); _connecting = true; init(id, clip); } if (onError != undefined) { mochi.MochiServices.onError = onError; } else if (mochi.MochiServices.onError == undefined) { mochi.MochiServices.onError = function (errorCode) { trace(errorCode); }; } } static function disconnect() { if (_connected || (_connecting)) { _connecting = (_connected = false); flush(true); if (_clip != undefined) { _clip.removeMovieClip(); delete _clip; } _listenChannel.close(); _rcvChannel.close(); } } static function init(id, clip) { _id = id; if (clip != undefined) { _container = clip; } else { _container = _root; } loadCommunicator(id, _container); } static function loadCommunicator(id, clip) { var _local2 = "_mochiservices_com_" + id; if (_clip != null) { return(_clip); } if (!isNetworkAvailable) { return(null); } allowDomains(_gatewayURL); _clip = clip.createEmptyMovieClip(_local2, 10336, false); _loader = new MovieClipLoader(); if (_loaderListener.waitInterval != null) { clearInterval(_loaderListener.waitInterval); } _loaderListener = {}; _loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) { trace("MochiServices could not load."); mochi.MochiServices.disconnect(); mochi.MochiServices.onError.apply(null, [errorCode]); }; _loaderListener.onLoadStart = function (target_mc) { this.isLoading = true; }; _loaderListener.startTime = getTimer(); _loaderListener.wait = function () { if ((getTimer() - this.startTime) > 10000) { if (!this.isLoading) { mochi.MochiServices.disconnect(); mochi.MochiServices.onError.apply(null, ["IOError"]); } clearInterval(this.waitInterval); } }; _loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000); _loader.addListener(_loaderListener); _loader.loadClip(_gatewayURL, _clip); _sendChannel = new LocalConnection(); _sendChannel._queue = []; _rcvChannel = new LocalConnection(); _rcvChannel.allowDomain = function (d) { return(true); }; _rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain; _rcvChannel._nextcallbackID = 0; _rcvChannel._callbacks = {}; listen(); return(_clip); } static function onStatus(infoObject) { if (!(infoObject.level === "error")) { } else { _connected = false; _listenChannel.connect(_listenChannelName); } } static function listen() { _listenChannel = new LocalConnection(); _listenChannel.handshake = function (args) { mochi.MochiServices.__set__comChannelName(args.newChannel); }; _listenChannel.allowDomain = function (d) { return(true); }; _listenChannel.allowInsecureDomain = _listenChannel.allowDomain; _listenChannel.connect(_listenChannelName); trace("Waiting for MochiAds services to connect..."); } static function initComChannels() { if (!_connected) { _sendChannel.onStatus = function (infoObject) { mochi.MochiServices.onStatus(infoObject); }; _sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"}); _sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()}); _rcvChannel.onStatus = function (infoObject) { mochi.MochiServices.onStatus(infoObject); }; _rcvChannel.onReceive = function (pkg) { var _local5 = pkg.callbackID; var _local4 = this._callbacks[_local5]; if (!_local4) { return(undefined); } var _local2 = _local4.callbackMethod; var _local3 = _local4.callbackObject; if (_local3 && (typeof(_local2) == "string")) { _local2 = _local3[_local2]; } if (_local2 != undefined) { _local2.apply(_local3, pkg.args); } delete this._callbacks[_local5]; }; _rcvChannel.onError = function () { mochi.MochiServices.onError.apply(null, ["IOError"]); }; _rcvChannel.connect(_rcvChannelName); trace("connected!"); _connecting = false; _connected = true; _listenChannel.close(); while (_sendChannel._queue.length > 0) { _sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift()); } } } static function flush(error) { var _local1; var _local2; while (_sendChannel._queue.length > 0) { _local1 = _sendChannel._queue.shift(); if (_local1.callbackID != null) { _local2 = _rcvChannel._callbacks[_local1.callbackID]; } delete _rcvChannel._callbacks[_local1.callbackID]; if (error) { handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod); } } } static function handleError(args, callbackObject, callbackMethod) { if (args != null) { if (args.onError != null) { args.onError.apply(null, ["NotConnected"]); } } if (callbackMethod != null) { args = {}; args.error = true; args.errorCode = "NotConnected"; if ((callbackObject != null) && (typeof(callbackMethod) == "string")) { callbackObject[callbackMethod](args); } else if (callbackMethod != null) { callbackMethod.apply(args); } } } static function send(methodName, args, callbackObject, callbackMethod) { if (_connected) { _sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID}); } else { if ((_clip == undefined) || (!_connecting)) { onError.apply(null, ["NotConnected"]); handleError(args, callbackObject, callbackMethod); flush(true); return(undefined); } _sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID}); } _rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod}; _rcvChannel._nextcallbackID++; } static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf"; static var _listenChannelName = "__mochiservices"; static var _connecting = false; static var _connected = false; }
Symbol 62 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores { static var boardID, onClose, onError; function MochiScores () { } static function setBoardID(boardID) { mochi.MochiScores.boardID = boardID; mochi.MochiServices.send("scores_setBoardID", {boardID:boardID}); } static function showLeaderboard(options) { if (options.clip != null) { if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) { mochi.MochiServices.disconnect(); mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip); } delete options.clip; } if (options.name != null) { if (typeof(options.name) == "object") { if (options.name.text != undefined) { options.name = options.name.text; } } } if (options.score != null) { if (typeof(options.score) == "object") { if (options.score.text != undefined) { options.score = options.score.text; } } } if (options.onDisplay != null) { options.onDisplay(); } else { mochi.MochiServices.__get__clip().stop(); } if (options.onClose != null) { onClose = options.onClose; } else { onClose = function () { mochi.MochiServices.__get__clip().play(); }; } if (options.onError != null) { onError = options.onError; } else { onError = onClose; } if (options.boardID == null) { if (boardID != null) { options.boardID = boardID; } } mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose); } static function closeLeaderboard() { mochi.MochiServices.send("scores_closeLeaderboard"); } static function getPlayerInfo(callbackObj, callbackMethod) { mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod); } static function submit(score, name, callbackObj, callbackMethod) { mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod); } static function requestList(callbackObj, callbackMethod) { mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod); } static function scoresArrayToObjects(scores) { var _local5 = {}; var _local1; var _local4; var _local2; var _local6; for (var _local8 in scores) { if (typeof(scores[_local8]) == "object") { if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) { _local5[_local8] = []; _local2 = scores[_local8]; _local4 = 0; while (_local4 < _local2.rows.length) { _local6 = {}; _local1 = 0; while (_local1 < _local2.cols.length) { _local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1]; _local1++; } _local5[_local8].push(_local6); _local4++; } } else { _local5[_local8] = {}; for (var _local7 in scores[_local8]) { _local5[_local8][_local7] = scores[_local8][_local7]; } } } else { _local5[_local8] = scores[_local8]; } } return(_local5); } static function doClose(args) { if (args.error == true) { if (args.errorCode == undefined) { args.errorCode = "IOError"; } onError.apply(null, [args.errorCode]); } else { onClose.apply(); } } }

Library Items

Symbol 1 BitmapUsed by:2
Symbol 2 GraphicUses:1Used by:3
Symbol 3 MovieClipUses:2Used by:4
Symbol 4 MovieClip [button1_mc]Uses:3Used by:Timeline
Symbol 5 GraphicUsed by:Timeline
Symbol 6 Font [dRiveFont]Used by:7 8 21 23 25 27 29 32 34 36 38 39 42 43 45 47 48 49 54
Symbol 7 TextUses:6Used by:Timeline
Symbol 55 MovieClip [__Packages.MochiAd]
Symbol 56 MovieClip [__Packages.dRiveGraphics]
Symbol 57 MovieClip [__Packages.dRiveGame]
Symbol 58 MovieClip [__Packages.dRiveTrack]
Symbol 59 MovieClip [__Packages.dRiveGraph]
Symbol 60 MovieClip [__Packages.mx.utils.Delegate]
Symbol 61 MovieClip [__Packages.mochi.MochiServices]
Symbol 62 MovieClip [__Packages.mochi.MochiScores]
Symbol 8 EditableTextUses:6Used by:18
Symbol 9 Sound [Life]Used by:18
Symbol 10 Sound [Spike]Used by:18
Symbol 11 Sound [Slow]Used by:18
Symbol 12 Sound [Fast]Used by:18
Symbol 13 Sound [Big]Used by:18
Symbol 14 Sound [Small]Used by:18
Symbol 15 Sound [Acceleration]Used by:18
Symbol 16 Sound [Velocity]Used by:18
Symbol 17 Sound [Position]Used by:18
Symbol 18 MovieClipUses:8 9 10 11 12 13 14 15 16 17Used by:Timeline
Symbol 19 GraphicUsed by:Timeline
Symbol 20 GraphicUsed by:22 24 26 44 46 50
Symbol 21 TextUses:6Used by:22
Symbol 22 MovieClipUses:20 21Used by:Timeline
Symbol 23 TextUses:6Used by:24
Symbol 24 MovieClipUses:20 23Used by:Timeline
Symbol 25 TextUses:6Used by:26
Symbol 26 MovieClipUses:20 25Used by:Timeline
Symbol 27 TextUses:6Used by:Timeline
Symbol 28 GraphicUsed by:30 35 37
Symbol 29 TextUses:6Used by:30
Symbol 30 MovieClipUses:28 29Used by:Timeline
Symbol 31 GraphicUsed by:33 40 53  Timeline
Symbol 32 TextUses:6Used by:33
Symbol 33 MovieClipUses:31 32Used by:Timeline
Symbol 34 TextUses:6Used by:35
Symbol 35 MovieClipUses:28 34Used by:Timeline
Symbol 36 TextUses:6Used by:37
Symbol 37 MovieClipUses:28 36Used by:Timeline
Symbol 38 TextUses:6Used by:Timeline
Symbol 39 TextUses:6Used by:40 52
Symbol 40 MovieClipUses:31 39Used by:Timeline
Symbol 41 GraphicUsed by:Timeline
Symbol 42 TextUses:6Used by:Timeline
Symbol 43 TextUses:6Used by:44
Symbol 44 MovieClipUses:20 43Used by:Timeline
Symbol 45 TextUses:6Used by:46
Symbol 46 MovieClipUses:20 45Used by:Timeline
Symbol 47 TextUses:6Used by:Timeline
Symbol 48 TextUses:6Used by:Timeline
Symbol 49 TextUses:6Used by:50
Symbol 50 MovieClipUses:20 49Used by:Timeline
Symbol 51 GraphicUsed by:52
Symbol 52 MovieClipUses:51 39Used by:Timeline
Symbol 53 MovieClipUses:31Used by:Timeline
Symbol 54 TextUses:6Used by:Timeline

Instance Names

"jig_btn"Frame 16Symbol 4 MovieClip [button1_mc]
"axcho_btn"Frame 16Symbol 22 MovieClip
"rider_btn"Frame 16Symbol 24 MovieClip
"twig_btn"Frame 16Symbol 26 MovieClip
"about_btn"Frame 16Symbol 30 MovieClip
"new_btn"Frame 16Symbol 33 MovieClip
"continue_btn"Frame 16Symbol 35 MovieClip
"scores_btn"Frame 16Symbol 37 MovieClip
"back_btn"Frame 23Symbol 40 MovieClip
"axcho_btn"Frame 28Symbol 44 MovieClip
"rider_btn"Frame 28Symbol 46 MovieClip
"twig_btn"Frame 28Symbol 50 MovieClip
"back_btn"Frame 28Symbol 52 MovieClip
"egg_btn"Frame 28Symbol 53 MovieClip
"button_mc"Symbol 4 MovieClip [button1_mc] Frame 1Symbol 3 MovieClip

Special Tags

FileAttributes (69)Timeline Frame 1Access local files only, Metadata present, AS1/AS2.
SWFMetaData (77)Timeline Frame 1495 bytes "<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns ..."
Protect (24)Timeline Frame 131 bytes "..$1$pu$2NtsOIX2mbkBDG2keDSEP/."
ExportAssets (56)Timeline Frame 1Symbol 4 as "button1_mc"
ExportAssets (56)Timeline Frame 1Symbol 6 as "dRiveFont"
ExportAssets (56)Timeline Frame 1Symbol 55 as "__Packages.MochiAd"
ExportAssets (56)Timeline Frame 1Symbol 56 as "__Packages.dRiveGraphics"
ExportAssets (56)Timeline Frame 1Symbol 57 as "__Packages.dRiveGame"
ExportAssets (56)Timeline Frame 1Symbol 58 as "__Packages.dRiveTrack"
ExportAssets (56)Timeline Frame 1Symbol 59 as "__Packages.dRiveGraph"
ExportAssets (56)Timeline Frame 1Symbol 60 as "__Packages.mx.utils.Delegate"
ExportAssets (56)Timeline Frame 1Symbol 61 as "__Packages.mochi.MochiServices"
ExportAssets (56)Timeline Frame 1Symbol 62 as "__Packages.mochi.MochiScores"
ExportAssets (56)Timeline Frame 9Symbol 9 as "Life"
ExportAssets (56)Timeline Frame 9Symbol 10 as "Spike"
ExportAssets (56)Timeline Frame 9Symbol 11 as "Slow"
ExportAssets (56)Timeline Frame 9Symbol 12 as "Fast"
ExportAssets (56)Timeline Frame 9Symbol 13 as "Big"
ExportAssets (56)Timeline Frame 9Symbol 14 as "Small"
ExportAssets (56)Timeline Frame 9Symbol 15 as "Acceleration"
ExportAssets (56)Timeline Frame 9Symbol 16 as "Velocity"
ExportAssets (56)Timeline Frame 9Symbol 17 as "Position"
Tag 0x0FF (255)Timeline Frame 11 bytes "."

Labels

"preloader"Frame 1
"initialize"Frame 9
"menu"Frame 16
"game"Frame 22
"credits"Frame 28




http://swfchan.com/11/51506/info.shtml
Created: 24/4 -2019 22:57:02 Last modified: 24/4 -2019 22:57:02 Server time: 08/05 -2024 22:39:55