Frame 1
_x = -600;
_y = -600;
game._x = 620;
game._y = 620;
Symbol 6 MovieClip [thing] Frame 1
function animate() {
var _local1 = _parent;
_x = (_x + (dx * _local1.speedfactor));
_y = (_y + (dy * _local1.speedfactor));
if ((_x < 0) && (dx <= 0)) {
_x = (_x + ((dx = -dx)));
}
if ((_x >= _local1.game_w) && (dx >= 0)) {
_x = (_x + ((dx = -dx)));
}
if ((_y < 0) && (dy <= 0)) {
_y = (_y + ((dy = -dy)));
}
if ((_y >= _local1.game_h) && (dy >= 0)) {
_y = (_y + ((dy = -dy)));
}
u = _x - _local1.player._x;
v = _y - _local1.player._y;
if (((u * u) + (v * v)) < 225) {
_local1.gameOver();
}
}
function stopMoving() {
onEnterFrame = null;
}
function startMoving() {
onEnterFrame = animate;
}
bg._alpha = 0;
startMoving();
Symbol 15 Button
on (press) {
_root.game.sendHighScore(name_var);
_root.game.high_score_prompt._visible = false;
}
Symbol 31 MovieClip Frame 1
function getScores() {
trace("get scores");
if (waiting) {
return(undefined);
}
timer.done = 0;
timer.loadVariables("get_high.php?q=" + Math.floor(Math.random() * 100000000));
waiting = true;
onEnterFrame = waitForScores;
}
function waitForScores() {
if (timer.done == 1) {
delete onEnterFrame;
scores[1].n_var = timer.name1;
scores[1].sc_var = timer.score1;
scores[1]._visible = true;
scores[2].n_var = timer.name2;
scores[2].sc_var = timer.score2;
scores[2]._visible = true;
scores[3].n_var = timer.name3;
scores[3].sc_var = timer.score3;
scores[3]._visible = true;
scores[4].n_var = timer.name4;
scores[4].sc_var = timer.score4;
scores[4]._visible = true;
scores[5].n_var = timer.name5;
scores[5].sc_var = timer.score5;
scores[5]._visible = true;
scores[6].n_var = timer.name6;
scores[6].sc_var = timer.score6;
scores[6]._visible = true;
scores[7].n_var = timer.name7;
scores[7].sc_var = timer.score7;
scores[7]._visible = true;
scores[8].n_var = timer.name8;
scores[8].sc_var = timer.score8;
scores[8]._visible = true;
scores[9].n_var = timer.name9;
scores[9].sc_var = timer.score9;
scores[9]._visible = true;
scores[10].n_var = timer.name10;
scores[10].sc_var = timer.score10;
scores[10]._visible = true;
waiting = false;
}
}
createEmptyMovieClip("timer", 8564);
scores = new Array();
waiting = false;
i = 1;
while (i <= 10) {
attachMovie("ascore", "score" + i, 1000 + i);
scores[i] = eval ("score" + i);
socres[i]._x = 0;
scores[i]._y = 10 + (20 * i);
scores[i]._visible = false;
i++;
}
getScores();
Symbol 33 MovieClip Frame 1
function somethingOne(a) {
if (a != "") {
var _local1;
_local1 = ((Math.floor(Math.random() * 1000) + (your_score * 1000)) + session_id) + (game_id * 3);
url = (((((((((((("21213433_highscore.php?game_id=" + game_id) + "&length=") + game_length) + "&start=") + (startTime - flash_startTime)) + "&score=") + your_score) + "&session_id=") + session_id) + "&name=") + escape(name)) + "&c=") + _local1;
timer.done = 0;
timer.loadVariables(url);
onEnterFrame = highScoreWaitTimer;
} else {
high_score_prompt._visible = false;
start_button._visible = true;
}
}
function highScoreWaitTimer() {
if (timer.done != 0) {
high_score_prompt._visible = false;
start_button._visible = true;
game_over._visible = true;
topten.getScores();
delete onEnterFrame;
}
}
function startGame() {
if (playing) {
return(undefined);
}
topten.getScores();
playing = true;
startTime = getTimer();
game_id = Math.floor(Math.random() * 1000000000);
game_count++;
start_button._visible = false;
game_over._visible = false;
your_score = 0;
clear();
lineStyle(1, 0);
moveTo(0, 0);
lineTo(game_w, 0);
lineTo(game_w, game_h);
lineTo(0, game_h);
lineTo(0, 0);
var i = 0;
while (i < numThings) {
eval ("thing_" + i).removeMovieClip();
i++;
}
numThings = 0;
attachMovie("player", "player", 9999);
attachMovie("box", "box", 900);
moveBox();
onEnterFrame = gameFrame;
}
function waitForGameOverResult() {
if (timer.done != 0) {
delete onEnterFrame;
if (timer.high == 1) {
game_over._visible = false;
high_score_prompt._visible = true;
high_score_prompt.name_var = "";
} else {
topten.getScores();
start_button._visible = true;
}
}
}
function gameOver() {
if (playing) {
playing = false;
if (your_score > hi_score) {
hi_score = your_score;
}
game_length = getTimer() - startTime;
url = (((((((((("37829171_gameover.php?game_id=" + game_id) + "&length=") + game_length) + "&start=") + (startTime - flash_startTime)) + "&score=") + your_score) + "&session_id=") + session_id) + "&game_count=") + game_count;
timer.done = 0;
timer.loadVariables(url);
onEnterFrame = waitForGameOverResult;
game_over._visible = true;
}
}
function addThing() {
attachMovie("thing", "thing_" + numThings, 1000 + numThings);
var t = eval ("thing_" + numThings);
numThings++;
var u = 0;
var v = 0;
while (((u * u) + (v * v)) < 6400) {
t._x = Math.random() * game_w;
t._y = Math.random() * game_h;
u = t._x - player._x;
v = t._y - player._y;
}
t.dx = (Math.random() * 4) - 2;
t.dy = (Math.random() * 4) - 2;
}
function sendHighScore(name) {
var _local2 = name;
if (_local2 != "") {
var c;
var r;
var _local3;
var m;
r = Math.floor(Math.random() * 874) + 113;
m = 99972 - (Math.floor(r / 3) * 2);
_local3 = (game_id % m) * ((r % 37) + 16);
_local3 = _local3 + ((session_id % m) * ((r % 179) + 15));
_local3 = _local3 + (your_score * ((r % 812) + 13));
_local3 = _local3 + (Math.floor(your_score / 3) * 79);
_local3 = _local3 + (Math.floor(your_score / 11) * 52);
var _local1 = 0;
while (_local1 < _local2.length) {
_local3 = _local3 + (ord(_local2.substr(_local1, 1)) * (_local1 + 101));
_local1++;
}
_local3 = _local3 % m;
c = (r * 100000) + _local3;
url = (((((((((((("989662231_highscore.php?game_id=" + game_id) + "&length=") + game_length) + "&start=") + (startTime - flash_startTime)) + "&score=") + your_score) + "&session_id=") + session_id) + "&name=") + escape(_local2)) + "&c=") + c;
timer.done = 0;
timer.loadVariables(url);
onEnterFrame = highScoreWaitTimer;
} else {
high_score_prompt._visible = false;
start_button._visible = true;
}
}
function moveBox() {
box._x = Math.random() * game_w;
box._y = Math.random() * game_h;
}
function gameFrame() {
doTiming();
var i;
var _local1;
var t;
var _local3;
var _local2;
var ox = player._x;
var oy = player._y;
if (Key.isDown(65)) {
addThing();
}
dx = _xmouse - player._x;
dy = _ymouse - player._y;
_local1 = Math.sqrt((dx * dx) + (dy * dy));
dx = dx / _local1;
dy = dy / _local1;
if (_local1 > 20) {
_local1 = 20;
}
player._x = player._x + (dx * _local1);
player._y = player._y + (dy * _local1);
if (player._x < 0) {
player._x = 0;
}
if (player._y < 0) {
player._y = 0;
}
if (player._x > game_w) {
player._x = game_w;
}
if (player._y > game_h) {
player._y = game_h;
}
_local3 = player._x - box._x;
_local2 = player._y - box._y;
if (((_local3 * _local3) < 400) && ((_local2 * _local2) < 400)) {
your_score = your_score + 5;
moveBox();
addThing();
}
}
game_w = 200;
game_h = 200;
game_over._visible = false;
attachMovie("prompt_mc", "high_score_prompt", 10182);
high_score_prompt._x = 8;
high_score_prompt._y = 9;
high_score_prompt._visible = false;
numThings = 0;
update = 30000;
draw_player_trail = false;
thing_movement_straight = false;
things_have_circles = false;
auto_start_game = true;
player_use_keyboard = false;
speedfactor = 1;
game_count = 0;
createEmptyMovieClip("timer", 8564);
flash_startTime = getTimer();
lastPacketTime = getTimer() - update;
session_id = Math.floor(Math.random() * 1000000000);
if (auto_start_game) {
startGame();
}
Instance of Symbol 25 MovieClip "start_button" in Symbol 33 MovieClip Frame 1
on (press) {
_root.game.startGame();
}