Frame 1
gameName = "parksoccer";
version = "040624";
Frame 2
if (_level0.getBytesLoaded() < _level0.getBytesTotal()) {
gotoAndPlay (1);
title = ("loading " + int(_level0.getBytesTotal() / 1024)) + " kbyte...";
percent = int((_level0.getBytesLoaded() / _level0.getBytesTotal()) * 100) + " %";
}
Frame 4
this.timer = createEmptyMovieClip("timer", 99);
this.timer.running = false;
timer.init = function (timeTotal) {
this.timeTotal = timeTotal * 1000;
this.timeStart = getTimer();
_root.timeLeft = this.timeTotal;
this.running = false;
this.update();
};
timer.onEnterFrame = function () {
if (_root.paused) {
this.timestamp = getTimer();
return(undefined);
}
_global.dt = ((getTimer() - this.timestamp) * 0.3) + (_global.dt * 0.7);
this.timestamp = getTimer();
if (this.running) {
_root.timeLeft = _root.timeLeft - ((_global.dt * 33) * this.speed);
}
this.update();
};
timer.update = function () {
if (_root.paused) {
return(undefined);
}
if ((_root.timeLeft <= -0.5) && (this.running)) {
this.running = false;
}
};
timer.alter = function (d) {
_root.timeLeft = Math.max(0, _root.timeLeft + d);
this.update();
};
timer.timestamp = getTimer();
snd = new Object();
snd.lib = new Array();
snd.global = new Sound();
snd.active = 1;
snd.actMc = 0;
snd.idMc = 0;
snd.mcs = new Array();
var i = 0;
while (i < 10) {
snd.mcs[i] = _root.createEmptyMovieClip("sndMc" + this.idMc, this.idMc++);
i++;
}
snd.load = function (id, volume) {
if (volume eq "") {
volume = 100;
}
var mc = _root.createEmptyMovieClip("sndMc" + this.idMc, this.idMc++);
this.lib[id] = new Sound(mc);
this.lib[id].mc = mc;
this.lib[id].attachSound(id);
this.lib[id].setVolume(volume);
};
snd.play = function (id) {
if (!this.active) {
return(undefined);
}
this.lib[id].start(id);
this.lib[id].setVolume(100);
};
snd.playLoop = function (id) {
this.lib[id].start(id, 99999);
this.lib[id].playing = 1;
};
snd.playEvent = function (id, volume) {
if (!this.active) {
return(undefined);
}
if (volume === undefined) {
volume = 1;
}
volume = Math.max(0, Math.min(1, volume));
var mc = this.getMc();
var s = new Sound(mc);
s.attachSound(id);
s.setVolume(volume * 100);
s.start();
};
snd.stopAll = function () {
for (var i in this.lib) {
this.lib[i].stop();
}
};
snd.getMc = function () {
this.actMc++;
if (this.actMc >= this.mcs.length) {
this.actMc = 0;
}
return(this.mcs[this.actMc]);
};
snd.stop = function (id) {
this.lib[id].stop();
this.lib[id].playing = 0;
};
snd.load("reflect");
snd.load("sndCoin");
snd.load("sndWhistle");
snd.load("sndKick");
snd.load("sndCheer");
stop();
gravity = 0.0015;
friction = 0.997;
flex = {x:0.8, y:0.5};
kickStrength = 0.01;
clickSustain = 100;
walls = new Object();
walls.x0 = 0;
walls.x1 = 550;
walls.y0 = 0;
walls.y1 = 375;
ball = new Object();
ball.mc = ballMc;
ball.radius = 35;
ball.init = function () {
this.x = 275;
this.y = 200;
this.vx = 0;
this.vy = 0;
this.redraw();
};
ball.redraw = function () {
this.mc._x = this.x;
this.mc._y = this.y;
this.mc.ball.gfx.skin._rotation = this.mc.ball.gfx.skin._rotation + (this.vx * 20);
_root.shadowMc._y = _root.walls.y1;
_root.shadowMc._x = this.x;
var scale = ((500 - ((_root.walls.y1 - this.radius) - this.y)) / 500);
_root.shadowMc._xscale = scale * 100;
_root.shadowMc._yscale = scale * 100;
};
ball.move = function () {
if (this.y <= ((_root.walls.y1 - this.radius) - 1)) {
this.vy = this.vy + (_root.gravity * _global.dt);
} else {
this.vx = this.vx * 0.8;
}
this.x = this.x + (this.vx * _global.dt);
this.y = this.y + (this.vy * _global.dt);
if (this.y > (_root.walls.y1 - this.radius)) {
this.vy = (Math.abs(this.vy) * _root.flex.y) * -1;
this.y = _root.walls.y1 - this.radius;
this.vx = this.vx * _root.flex.x;
if (Math.abs(this.vy) < 0.1) {
this.vy = this.vy * 0.5;
}
if (Math.abs(this.vy) < 0.02) {
this.vy = 0;
this.y = _root.walls.y1 - this.radius;
}
_root.firstHighscore = true;
if (_root.firstFloor) {
_root.firstFloor = false;
_root.finalScore = _root.actScore;
_root.osd.gotoAndPlay("score");
_root.snd.playEvent("sndWhistle", 0.5);
if (_root.highScoreLit) {
_root.highScoreLit = false;
_root.display.highscore.gotoAndPlay("off");
}
_root.actScore = 0;
}
var volume = Math.min(Math.abs(this.vy), 0.5);
_root.snd.playEvent("reflect", volume);
}
if (this.x > (_root.walls.x1 - this.radius)) {
this.vx = (Math.abs(this.vx) * _root.flex.x) * -1;
this.x = (2 * (_root.walls.x1 - this.radius)) - this.x;
}
if (this.x < (_root.walls.x0 + this.radius)) {
this.vx = Math.abs(this.vx) * _root.flex.x;
this.x = (2 * (_root.walls.x0 + this.radius)) - this.x;
}
for (var i in _root.bonus) {
var coin = _root.bonus[i];
if (!coin.active) {
continue;
}
var d = Math.sqrt(Math.pow(coin._x - this.x, 2) + Math.pow(coin._y - this.y, 2));
if (d < (this.radius + 10)) {
var mc = _root.bonusosd.attachMovie("bonusosd", "b" + _root.coinCount, _root.coinCount);
mc._x = coin._x;
mc._y = coin._y;
_root.snd.play("sndCoin");
_root.score(5);
_root.coinCount++;
coin.vanish();
}
}
this.redraw();
};
mouseListener = function () {
_root.actClickSustain = _root.clickSustain;
_root.processClick();
};
processClick = function () {
var click = {x:_root._xmouse - _root.ballMc._x, y:_root._ymouse - _root.ballMc._y};
var d = Math.sqrt(Math.pow(click.x, 2) + Math.pow(click.y, 2));
if (d > _root.ball.radius) {
return(undefined);
}
_root.snd.playEvent("sndKick", 0.3);
if (_root.firstShot) {
_root.firstShot = false;
_root.osd.gotoAndPlay("hideHelp");
}
_root.firstFloor = true;
_root.actClickSustain = 0;
var power = (Math.sin((((_root.ball.y + 150) / (_root.walls.y1 + 150)) * Math.PI) * 0.5) * 0.02);
_root.ball.vy = (_root.ball.vy * 0.1) - (((click.y * 0.2) + 30) * power);
_root.ball.vx = _root.ball.vx - (Math.sin(((click.x / _root.ball.radius) * Math.PI) * 0.5) * 0.5);
var v = Math.sqrt(Math.pow(_root.ball.vx, 2) + Math.pow(_root.ball.vy, 2));
var r = ((Math.acos(_root.ball.vx / v) / Math.PI) * -180);
_root.ballMc._rotation = r;
_root.ballMc.ball.gfx._rotation = r * -1;
_root.ballMc.gotoAndPlay("kick");
_root.score(1);
};
score = function (n) {
_root.actScore = _root.actScore + n;
_root.display.score.gotoAndPlay("flash");
if (_root.actScore > _root.maxScore) {
if (_root.firstHighscore && (_root.actScore >= 5)) {
_root.firstHighscore = false;
_root.snd.playEvent("sndCheer", 0.5);
_root.osd.gotoAndPlay("highscore");
_root.highScoreLit = true;
_root.display.highscore.gotoAndPlay("on");
}
_root.maxScore = _root.actScore;
}
};
stepMain = function () {
if ((Math.random() < 0.005) && (getTimer() > 10000)) {
var mc = _root.bonus.attachMovie("coin", "coin" + _root.coinCount, 100 + _root.coinCount);
mc._x = (Math.random() * 520) + 15;
mc._y = (Math.random() * 150) + 40;
_root.coinCount++;
}
_root.ball.move();
if (_root.actClickSustain > 0) {
_root.actClickSustain = _root.actClickSustain - _global.dt;
_root.processClick();
}
};
submitScore = function () {
if (_url.indexOf("playaholics") != -1) {
_root.submit.game = _root.gameName;
_root.submit.score = _root.maxScore;
_root.submit.getURL("http://www.playaholics.com/comp_entry.php", "_top", "POST");
} else {
_global.api.highscore.submit(_root.gameName, "", _root.maxScore, 0);
}
};
fscommand ("fullscreen", "true");
ball.init();
_root.firstShot = true;
_root.actScore = 0;
_root.maxScore = 0;
_root.coinCount = 0;
_root.actClickSustain = 0;
this.onMouseDown = mouseListener;
this.onEnterFrame = stepMain;
Instance of Symbol 95 MovieClip "pointer" in Frame 4
onClipEvent (load) {
Mouse.hide();
}
onClipEvent (mouseMove) {
_x = _root._xmouse;
_y = _root._ymouse;
updateAfterEvent();
}
Symbol 5 MovieClip Frame 10
if (Math.random() > 0.1) {
gotoAndPlay (1);
}
Symbol 6 MovieClip [coin] Frame 1
stop();
timestamp = getTimer();
active = 1;
this.onEnterFrame = function () {
var dt = (getTimer() - timestamp);
if (dt > 7000) {
this.vanish();
}
};
vanish = function () {
this.active = 0;
this.onEnterFrame = undefined;
this.gotoAndPlay("vanish");
};
Symbol 6 MovieClip [coin] Frame 11
stop();
this.removeMovieClip();
Symbol 10 MovieClip [bonusosd] Frame 33
this.removeMovieClip();
Symbol 15 Button
on (release) {
getURL (("http://www.neodelight.com?ref=" + _root.game) + "&ref_loc=intro", "_BLANK");
}
Symbol 26 MovieClip Frame 1
startFrame = _parent._currentframe;
Symbol 26 MovieClip Frame 2
vol = (1 - ((_parent._currentFrame - startFrame) / (_parent._totalFrames - startFrame))) * 100;
if (vol < 0) {
vol = 0;
}
_parent.snd.setVolume(vol);
Symbol 26 MovieClip Frame 3
gotoAndPlay (2);
Symbol 27 MovieClip Frame 1
snd = new Sound(this);
snd.setVolume(100);
_parent.stop();
Symbol 27 MovieClip Frame 123
stop();
_parent.play();
Symbol 35 MovieClip Frame 1
stop();
Symbol 35 MovieClip Frame 5
gotoAndStop (1);
Symbol 35 MovieClip Frame 10
gotoAndStop (1);
Symbol 39 Button
on (release) {
_root.submitScore();
}
Symbol 41 Button
on (release) {
getURL (("http://www.neodelight.com/downloads/" + _root.gameName) + ".exe");
}
Symbol 46 MovieClip Frame 1
stop();
Symbol 46 MovieClip Frame 8
stop();
Symbol 46 MovieClip Frame 15
stop();
Symbol 50 Button
on (release) {
getURL ((("http://www.neodelight.com?ref=" + _root.gameName) + "&ref_loc=moregames&ref_ver=") + _root.version, "_TOP");
}
Symbol 60 MovieClip Frame 1
stop();
Symbol 60 MovieClip Frame 7
stop();
Symbol 60 MovieClip Frame 50
gotoAndStop (7);
Symbol 60 MovieClip Frame 51
mc.display = (_root.finalScore + " POINT") + ((_root.finalScore > 1) ? "S" : "");
play();
Symbol 60 MovieClip Frame 87
gotoAndStop (7);
Symbol 69 MovieClip Frame 1
stop();
Symbol 81 Button
on (release) {
_root.snd.active = 0;
nextFrame();
}
Symbol 86 Button
on (release) {
_root.snd.active = 1;
prevFrame();
}
Symbol 87 MovieClip Frame 1
stop();
Symbol 93 MovieClip Frame 1
stop();
Symbol 95 MovieClip Frame 1
stop();
Symbol 99 MovieClip Frame 1
#initclip 1
_global.api = new Object();
_global.api.highscore = new Object();
_global.api.highscore.initSession = function () {
this.session = "";
while (this.session.length < 20) {
this.session = this.session + this.charTable.charAt(Math.round(Math.random() * (this.charTable.length - 4)));
}
this.charTableIndex = new Array();
var i = 0;
while (i < this.charTable.length) {
this.charTableIndex[this.charTable.charCodeAt(i)] = i;
i++;
}
};
_global.api.highscore.submit = function (pGame, pDisciple, pScore0, pScore1) {
var s = (("g=" + pGame) + "&");
s = s + (("d=" + pDisciple) + "&");
s = s + (("s0=" + pScore0) + "&");
s = s + (("s1=" + pScore1) + "&");
s = s + ("se=" + escape(session));
s = s + "&c=42";
var urlSubmit = ((this.urlSubmit + "?s=") + escape(this.encrypt(this.encrypt(s, this.keystring), this.keystring2)).split("%").join("_"));
trace(urlSubmit);
getURL (urlSubmit, "_blank");
};
_global.api.highscore.encrypt = function (text, pKey) {
var crypt = "";
var checkSum = 0;
var shift;
var code;
var i = 0;
while (i < text.length) {
char = this.charTableIndex[text.charCodeAt(i)];
shift = this.charTableIndex[pKey.charCodeAt(i % pKey.length)];
code = (char + shift) + checkSum;
code = code % this.charTable.length;
crypt = crypt + this.charTable.charAt(code);
checkSum = checkSum + code;
i++;
}
checkSum = checkSum % this.charTable.length;
return((crypt + "") + this.charTable.charAt(checkSum));
};
_global.api.highscore.charTable = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&=.";
_global.api.highscore.keystring = "whytheheckdoyouwasteyourtimehackingthishighscorelist";
_global.api.highscore.keystring2 = "AnotherKey4You2FindOut4815jiagIOm30JK";
_global.api.highscore.urlSubmit = "http://www.neodelight.com/v4/high_enter.php";
_global.api.highscore.initSession();
#endinitclip
_visible = false;