Frame 1
NewgroundsAPI.connectMovie(4500);
Frame 2
function 53() {
_root.ins._visible = false;
gotoAndPlay (3);
eng.init();
eng.sm.playSound(1);
}
var eng;
stop();
if (!eng) {
eng = new PegsMain();
}
_root.play_btn.onRelease = function () {
53();
};
_root.inst_btn.onRelease = function () {
_root.ins.gotoAndPlay(2);
eng.sm.playSound(1);
};
Frame 3
_root.onEnterFrame = function () {
eng.mainLoop();
};
Frame 5
if (_root._currentframe == 5) {
gotoAndPlay ("loop");
}
Frame 6
_root.replay_btn.onRelease = function () {
_root.gotoAndPlay(2);
};
Symbol 7 MovieClip [x3] Frame 10
removeMovieClip(this);
Symbol 10 MovieClip [x4] Frame 10
removeMovieClip(this);
Symbol 30 MovieClip [whiteFade] Frame 19
removeMovieClip(this);
Symbol 53 MovieClip Frame 40
stop();
Symbol 67 Button
on (press) {
tellTarget (_root) {
nextFrame();
};
}
Symbol 68 Button
on (press) {
gotoAndStop ("end");
_root.play();
}
Instance of Symbol 43 MovieClip in Symbol 69 MovieClip Frame 1
onClipEvent (load) {
_root.stop();
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndStop("lastframe");
}
}
onClipEvent (enterFrame) {
PercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
if (PercentLoaded != 100) {
_parent.gotoAndStop(PercentLoaded);
} else {
_parent.gotoAndPlay("loaded");
}
}
Symbol 69 MovieClip Frame 101
play();
Symbol 69 MovieClip Frame 165
stop();
Symbol 75 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 80 Button
on (release) {
NewgroundsAPI.loadNewgrounds();
}
Symbol 82 MovieClip Frame 1
function 39(_arg1) {
"opening " + _arg1;
System.security.allowDomain("70.87.128.99");
System.security.allowInsecureDomain("70.87.128.99");
System.security.allowDomain("ads.shizmoo.com");
System.security.allowInsecureDomain("ads.shizmoo.com");
System.security.allowDomain("www.cpmstar.com");
System.security.allowInsecureDomain("www.cpmstar.com");
System.security.allowDomain("server.cpmstar.com");
System.security.allowInsecureDomain("server.cpmstar.com");
var ngads_redirect = new XML();
ngads_redirect.ignoreWhite = true;
ngads_redirect.onLoad = function (_arg1) {
if (_arg1) {
ng_ad.loadMovie(ngads_redirect.toString(), "GET");
}
};
ngads_redirect.load(_arg1);
}
if (NewgroundsAPI.getAdURL()) {
39(NewgroundsAPI.getAdURL());
}
NewgroundsAPI.onAdsApproved = function (_arg1) {
39(_arg1);
};
stop();
Symbol 122 MovieClip [__Packages.NewgroundsAPI] Frame 0
class NewgroundsAPI
{
static var tracker_id, host, version, debug, error_format, header_format, normal_format, link_format;
function NewgroundsAPI () {
}
static function connectMovie(_arg1) {
if (!_arg1) {
SendError("Missing required 'id' parameter in NewgroundsAPI.connectMovie(id:Number)");
} else if (!tracker_id) {
SendMessage("Connecting to API gateway...");
tracker_id = _arg1;
host = _url.split("/")[2].toLowerCase();
if (host.length < 1) {
host = "localhost";
}
var _local2 = new Object();
SendEvent(MOVIE_VIEWS);
}
}
static function setMovieVersion(_arg1) {
if (!_arg1) {
SendError("Missing required 'version' in NewgroundsAPI.setMovieVersion(version:String)");
} else {
version = _arg1;
}
}
static function debugMode() {
debug = true;
}
static function addCustomEvent(_arg2, $) {
if (!_arg2) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else if (!$) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.AddCustomEvent(id:Number, event_name:String)");
} else {
custom_events[$] = CUSTOM_STATS + _arg2;
SendMessage("Created custom event: " + $);
}
}
static function addCustomLink(_arg1, $) {
if (!_arg1) {
SendError("Missing required 'id' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else if (!$) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.AddCustomLink(id:Number, link_name:String)");
} else {
custom_links[$] = CUSTOM_STATS + _arg1;
SendMessage((("Created custom link " + _arg1) + ": ") + $);
}
}
static function loadMySite() {
SendLink(AUTHOR_SITE);
}
static function loadNewgrounds(_arg3) {
if (_arg3) {
var _local1 = {page:_arg3};
}
SendLink(NEWGROUNDS, _local1);
}
static function logCustomEvent(_arg1) {
if (!_arg1) {
SendError("Missing required 'event_name' parameter in NewgroundsAPI.logCustomEvent(event_name:String)");
} else if (!custom_events[_arg1]) {
SendError("Attempted to log undefined custom event: " + _arg1);
} else {
SendEvent(custom_events[_arg1]);
}
}
static function loadCustomLink(_arg1) {
if (!_arg1) {
SendError("Missing required 'link_name' parameter in NewgroundsAPI.loadCustomLink(link_name:String)");
} else if (!custom_links[_arg1]) {
SendError("Attempted to open undefined custom link: " + _arg1);
} else {
SendLink(custom_links[_arg1]);
}
}
static function getAdURL() {
return(movie_options.ad_url);
}
static function getMovieURL() {
if (movie_options.movie_url) {
return(movie_options.movie_url);
}
return("Newgrounds.com");
}
static function getNewVersionURL() {
return((((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + NEW_VERSION);
}
static function SendEvent(_arg1) {
SendStat(_arg1, false);
}
static function SendLink(_arg2, _arg1) {
SendStat(_arg2, true, _arg1);
}
static function ReadGatewayData(params) {
for (var _local2 in params) {
params[_local2] = unescape(params[_local2]);
movie_options[_local2] = params[_local2];
}
if (params.settings_loaded) {
SendMessage("You have successfully connected to the Newgrounds API gateway!");
SendMessage(("Movie Identified as '" + movie_options.movie_name) + "'");
if (movie_options.message) {
SendMessage(movie_options.message);
}
if (movie_options.ad_url) {
SendMessage("Your movie has been approved to run Flash Ads");
onAdsApproved(movie_options.ad_url);
}
if (movie_options.movie_version and (movie_options.movie_version.toString() != version.toString())) {
SendMessage("WARNING: The movie version configured in your API settings does not match this movie's version!");
onNewVersionAvailable(movie_options.movie_version, getMovieURL(), getNewVersionURL());
}
if (movie_options.deny_host) {
SendMessage("You have blocked 'localHost' in your API settings.");
SendMessage("If you wish to test your movie you will need to remove this block.");
onDenyHost(host, getMovieURL(), getNewVersionURL());
}
if (movie_options.request_portal_url == 1) {
var _local4 = (((GATEWAY_URL + "?&id=") + tracker_id) + "&portal_url=") + escape(_url);
var _local3 = new XML();
_local3.ignoreWhite = true;
_local3.load(_local4);
}
} else if (!movie_options.settings_loaded) {
SendError("Could not establish connection to the API gateway.");
}
}
static function SendStat(_arg11, _arg12, _arg6) {
if (!tracker_id) {
SendError("API calls cannot be made without a valid movie id.");
SendError("Did you remember to add the \"NewgroundsAPI.connectMovie()\" code?");
} else {
var _local7 = (((((GATEWAY_URL + "?&id=") + tracker_id) + "&host=") + escape(host)) + "&stat=") + _arg11;
for (var _local9 in _arg6) {
_local7 = _local7 + ((("&" + escape(_local9)) + "=") + escape(_arg6[_local9]));
}
if (debug) {
_local7 = _local7 + "&debug=1";
}
if (_arg12) {
getURL (_local7, "_blank");
} else {
var _local10 = new XML();
_local10.ignoreWhite = true;
_local10.onLoad = function (_param1) {
var _local6 = new Object();
var _local3 = 0;
while (_local3 < this.firstChild.childNodes.length) {
var _local4 = this.firstChild.childNodes[_local3];
var _local5 = _local4.nodeName;
var _local2 = _local4.attributes.value;
if (_local2 == Number(_local2)) {
_local2 = Number(_local2);
}
_local6[_local5] = _local2;
_local3++;
}
NewgroundsAPI.ReadGatewayData(_local6);
};
_local10.load(_local7);
}
}
}
static function SendError(_arg1) {
"[NEWGROUNDS API ERROR] :: " + _arg1;
}
static function SendMessage(_arg1) {
"[NEWGROUNDS API] :: " + _arg1;
}
static function InitTextFormats() {
if (!error_format) {
error_format = new TextFormat();
error_format.font = "Arial Black";
error_format.size = 48;
error_format.color = 16711680 /* 0xFF0000 */;
}
if (!header_format) {
header_format = new TextFormat();
header_format.font = "Arial Black";
header_format.size = 24;
header_format.color = 16777215 /* 0xFFFFFF */;
}
if (!normal_format) {
normal_format = new TextFormat();
normal_format.font = "Arial";
normal_format.bold = true;
normal_format.size = 12;
normal_format.color = 16777215 /* 0xFFFFFF */;
}
if (!link_format) {
link_format = new TextFormat();
link_format.color = 16776960 /* 0xFFFF00 */;
link_format.underline = true;
}
}
static function onNewVersionAvailable(_arg6, _arg7, _arg8) {
InitTextFormats();
var _local2 = new Object();
_local2.x = Stage.width / 2;
_local2.y = Stage.height / 2;
_root.createEmptyMovieClip("NGAPI_new_version_overlay", _root.getNextHighestDepth());
_root.NGAPI_new_version_overlay.lineStyle(1, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(0, 70);
_root.NGAPI_new_version_overlay.moveTo(-10, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, 1000);
_root.NGAPI_new_version_overlay.lineTo(1000, -10);
_root.NGAPI_new_version_overlay.lineTo(-10, -10);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.lineStyle(10, 0, 100);
_root.NGAPI_new_version_overlay.beginFill(51);
_root.NGAPI_new_version_overlay.moveTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.lineTo(_local2.x + 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y + 80);
_root.NGAPI_new_version_overlay.lineTo(_local2.x - 240, _local2.y - 120);
_root.NGAPI_new_version_overlay.endFill();
_root.NGAPI_new_version_overlay.createEmptyMovieClip("exit", 1000);
_root.NGAPI_new_version_overlay.exit.lineStyle(2, 39423, 100);
_root.NGAPI_new_version_overlay.exit.beginFill(0, 50);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 230, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 90);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 210, _local2.y - 110);
_root.NGAPI_new_version_overlay.exit.endFill();
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 214, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 226, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.moveTo(_local2.x + 226, _local2.y - 106);
_root.NGAPI_new_version_overlay.exit.lineTo(_local2.x + 214, _local2.y - 94);
_root.NGAPI_new_version_overlay.exit.onMouseUp = function () {
if (_root.NGAPI_new_version_overlay.exit.hitTest(_root._xmouse, _root._ymouse)) {
_root.NGAPI_new_version_overlay.removeMovieClip();
}
};
var _local3 = (("Version " + _arg6) + " is now available at:") + newline;
var _local5 = _local3.length;
_local3 = _local3 + _arg7;
var _local4 = _local3.length;
_root.NGAPI_new_version_overlay.createTextField("mouseblocker", 99, -10, -10, 1000, 1000);
_root.NGAPI_new_version_overlay.createTextField("newversion", 100, _local2.x - 210, _local2.y - 90, 400, 80);
_root.NGAPI_new_version_overlay.newversion.text = "New Version Available!";
_root.NGAPI_new_version_overlay.newversion.setTextFormat(header_format);
_root.NGAPI_new_version_overlay.createTextField("message", 101, (Stage.width - 400) / 2, Stage.height / 2, 400, 40);
_root.NGAPI_new_version_overlay.message.text = _local3;
_root.NGAPI_new_version_overlay.message.multiline = true;
_root.NGAPI_new_version_overlay.message.wordWrap = true;
_root.NGAPI_new_version_overlay.message.html = true;
_root.NGAPI_new_version_overlay.message.setTextFormat(normal_format);
link_format.url = _arg8;
_root.NGAPI_new_version_overlay.message.setTextFormat(_local5, _local4, link_format);
}
static function onDenyHost(_arg7, _arg5, _arg6) {
InitTextFormats();
_root.createEmptyMovieClip("NGAPI_deny_host_overlay", _root.getNextHighestDepth());
_root.NGAPI_deny_host_overlay.lineStyle(20, 0, 100);
_root.NGAPI_deny_host_overlay.beginFill(6684672);
_root.NGAPI_deny_host_overlay.moveTo(0, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, 0);
_root.NGAPI_deny_host_overlay.lineTo(Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, Stage.height);
_root.NGAPI_deny_host_overlay.lineTo(0, 0);
_root.NGAPI_deny_host_overlay.endFill();
var _local2 = ("This movie has not been approved for use on " + _arg7) + ".";
_local2 = _local2 + "\r\rFor an aproved copy, please visit:\r";
var _local4 = _local2.length;
_local2 = _local2 + _arg5;
var _local3 = _local2.length;
_root.NGAPI_deny_host_overlay.createTextField("mousekill", 100, 0, 0, Stage.width, Stage.height);
_root.NGAPI_deny_host_overlay.createTextField("error", 101, (Stage.width - 400) / 2, (Stage.height / 2) - 100, 400, 200);
_root.NGAPI_deny_host_overlay.error.text = "ERROR!";
_root.NGAPI_deny_host_overlay.error.setTextFormat(error_format);
_root.NGAPI_deny_host_overlay.createTextField("message", 102, (Stage.width - 400) / 2, Stage.height / 2, 400, 200);
_root.NGAPI_deny_host_overlay.message.text = _local2;
_root.NGAPI_deny_host_overlay.message.multiline = true;
_root.NGAPI_deny_host_overlay.message.wordWrap = true;
_root.NGAPI_deny_host_overlay.message.html = true;
_root.NGAPI_deny_host_overlay.message.setTextFormat(normal_format);
link_format.url = _arg6;
_root.NGAPI_deny_host_overlay.message.setTextFormat(_local4, _local3, link_format);
}
static function isInstalled() {
return(true);
}
static function onAdsApproved(59) {
}
static var movie_options = new Object();
static var custom_events = new Object();
static var custom_links = new Object();
static var MOVIE_VIEWS = 1;
static var AUTHOR_SITE = 2;
static var NEWGROUNDS = 3;
static var NEW_VERSION = 4;
static var CUSTOM_STATS = 50;
static var GATEWAY_URL = "http://www.ngads.com/gateway.php";
}
Symbol 123 MovieClip [__Packages.PegsMain] Frame 0
class PegsMain
{
var statusbar, sm, input, board, em, newTime, oldTime, state, timeCount;
function PegsMain () {
statusbar = new StatusBar();
sm = new SoundManager();
input = new Input();
board = new Board();
em = new EffectManager(board.bw);
}
function init() {
newTime = (oldTime = getTimer());
_root.restart_btn.onPress = function () {
_root.eng.restart();
};
_root.sound_btn.onPress = function () {
_root.eng.sm.toggle();
};
curLevel = 0;
board.loadLevel(curLevel);
state = S_LL;
statusbar.setText("Welcome to Pegs, there are 15 levels. Good Luck!", 5);
}
function restart() {
if (state == S_PLAY) {
board.loadLevel(curLevel);
state = S_LL;
}
}
function procInput(_param1) {
if ((state != S_PLAY) && (state != S_MAGIC)) {
return(undefined);
}
if (input.getKey(82)) {
restart();
}
if (state == S_MAGIC) {
if (input.getKey(38)) {
board.magicChange(1);
}
if (input.getKey(40)) {
board.magicChange(-1);
}
if (input.getKey(32)) {
board.magicChange(0);
state = S_PLAY;
}
return(undefined);
}
if (input.getKey(33)) {
if (curLevel < 14) {
board.loadLevel(++curLevel);
state = S_LL;
}
}
if (input.getKey(34)) {
if (curLevel >= 1) {
board.loadLevel(--curLevel);
state = S_LL;
}
}
if (input.getKey(37)) {
move(-1, 0);
}
if (input.getKey(39)) {
move(1, 0);
}
if (input.getKey(38)) {
move(0, -1);
}
if (input.getKey(40)) {
move(0, 1);
}
}
function move(_arg4, _arg3) {
var _local2 = board.move(_arg4, _arg3);
if (_local2 == 2) {
delay = 1;
board.loadLevel(curLevel);
statusbar.setText("You fell into a hole!", 1.5);
state = S_LL;
} else if (_local2 == 1) {
if (first) {
first = false;
statusbar.setText("Pick a new peg with up, down and space", 6);
}
state = S_MAGIC;
} else if (board.checkWin()) {
sm.playSound(3);
if (board.loadLevel(++curLevel)) {
state = S_LL;
statusbar.setText("Nice Pegging!", 3);
delay = 3.5;
} else {
statusbar.setText("You win!!!! Stand by for credits...", 7);
delay = 5;
state = S_ICREDITS;
}
}
}
function pegsLoop() {
statusbar.update(eTime);
em.update(eTime);
if (delay > 0) {
delay = delay - eTime;
return(undefined);
}
switch (state) {
case S_PLAY :
procInput(eTime);
break;
case S_MAGIC :
procInput(eTime);
break;
case S_GG :
break;
case S_LL :
if (board.dd()) {
if (curLevel != 0) {
statusbar.setText("Level " + (curLevel + 1), 4);
}
state = S_PLAY;
}
break;
case S_ICREDITS :
cleanup();
_root.gotoAndStop("credits");
state = S_CREDITS;
break;
case S_CREDITS :
}
}
function cleanup() {
em.cleanup();
board.clear();
}
function mainLoop() {
newTime = getTimer();
eTime = newTime - oldTime;
oldTime = newTime;
eTime = eTime / 1000;
timeCount = timeCount + eTime;
fc++;
if (timeCount >= 1) {
_root.fpsText.text = "FPS: " + fc;
timeCount = (fc = 0);
}
pegsLoop();
}
var fc = 0;
var eTime = 0;
var delay = 0;
var S_PAUSE = 0;
var S_PLAY = 1;
var S_GG = 2;
var S_MAGIC = 3;
var S_LL = 4;
var S_CREDITS = 5;
var S_ICREDITS = 6;
var curLevel = 0;
var first = true;
}
Symbol 124 MovieClip [__Packages.Input] Frame 0
class Input
{
function Input () {
Key.addListener(this);
var _local2 = 0;
while (_local2 < keys.length) {
keys[_local2] = -1;
_local2++;
}
}
function onKeyDown() {
var _local2 = Key.getCode();
keys[_local2] = 1;
}
function onKeyUp() {
keys[Key.getCode()] = -1;
}
function getKey(_arg3) {
var _local2 = keys[_arg3];
if (_local2 != -1) {
keys[_arg3] = 0;
}
return(_local2 == 1);
}
function peekKey(_arg2) {
return(keys[_arg2] == 1);
}
var keys = new Array(256);
}
Symbol 125 MovieClip [__Packages.Board] Frame 0
class Board
{
var slvls, data, mx, my, dm, px, py, ddix, ddiy;
function Board () {
slvls = new Array(slvl1, slvl2, slvl3, slvl4, slvl5, slvl6, slvl7, slvl8, slvl9, slvl10, slvl11, slvl12, slvl13, slvl14, slvl15);
data = Util.genArray(h, w);
}
function magicChange(_arg3) {
if (_arg3 == 0) {
_root.eng.em.removeMagic();
} else {
remove(mx, my);
if (_arg3 == -1) {
_arg3 = 3;
}
dm = (((dm + _arg3) - 2) % 4) + 2;
addp(mx, my, dm);
_root.eng.sm.playSound(1);
_root.eng.em.addEffect(mx, my, 0);
}
}
function move(_arg12, _arg11) {
var _local10 = 0;
var _local7 = px + _arg12;
var _local6 = py + _arg11;
if ((((_local7 < 0) || (_local6 < 0)) || (_local7 >= w)) || (_local6 >= h)) {
return(-1);
}
var _local5 = data[_local6][_local7];
var _local4 = px + (_arg12 * 2);
var _local3 = py + (_arg11 * 2);
var _local8;
if ((((_local4 < 0) || (_local3 < 0)) || (_local4 >= w)) || (_local3 >= h)) {
_local8 = 9;
} else {
_local8 = data[_local3][_local4];
}
var _local9 = false;
if (_local5 == T_BLANK) {
_root.eng.sm.playSound(2);
_local9 = true;
} else if ((_local5 > 0) && (_local5 < 6)) {
if (_local8 == T_HOLE) {
_local9 = true;
remove(_local7, _local6);
_root.eng.sm.playSound(0);
if (_local5 == T_SQUARE) {
remove(_local4, _local3);
_root.eng.em.addEffect(_local4, _local3, 0);
} else {
_root.eng.em.addFall(_local4, _local3, 1, _local5);
}
} else if (_local8 == _local5) {
_local9 = true;
remove(_local7, _local6);
remove(_local4, _local3);
if (_local5 == T_MAGIC) {
mx = _local4;
my = _local3;
dm = T_TRIANGLE;
addp(_local4, _local3, T_TRIANGLE);
_root.eng.em.addMagic(_local4, _local3, dm);
_root.eng.em.addEffect(_local4, _local3, 0);
_root.eng.sm.playSound(0);
_local10 = 1;
} else if (_local5 == T_TRIANGLE) {
addp(_local4, _local3, T_WALL);
_root.eng.em.addEffect(_local4, _local3, 0);
_root.eng.sm.playSound(0);
} else {
_root.eng.em.addREffect(_local7, _local6, _local5);
_root.eng.em.addREffect(_local4, _local3, _local5);
_root.eng.sm.playSound(0);
}
} else if (_local8 == T_BLANK) {
_root.eng.sm.playSound(2);
_local9 = true;
remove(_local7, _local6);
addp(_local4, _local3, _local5);
} else if ((_local8 >= 2) && (_local8 <= 5)) {
_root.eng.statusbar.setText("Only two identical pegs can be pushed together", 2);
}
} else if (_local5 == T_HOLE) {
_root.eng.sm.playSound(2);
remove(px, py);
_local10 = 2;
_root.eng.em.addFall(_local7, _local6, 1, 1);
}
if (_local9) {
remove(px, py);
addp(_local7, _local6, T_PUSHER);
px = _local7;
py = _local6;
}
return(_local10);
}
function remove(_arg4, _arg3) {
if (data[_arg3][_arg4] != 0) {
_root[(_arg4 + "b") + _arg3].removeMovieClip();
data[_arg3][_arg4] = 0;
}
}
function addp(_arg5, _arg4, type) {
if (data[_arg4][_arg5] != 0) {
remove(_arg5, _arg4);
}
data[_arg4][_arg5] = type;
var _local3 = _root.attachMovie("p" + type, (_arg5 + "b") + _arg4, BD++);
if (BD > DEND) {
BD = DSTART;
}
_local3._x = bw * _arg5;
_local3._y = bw * _arg4;
}
function checkWin() {
var _local3 = 0;
while (_local3 < h) {
var _local2 = 0;
while (_local2 < w) {
if ((data[_local3][_local2] > 1) && (data[_local3][_local2] < 6)) {
return(false);
}
_local2++;
}
_local3++;
}
return(true);
}
function clear() {
var _local3 = 0;
while (_local3 < h) {
var _local2 = 0;
while (_local2 < w) {
remove(_local2, _local3);
_local2++;
}
_local3++;
}
}
function loadLevel(_arg4) {
if ((_arg4 < 0) || (_arg4 >= numLevels)) {
return(false);
}
var _local5 = 0;
var _local3 = 0;
while (_local3 < h) {
var _local2 = 0;
while (_local2 < w) {
data[_local3][_local2] = slvls[_arg4].charAt(_local5++);
if (data[_local3][_local2] == 1) {
px = _local2;
py = _local3;
}
_local2++;
}
_local3++;
}
ddix = (ddiy = 0);
return(true);
}
function dd() {
var _local3 = ddix;
var _local4 = ddiy;
while ((_local4 < h) && (_local3 >= 0)) {
_root[(_local3 + "b") + _local4].removeMovieClip();
if (((data[_local4][_local3] != 0) && (data[_local4][_local3] != 8)) && (data[_local4][_local3] != 7)) {
var _local5 = _root.attachMovie("p" + data[_local4][_local3], (_local3 + "b") + _local4, BD++);
if (BD > DEND) {
BD = DSTART;
}
_local5._x = bw * _local3;
_local5._y = bw * _local4;
}
_root.eng.em.addEffect(_local3, _local4, 0);
_local4++;
_local3--;
}
if (ddix < (w - 1)) {
ddix++;
} else if (ddiy < (h - 1)) {
ddiy++;
} else {
return(true);
}
return(false);
}
var slvl1 = "999999999999900000000009900010030009900005520009900046030009900000000009900000000009999999999999";
var slvl2 = "999999999999999000220009999000900009999000990009100022330009999000990009999000900009999000220009";
var slvl3 = "999999999999999999999999900000201000909909909929900200000009999999999929999999999999999999999999";
var slvl4 = "999999999999604020200009605030200009603041200009602040205009604030200009603040200009999999999999";
var slvl5 = "066046006000066044006002266066609222066064609202066061636000266066606000066040006000066003006330";
var slvl6 = "000001000000200000000050200200022000099299999990000000000000099990990999050000003460000999900999";
var slvl7 = "999900999999999600460999999909390999999255142699999909290009999900300909999999909909999999900009";
var slvl8 = "999999999999005555545500005552553500005552554500005543555500105532555500005524555500999999999999";
var slvl9 = "000099000000050099000000000024450990090029000999000221900002000029009999059023300050000049000000";
var slvl10 = "999929990000999909990001004066600040055066604540055066604540000066605000999990990000999992990000";
var slvl11 = "919099600990900034660220929209600220900209000550929009090550000009099090054509090000000022299999";
var slvl12 = "100000999999929292990009000000900909929292900009000000993369929292990229000000000029909999990099";
var slvl13 = "999999999999004020304006002030204006105040304006003040204006004020304006005050204006999999999999";
var slvl14 = "999990090099990200400209960039099009999005350099990990093006990200400019990090099999999999999999";
var slvl15 = "000606060609000606060609054606060602040606460609050606060609100646060609004606064609004606060609";
var T_WALL = 9;
var T_BLANK = 0;
var T_HOLE = 6;
var T_SQUARE = 4;
var T_MAGIC = 5;
var T_CIRCLE = 3;
var T_TRIANGLE = 2;
var T_PUSHER = 1;
var DSTART = 100;
var DEND = 2000;
var BD = Board.prototype.DSTART;
var numLevels = 15;
var w = 12;
var h = 8;
var bw = 40;
}
Symbol 126 MovieClip [__Packages.Util] Frame 0
class Util
{
function Util () {
}
static function genArray(_arg4, _arg3) {
var _local2 = new Array();
var _local1 = 0;
while (_local1 < _arg4) {
_local2.push(new Array(_arg3));
_local1++;
}
return(_local2);
}
}
Symbol 127 MovieClip [__Packages.StatusBar] Frame 0
class StatusBar
{
var delay, enq;
function StatusBar () {
_root.status.stop();
delay = -1;
}
function setText(_arg4, _arg3) {
if (isClear) {
_root.status.test.stext.text = _arg4;
_root.status.gotoAndPlay(_root.status._currentframe + 1);
delay = _arg3;
isClear = false;
} else {
delay = 0;
enq = _arg4;
et = _arg3;
}
}
function update(_arg3) {
if (!isClear) {
if (_root.status._currentframe == 1) {
isClear = true;
_root.status.stop();
if (et != 0) {
setText(enq, et);
et = 0;
}
} else {
delay = delay - _arg3;
if ((delay < 0) && (_root.status._currentframe == 15)) {
_root.status.gotoAndPlay("continue");
}
}
}
}
var et = 0;
var isClear = true;
}
Symbol 128 MovieClip [__Packages.EffectManager] Frame 0
class EffectManager
{
var elist, bw, magic_mc, mt;
function EffectManager (_arg2) {
elist = new Array();
bw = _arg2;
}
function addREffect(_arg4, _arg5, _arg6) {
var _local3 = _root.attachMovie("x" + _arg6, (("xx" + _arg5) + "-") + _arg4, ED++);
if (ED > DEND) {
ED = DSTART;
}
_local3._x = _arg4 * bw;
_local3._y = _arg5 * bw;
}
function addMagic(_arg3, _arg4, _arg5) {
magic_mc = _root.attachMovie("magica", (("mag" + _arg4) + "-") + _arg3, ED++);
magic_mc._x = _arg3 * bw;
magic_mc._y = _arg4 * bw;
mt = _arg5;
}
function removeMagic() {
magic_mc.removeMovieClip();
}
function addFall(_arg4, _arg6, _arg5, _arg7) {
if (!(_arg5 === FALL)) {
} else {
var _local3 = _root.attachMovie("p" + _arg7, (("f" + _arg6) + "-") + _arg4, ED++);
if (ED > DEND) {
ED = DSTART;
}
_local3._x = _arg4 * bw;
_local3._y = _arg6 * bw;
_local3.type = _arg5;
elist.push(_local3);
}
}
function addEffect(_arg4, _arg5, _arg6) {
if (!(_arg6 === FLASH)) {
} else {
var _local3 = _root.attachMovie("whiteFade", (("wf" + _arg5) + "-") + _arg4, ED++);
if (ED > DEND) {
ED = DSTART;
}
_local3._x = _arg4 * bw;
_local3._y = _arg5 * bw;
}
}
function update(_param1) {
var _local3 = 0;
while (_local3 < elist.length) {
var _local2 = elist[_local3];
if (!(_local2.type === FALL)) {
} else {
_local2._width = _local2._width - 2;
_local2._x++;
_local2._height = _local2._height - 2;
_local2._y++;
if (_local2._width <= 0) {
_local2.removeMovieClip();
elist.splice(_local3, 1);
}
}
_local3++;
}
}
function cleanup() {
while (elist.length > 0) {
elist.shift().removeMovieClip();
}
}
var FLASH = 0;
var FALL = 1;
var DSTART = 5000;
var DEND = 10000;
var ED = EffectManager.prototype.DSTART;
}
Symbol 129 MovieClip [__Packages.SoundManager] Frame 0
class SoundManager
{
function SoundManager () {
clips[POP] = new Sound();
clips[POP].attachSound("pop.wav");
clips[MOVE] = new Sound();
clips[MOVE].attachSound("tap.wav");
clips[PLINK] = new Sound();
clips[PLINK].attachSound("plink.wav");
clips[WIN] = new Sound();
clips[WIN].attachSound("win.wav");
clips[WIN].setVolume(50);
_root.hudd.muted.gotoAndStop("on");
}
function update() {
}
function toggle() {
if (muted) {
_root.zz.text = "Turn Sound Off";
muted = false;
} else {
_root.zz.text = "Turn Sound On";
stopAllSounds();
muted = true;
}
}
function playSound(_arg2) {
if (!muted) {
clips[_arg2].start();
}
}
var POP = 0;
var MOVE = 2;
var PLINK = 1;
var WIN = 3;
var clips = new Array(3);
var muted = false;
var ep = false;
}
Symbol 101 MovieClip Frame 1
stop();
Symbol 101 MovieClip Frame 30
stop();
play_btn2.onRelease = function () {
_root.53();
};
_root.inst_btn._visible = false;
_root.play_btn._visible = false;
Symbol 118 MovieClip Frame 15
stop();
Symbol 120 MovieClip Frame 401
stop();